]> granicus.if.org Git - llvm/commitdiff
[AArch64] Crypto requires FP.
authorJames Molloy <james.molloy@arm.com>
Wed, 5 Apr 2017 10:44:38 +0000 (10:44 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 5 Apr 2017 10:44:38 +0000 (10:44 +0000)
So if FP is disabled, crypto should also be disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299531 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64.td
test/MC/AArch64/nofp-crypto-diagnostic.s [new file with mode: 0644]

index 84473fd72ada2c2d497cd7e90c2ad0b3dcbdc2a6..519ca28946830be06dc55f6eaff6acdcee3c6e85 100644 (file)
@@ -27,7 +27,7 @@ def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
   "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
 
 def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
-  "Enable cryptographic instructions">;
+  "Enable cryptographic instructions", [FeatureNEON]>;
 
 def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
   "Enable ARMv8 CRC-32 checksum instructions">;
diff --git a/test/MC/AArch64/nofp-crypto-diagnostic.s b/test/MC/AArch64/nofp-crypto-diagnostic.s
new file mode 100644 (file)
index 0000000..36da8a8
--- /dev/null
@@ -0,0 +1,8 @@
+// RUN: not llvm-mc  -triple aarch64-none-linux-gnu -mattr=+neon,+crypto,-fp-armv8 < %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
+
+        sha1h s0, s1
+
+// CHECK-ERROR: error: instruction requires: crypto
+// CHECK-ERROR-NEXT:    sha1h s0, s1
+// CHECK-ERROR-NEXT:    ^