[clang] [clang][AArch64] Don't #define __ARM_FEATURE_CRC32 when -crc is specified in -target-feature (PR #132167)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 21 05:06:40 PDT 2025


XiaShark wrote:

> > There are lots of bugs like this in this area, this is not the only feature like this. Should this be fixed in a more general way?
> 
> We've looked at this internally but didn't get around to finishing it. `HasD128` etc map to `Extensions` in `AArch64Features.td`, I think the way to do it is to generate their declarations and initialisation code in `ARMTargetDefEmitter.cpp` (`AArch64TargetParserDef.inc`). @XiaShark if you'd like to look at it go ahead, otherwise let me know and I can put up a patch.

I am currently attempting to add some conditional logic solely within the AArch64.cpp file to handle all the features. At present, it appears that the setArchFeatures() function forcibly enables certain features after acquiring the ArchInfo. Therefore, I am considering separating the judgment of ArchInfo from other features, placing them before and after the setArchFeatures() function call respectively, and processing each -feature. Could you advise if this approach would be effective?

https://github.com/llvm/llvm-project/pull/132167


More information about the cfe-commits mailing list