[Bug target/82641] Unable to enable crc32 for a certain function with target attribute on ARM (aarch32)

rearnsha at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 2 13:47:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82641

--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Tamar Christina from comment #5)
> My patch adds support for 
> 
> 
> ```
> #pragma GCC push_options
> #pragma GCC target("arch=armv8-a+crc")
> __attribute__((target("arch=armv8-a+crc"))) uint32_t crc32cw(uint32_t crc,
> uint32_t val)
> ```
> 
> and just
> 
> 
> ```
> #pragma GCC push_options
> #pragma GCC target("+crc")
> __attribute__((target("+crc"))) uint32_t crc32cw(uint32_t crc, uint32_t val)
> ```
> 
> if the compiler was invoked with `-march=armv8-a`.
> 
> However it currently doesn't allow
> 
> 
> ```
> #pragma GCC push_options
> #pragma GCC target("armv8-a+crc")
> __attribute__((target("armv8-a+crc"))) uint32_t crc32cw(uint32_t crc,
> uint32_t val)
> ```
> 
> as it doesn't know if you wanted to change the `fpu` or `arch` here.
> Should I support this case as well?


No, I think we should insist on an arch= or fpu= prefix for all but the adding
extensions case.

Note that extensions can only modify the existing architecture if it supports
that extension.  This is because the modifiers are context dependent: for
example the +fp extension (new in gcc-8) will enable floating-point
instructions that come with the specified architecture.

Also note that in the long-term -mfpu and pragma/attribute variants thereof are
likely to be deprecated in favour of specifying all this through the
architecture string.


More information about the Gcc-bugs mailing list