From fa09f4ea584e1bc33036e9ef82142db92b31da7c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 11 Nov 2016 10:14:31 +0000 Subject: [PATCH] [AArch64] Fix feature dependencies for +simd and +crypto According to the gas manual, +simd implies +fp and +crypto implies +simd. Make sure +nofp turns +simd, +crypto and +fp16 off. gas/ 2016-11-07 Szabolcs Nagy * config/tc-aarch64.c (aarch64_features): Fix "simd" and "crypto". * testsuite/gas/aarch64/illegal-crypto-nofp.d: New. * testsuite/gas/aarch64/illegal-crypto-nofp.l: New. * testsuite/gas/aarch64/illegal-fp16-nofp.d: New. * testsuite/gas/aarch64/illegal-fp16-nofp.l: New. * testsuite/gas/aarch64/illegal-fp16-nofp.s: New. --- gas/ChangeLog | 9 +++++++++ gas/config/tc-aarch64.c | 4 ++-- gas/testsuite/gas/aarch64/illegal-crypto-nofp.d | 3 +++ gas/testsuite/gas/aarch64/illegal-crypto-nofp.l | 19 +++++++++++++++++++ gas/testsuite/gas/aarch64/illegal-fp16-nofp.d | 2 ++ gas/testsuite/gas/aarch64/illegal-fp16-nofp.l | 6 ++++++ gas/testsuite/gas/aarch64/illegal-fp16-nofp.s | 7 +++++++ 7 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 gas/testsuite/gas/aarch64/illegal-crypto-nofp.d create mode 100644 gas/testsuite/gas/aarch64/illegal-crypto-nofp.l create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.d create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.l create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 2381ed7..8904f5d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2016-11-11 Szabolcs Nagy + + * config/tc-aarch64.c (aarch64_features): Fix "simd" and "crypto". + * testsuite/gas/aarch64/illegal-crypto-nofp.d: New. + * testsuite/gas/aarch64/illegal-crypto-nofp.l: New. + * testsuite/gas/aarch64/illegal-fp16-nofp.d: New. + * testsuite/gas/aarch64/illegal-fp16-nofp.l: New. + * testsuite/gas/aarch64/illegal-fp16-nofp.s: New. + 2016-11-09 H.J. Lu PR binutils/20799 diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 0d638e7..4a55bec 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -8389,13 +8389,13 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = { {"crc", AARCH64_FEATURE (AARCH64_FEATURE_CRC, 0), AARCH64_ARCH_NONE}, {"crypto", AARCH64_FEATURE (AARCH64_FEATURE_CRYPTO, 0), - AARCH64_ARCH_NONE}, + AARCH64_FEATURE (AARCH64_FEATURE_SIMD, 0)}, {"fp", AARCH64_FEATURE (AARCH64_FEATURE_FP, 0), AARCH64_ARCH_NONE}, {"lse", AARCH64_FEATURE (AARCH64_FEATURE_LSE, 0), AARCH64_ARCH_NONE}, {"simd", AARCH64_FEATURE (AARCH64_FEATURE_SIMD, 0), - AARCH64_ARCH_NONE}, + AARCH64_FEATURE (AARCH64_FEATURE_FP, 0)}, {"pan", AARCH64_FEATURE (AARCH64_FEATURE_PAN, 0), AARCH64_ARCH_NONE}, {"lor", AARCH64_FEATURE (AARCH64_FEATURE_LOR, 0), diff --git a/gas/testsuite/gas/aarch64/illegal-crypto-nofp.d b/gas/testsuite/gas/aarch64/illegal-crypto-nofp.d new file mode 100644 index 0000000..ee52a9c --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-crypto-nofp.d @@ -0,0 +1,3 @@ +#as: -march=armv8-a+crypto+nofp +#source: crypto.s +#error-output: illegal-crypto-nofp.l diff --git a/gas/testsuite/gas/aarch64/illegal-crypto-nofp.l b/gas/testsuite/gas/aarch64/illegal-crypto-nofp.l new file mode 100644 index 0000000..a5649de --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-crypto-nofp.l @@ -0,0 +1,19 @@ +[^:]*: Assembler messages: +[^:]+:27: Error: selected processor does not support `aese v7\.16b,v31\.16b' +[^:]+:28: Error: selected processor does not support `aesd v7\.16b,v31\.16b' +[^:]+:29: Error: selected processor does not support `aesmc v7\.16b,v31\.16b' +[^:]+:30: Error: selected processor does not support `aesimc v7\.16b,v31\.16b' +[^:]+:32: Error: selected processor does not support `sha1h s7,s31' +[^:]+:33: Error: selected processor does not support `sha1su1 v7\.4s,v31\.4s' +[^:]+:34: Error: selected processor does not support `sha256su0 v7\.4s,v31\.4s' +[^:]+:36: Error: selected processor does not support `sha1c q7,s15,v31\.4s' +[^:]+:37: Error: selected processor does not support `sha1p q7,s15,v31\.4s' +[^:]+:38: Error: selected processor does not support `sha1m q7,s15,v31\.4s' +[^:]+:40: Error: selected processor does not support `sha1su0 v7\.4s,v15\.4s,v31\.4s' +[^:]+:41: Error: selected processor does not support `sha256h q7,q15,v31\.4s' +[^:]+:42: Error: selected processor does not support `sha256h2 q7,q15,v31\.4s' +[^:]+:43: Error: selected processor does not support `sha256su1 v7\.4s,v15\.4s,v31\.4s' +[^:]+:45: Error: selected processor does not support `pmull v7\.8h,v15\.8b,v31\.8b' +[^:]+:46: Error: selected processor does not support `pmull v7\.1q,v15\.1d,v31\.1d' +[^:]+:47: Error: selected processor does not support `pmull2 v7\.8h,v15\.16b,v31\.16b' +[^:]+:48: Error: selected processor does not support `pmull2 v7\.1q,v15\.2d,v31\.2d' diff --git a/gas/testsuite/gas/aarch64/illegal-fp16-nofp.d b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.d new file mode 100644 index 0000000..7aefc53 --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.d @@ -0,0 +1,2 @@ +#as: -march=armv8.2-a+fp16+nofp -mno-verbose-error +#error-output: illegal-fp16-nofp.l diff --git a/gas/testsuite/gas/aarch64/illegal-fp16-nofp.l b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.l new file mode 100644 index 0000000..f153689 --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.l @@ -0,0 +1,6 @@ +[^:]*: Assembler messages: +[^:]+:3: Error: selected processor does not support `fneg s0,s1' +[^:]+:4: Error: selected processor does not support `fneg h0,h1' +[^:]+:5: Error: selected processor does not support `fneg v0\.4s,v1\.4s' +[^:]+:6: Error: selected processor does not support `fneg v0\.8h,v1\.8h' +[^:]+:7: Error: selected processor does not support `neg v0\.16b,v1\.16b' diff --git a/gas/testsuite/gas/aarch64/illegal-fp16-nofp.s b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.s new file mode 100644 index 0000000..27dd43d --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-fp16-nofp.s @@ -0,0 +1,7 @@ +// Test -march=armv8.2-a+fp16+nofp to disable fp, fp16 and simd. +.text + fneg s0, s1 + fneg h0, h1 + fneg v0.4s, v1.4s + fneg v0.8h, v1.8h + neg v0.16b, v1.16b -- 2.7.4