[Driver][ARM] Disable unsupported features when nofp arch extension is used
authorVictor Campos <victor.campos@arm.com>
Tue, 21 Jul 2020 16:18:20 +0000 (17:18 +0100)
committerVictor Campos <victor.campos@arm.com>
Wed, 29 Jul 2020 13:13:22 +0000 (14:13 +0100)
commitd1a3396bfbc6fd6df927f2864c18d86e742cabff
tree9ee6650215e937cb61e4600b7ddf64b0502d31c5
parent8725a49409c47c25118915c4b3b41bd0d9d32bd7
[Driver][ARM] Disable unsupported features when nofp arch extension is used

A list of target features is disabled when there is no hardware
floating-point support. This is the case when one of the following
options is passed to clang:

 - -mfloat-abi=soft
 - -mfpu=none

This option list is missing, however, the extension "+nofp" that can be
specified in -march flags, such as "-march=armv8-a+nofp".

This patch also disables unsupported target features when nofp is passed
to -march.

Differential Revision: https://reviews.llvm.org/D82948
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/test/CodeGen/arm-bf16-softfloat.c
clang/test/Driver/arm-nofp-disabled-features.c [new file with mode: 0644]
llvm/include/llvm/Support/ARMTargetParser.h
llvm/lib/Support/ARMTargetParser.cpp
llvm/unittests/Support/TargetParserTest.cpp