Page MenuHomePhabricator

[ARM] Preserve fpu behaviour for '-crypto'
ClosedPublic

Authored by dnsampaio on Sep 16 2019, 2:02 AM.

Details

Summary

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.

Diff Detail

Event Timeline

dnsampaio created this revision.Sep 16 2019, 2:02 AM

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

dnsampaio updated this revision to Diff 224323.Oct 10 2019, 5:58 AM

Attending review request:

  • Fixed to only add '-crypto' when not passing -fno-integrated-as
  • Fixed test to use arm-none-none-eabi
  • Changed comments
dnsampaio marked 3 inline comments as done.Oct 10 2019, 5:59 AM
peter.smith accepted this revision.Oct 10 2019, 6:22 AM

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.

This revision is now accepted and ready to land.Oct 10 2019, 6:22 AM
This revision was automatically updated to reflect the committed changes.