llvm-project/clang/lib/Driver/ToolChains/Arch
Diogo N. Sampaio 73ec745793 [ARM] Take into account -mcpu and -mfpu options while handling 'crypto' feature
Submittin in behalf of krisb (Kristina Bessonova) <ch.bessonova@gmail.com>

Summary:
'+crypto' means '+aes' and '+sha2' for arch >= ARMv8 when they were
not disabled explicitly. But this is correctly handled only in case of
'-march' option, though the feature may also be specified through
the '-mcpu' or '-mfpu' options. In the following example:

  $ clang -mcpu=cortex-a57 -mfpu=crypto-neon-fp-armv8

'aes' and 'sha2' are disabled that is quite unexpected:

  $ clang -cc1 -triple armv8--- -target-cpu cortex-a57
    <...> -target-feature -sha2 -target-feature -aes -target-feature +crypto

This exposed by https://reviews.llvm.org/D63936 that makes
the 'aes' and 'sha2' features disabled by default.

So, while handling the 'crypto' feature we need to take into account:
  - a CPU name, as it provides the information about architecture
    (if no '-march' option specified),
  - features, specified by the '-mcpu' and '-mfpu' options.

Reviewers: SjoerdMeijer, ostannard, labrinea, dnsampaio

Reviewed By: dnsampaio

Subscribers: ikudrin, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66018

Author: krisb
llvm-svn: 371597
2019-09-11 09:06:17 +00:00
..
AArch64.cpp [AArch64] Support selecting TPIDR_EL[1-3] as the thread base 2019-03-29 13:32:41 +00:00
AArch64.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ARM.cpp [ARM] Take into account -mcpu and -mfpu options while handling 'crypto' feature 2019-09-11 09:06:17 +00:00
ARM.h [ARM] Allow "-march=foo+fp" to vary with foo 2019-06-05 13:12:01 +00:00
Mips.cpp [Driver] Delete dead code 2019-07-12 13:21:58 +00:00
Mips.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PPC.cpp [PowerPC] Set the default PLT mode on musl to Secure PLT 2019-05-30 02:13:15 +00:00
PPC.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RISCV.cpp [RISCV] Make -march=rv{32,64}gc the default in RISC-V Linux 2019-09-10 08:16:24 +00:00
RISCV.h [RISCV] Make -march=rv{32,64}gc the default in RISC-V Linux 2019-09-10 08:16:24 +00:00
Sparc.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sparc.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SystemZ.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SystemZ.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
X86.cpp Fix a typo in target features 2019-07-16 22:32:17 +00:00
X86.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00