[PATCH] D26858: [AArch64] Don't constrain the assembler when using -mgeneral-regs-only
silviu.baranga@arm.com via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 18 09:13:31 PST 2016
sbaranga updated this revision to Diff 78541.
sbaranga added a comment.
Update regression tests.
https://reviews.llvm.org/D26858
Files:
docs/UsersManual.rst
lib/Driver/Tools.cpp
test/Driver/aarch64-mgeneral_regs_only.c
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -2623,9 +2623,33 @@
D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args);
if (Args.getLastArg(options::OPT_mgeneral_regs_only)) {
+ // Find the last of each feature.
+ llvm::StringMap<unsigned> LastOpt;
+ for (unsigned I = 0, N = Features.size(); I < N; ++I) {
+ StringRef Name = Features[I];
+ assert(Name[0] == '-' || Name[0] == '+');
+ LastOpt[Name.drop_front(1)] = I;
+ }
+
+ llvm::StringMap<unsigned>::iterator I = LastOpt.find("neon");
+ if (I != LastOpt.end() && Features[I->second] == "+neon")
+ Features.push_back("+neonasm");
+
+ I = LastOpt.find("crypto");
+ if (I != LastOpt.end() && Features[I->second] == "+crypto")
+ Features.push_back("+cryptoasm");
+
+ I = LastOpt.find("fp-armv8");
+ if (I != LastOpt.end() && Features[I->second] == "+fp-armv8")
+ Features.push_back("+fp-armv8asm");
+
+ I = LastOpt.find("fullfp16");
+ if (I != LastOpt.end() && Features[I->second] == "+fullfp16")
+ Features.push_back("+fullfp16asm");
+
Features.push_back("-fp-armv8");
- Features.push_back("-crypto");
Features.push_back("-neon");
+ Features.push_back("-crypto");
}
// En/disable crc
Index: docs/UsersManual.rst
===================================================================
--- docs/UsersManual.rst
+++ docs/UsersManual.rst
@@ -1188,7 +1188,8 @@
Generate code which only uses the general purpose registers.
This option restricts the generated code to use general registers
- only. This only applies to the AArch64 architecture.
+ only but does not restrict the assembler. This only applies to the
+ AArch64 architecture.
.. option:: -mcompact-branches=[values]
Index: test/Driver/aarch64-mgeneral_regs_only.c
===================================================================
--- test/Driver/aarch64-mgeneral_regs_only.c
+++ test/Driver/aarch64-mgeneral_regs_only.c
@@ -4,6 +4,18 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
// RUN: %clang -target arm64-linux-eabi -mgeneral-regs-only %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-FP %s
+// RUN: %clang -target aarch64-linux-eabi -mgeneral-regs-only -march=armv8.1a+crypto %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FP %s
+
+// CHECK-NO-FP: "-target-feature" "+neonasm"
+// CHECK-NO-FP-NOT: "-target-feature" "+fp-armv8asm"
+// CHECK-NO-FP-NOT: "-target-feature" "+cryptoasm"
// CHECK-NO-FP: "-target-feature" "-fp-armv8"
-// CHECK-NO-FP: "-target-feature" "-crypto"
// CHECK-NO-FP: "-target-feature" "-neon"
+// CHECK-NO-FP: "-target-feature" "-crypto"
+
+// CHECK-FP: "-target-feature" "+neonasm"
+// CHECK-FP: "-target-feature" "+cryptoasm"
+// CHECK-FP: "-target-feature" "-fp-armv8"
+// CHECK-FP: "-target-feature" "-neon"
+// CHECK-FP: "-target-feature" "-crypto"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26858.78541.patch
Type: text/x-patch
Size: 2963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161118/329d5837/attachment.bin>
More information about the cfe-commits
mailing list