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



The following reply was made to PR toolchain/49275; it has been noted by GNATS.

From: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: toolchain-manager%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
	netbsd-bugs%netbsd.org@localhost, dennis.c.ferguson%gmail.com@localhost
Subject: Re: toolchain/49275: compiler_rt version of __clzsi2() seems to
 result in universally inferior code
Date: Tue, 9 Dec 2014 22:37:11 +0100

 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