NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/49275: compiler_rt version of __clzsi2() seems to result in universally inferior code



On Tue, Dec 09, 2014 at 07:35:00PM +0000, Dennis Ferguson wrote:
>  > Instruction count isn't a very accurate way of determining the
>  > execution time on modern cpus.
>  > Mispredicted branches can get very expensive, and multiple execution
>  > units mean that long dependency chains matter.

David is fully correct here.

>  subtle about code generation or machine execution, it is that the
>  the compiler_rt __clzsi2() implementation is crappy.

It is written on the idea that (a) all sane platforms have assembler
instructions or (b) have fine tuned assembler version or (c) have some
decent form of branch-free test-and-set.

Feel free to submit your implementation upstream, but personally I don't
see a strong enough reason to change anything here. Just way too much
text.

Joerg


Home | Main Index | Thread Index | Old Index