This patch restores the behaviour that -fpu overwrites the
architecture obtained from -march or -mcpu flags, not enforcing to
disable 'crypto' if march=armv7 and mfpu=neon-fp-armv8.
However, it does warn that 'crypto' is ignored when passing
mfpu=crypto-neon-fp-armv8.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
After retesting on a failing example and experimenting a bit, I think that we should only preserve +crypto with -fno-integrated-as. It would also be good to mention D66018 and maybe add the original author as a reviewer.
clang/lib/Driver/ToolChains/Arch/ARM.cpp | ||
---|---|---|
482–508 | Looking into this in more detail I think the comment can be made more specific. It seems like the main reason to keep +crypto is that when the non-integrated-assembler is used, then we get the directive: .fpu crypto-neon-fp-armv8 In arm-none-eabi-as the assembler will support crypto instructions. Clang will not as any use of crypto instructions will fail due lack of v8 support. With -fno-integrated-as -mfpu=crypto-neon-fp-armv8 some assemblers such as the GNU assembler will permit the use of crypto instructions as the fpu will override the architecture. We keep the crypto feature in this case to preserve compatibility. In all other cases we remove the crypto feature. | |
485 | I think we should only do this for -fno-integrated-as as the integrated assembler will fail if give a crypto instruction even with this change. With the integrated assembler we get: error: instruction requires: armv8 aese.8 q8, q9 | |
clang/test/Driver/arm-features.c | ||
84 | arm-arm-none-eabi is a vendor specific triple? Better to use arm-none-eabi |
Attending review request:
- Fixed to only add '-crypto' when not passing -fno-integrated-as
- Fixed test to use arm-none-none-eabi
- Changed comments
Thanks for the update. That looks good to me. Will be good to wait for a day before committing to give US timezone a chance to object.
I think we should only do this for -fno-integrated-as as the integrated assembler will fail if give a crypto instruction even with this change. With the integrated assembler we get: