This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: MN10300: Include saved registers in stack usage


On Wed, 5 Feb 2014, Jeff Law wrote:

> However, it's pretty easy to avoid the headaches and just provide a popcount
> routine.   I don't think this code is at all performance critical (once per
> function being compiled), so a simple popcount should be sufficient.  No need
> for lookup tables IMHO.

hwint.[ch] provide popcount_hwi, if HOST_WIDE_INT is a suitable type.

(Personally I think there are lots of bits of standard integer 
manipulation functionality, such as popcount, that are common in processor 
instructions and compiler intrinsics, but could do with having bindings in 
ISO C to provide a standard way to access that functionality.  Such 
bindings might take the form of library functions / macros that compilers 
/ library headers can then optimize as appropriate; that seems most in the 
ISO C style rather than __builtin_*.  Even outside of ISO C, I suspect 
there's quite a bit in common between target-specific builtins for 
different targets where a target-independent builtin would be better - and 
for that matter, target-specific builtins where some form of standard 
binding already exists but isn't supported in GCC, or where the 
target-specific builtin duplicates something generic in GNU C.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]