This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: MN10300: Include saved registers in stack usage
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, <aoliva at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Feb 2014 18:26:02 +0000
- Subject: Re: RFA: MN10300: Include saved registers in stack usage
- Authentication-results: sourceware.org; auth=none
- References: <87fvnx4z57 dot fsf at redhat dot com> <52F27362 dot 60303 at redhat dot com>
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