diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2019-05-16 11:57:44 +0100 |
---|---|---|
committer | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2019-05-16 16:36:34 +0100 |
commit | 3063888ecfd248ebb4a9b9c61819c9b6eb07bef2 (patch) | |
tree | 34bc07551c9099928a93e2c485ceb4caa6ac4240 /gas | |
parent | [PATCH 25/57][Arm][GAS] Add support for MVE instruction: vmvn, vqabs and vqneg (diff) | |
download | binutils-gdb-3063888ecfd248ebb4a9b9c61819c9b6eb07bef2.tar.gz binutils-gdb-3063888ecfd248ebb4a9b9c61819c9b6eb07bef2.tar.bz2 binutils-gdb-3063888ecfd248ebb4a9b9c61819c9b6eb07bef2.zip |
[PATCH 26/57][Arm][GAS] Add support for MVE instructions: vpnot and vpsel
gas/ChangeLog:
2019-05-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
* config/tc-arm.c (do_mve_vpsel): New encoding function.
(do_mve_vpnot): Likewise.
(insns): Add entries for MVE mnemonics.
* testsuite/gas/arm/mve-vpnot-bad.d: New test.
* testsuite/gas/arm/mve-vpnot-bad.l: New test.
* testsuite/gas/arm/mve-vpnot-bad.s: New test.
* testsuite/gas/arm/mve-vpsel-bad.d: New test.
* testsuite/gas/arm/mve-vpsel-bad.l: New test.
* testsuite/gas/arm/mve-vpsel-bad.s: New test.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 30 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpnot-bad.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpnot-bad.l | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpnot-bad.s | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpsel-bad.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpsel-bad.l | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/mve-vpsel-bad.s | 19 |
8 files changed, 113 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 8b3f9a1348c..188ad3b08c3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,17 @@ 2019-05-16 Andre Vieira <andre.simoesdiasvieira@arm.com> + * config/tc-arm.c (do_mve_vpsel): New encoding function. + (do_mve_vpnot): Likewise. + (insns): Add entries for MVE mnemonics. + * testsuite/gas/arm/mve-vpnot-bad.d: New test. + * testsuite/gas/arm/mve-vpnot-bad.l: New test. + * testsuite/gas/arm/mve-vpnot-bad.s: New test. + * testsuite/gas/arm/mve-vpsel-bad.d: New test. + * testsuite/gas/arm/mve-vpsel-bad.l: New test. + * testsuite/gas/arm/mve-vpsel-bad.s: New test. + +2019-05-16 Andre Vieira <andre.simoesdiasvieira@arm.com> + * config/tc-arm.c (do_neon_mvn): Change to accept MVE variants. (do_neon_sat_abs_neg): Likewise. (insns): Likewise. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index c7ff2043568..c2bb52a7862 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -15732,6 +15732,34 @@ do_mve_vmlas (void) } static void +do_mve_vpsel (void) +{ + neon_select_shape (NS_QQQ, NS_NULL); + + if (inst.cond > COND_ALWAYS) + inst.pred_insn_type = INSIDE_VPT_INSN; + else + inst.pred_insn_type = MVE_OUTSIDE_PRED_INSN; + + inst.instruction |= HI1 (inst.operands[0].reg) << 22; + inst.instruction |= LOW4 (inst.operands[1].reg) << 16; + inst.instruction |= LOW4 (inst.operands[0].reg) << 12; + inst.instruction |= HI1 (inst.operands[1].reg) << 7; + inst.instruction |= HI1 (inst.operands[2].reg) << 5; + inst.instruction |= LOW4 (inst.operands[2].reg); + inst.is_neon = 1; +} + +static void +do_mve_vpnot (void) +{ + if (inst.cond > COND_ALWAYS) + inst.pred_insn_type = INSIDE_VPT_INSN; + else + inst.pred_insn_type = MVE_OUTSIDE_PRED_INSN; +} + +static void do_mve_vmaxnma_vminnma (void) { enum neon_shape rs = neon_select_shape (NS_QQ, NS_NULL); @@ -24712,6 +24740,8 @@ static const struct asm_opcode insns[] = mToC("vmlas", ee011e40, 3, (RMQ, RMQ, RR), mve_vmlas), mToC("vmulh", ee010e01, 3, (RMQ, RMQ, RMQ), mve_vmulh), mToC("vrmulh", ee011e01, 3, (RMQ, RMQ, RMQ), mve_vmulh), + mToC("vpnot", fe310f4d, 0, (), mve_vpnot), + mToC("vpsel", fe310f01, 3, (RMQ, RMQ, RMQ), mve_vpsel), #undef THUMB_VARIANT #define THUMB_VARIANT & mve_fp_ext diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.d b/gas/testsuite/gas/arm/mve-vpnot-bad.d new file mode 100644 index 00000000000..6aab2c47c1d --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.d @@ -0,0 +1,5 @@ +#name: bad MVE VPNOT instructions +#as: -march=armv8.1-m.main+mve.fp +#error_output: mve-vpnot-bad.l + +.*: +file format .*arm.* diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.l b/gas/testsuite/gas/arm/mve-vpnot-bad.l new file mode 100644 index 00000000000..2ba96c6ddda --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.l @@ -0,0 +1,12 @@ +[^:]*: Assembler messages: +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:12: Error: syntax error -- `vpnoteq' +[^:]*:13: Error: syntax error -- `vpnoteq' +[^:]*:15: Error: syntax error -- `vpnoteq' +[^:]*:16: Error: vector predicated instruction should be in VPT/VPST block -- `vpnott' +[^:]*:18: Error: instruction missing MVE vector predication code -- `vpnot' diff --git a/gas/testsuite/gas/arm/mve-vpnot-bad.s b/gas/testsuite/gas/arm/mve-vpnot-bad.s new file mode 100644 index 00000000000..3588f60bda8 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpnot-bad.s @@ -0,0 +1,18 @@ +.macro cond +.irp cond, eq, ne, gt, ge, lt, le +it \cond +vpnot +.endr +.endm + +.syntax unified +.thumb +cond +it eq +vpnoteq +vpnoteq +vpst +vpnoteq +vpnott +vpst +vpnot diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.d b/gas/testsuite/gas/arm/mve-vpsel-bad.d new file mode 100644 index 00000000000..b8a602a6b1d --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.d @@ -0,0 +1,5 @@ +#name: bad MVE VPSEL instructions +#as: -march=armv8.1-m.main+mve.fp +#error_output: mve-vpsel-bad.l + +.*: +file format .*arm.* diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.l b/gas/testsuite/gas/arm/mve-vpsel-bad.l new file mode 100644 index 00000000000..d2b2890d287 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.l @@ -0,0 +1,12 @@ +[^:]*: Assembler messages: +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:10: Warning: instruction is UNPREDICTABLE in an IT block +[^:]*:12: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:13: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:15: Error: syntax error -- `vpseleq.i16 q0,q1,q2' +[^:]*:16: Error: vector predicated instruction should be in VPT/VPST block -- `vpselt.i16 q0,q1,q2' +[^:]*:18: Error: instruction missing MVE vector predication code -- `vpsel.i16 q0,q1,q2' diff --git a/gas/testsuite/gas/arm/mve-vpsel-bad.s b/gas/testsuite/gas/arm/mve-vpsel-bad.s new file mode 100644 index 00000000000..fc14fdc3d31 --- /dev/null +++ b/gas/testsuite/gas/arm/mve-vpsel-bad.s @@ -0,0 +1,19 @@ +.macro cond +.irp cond, eq, ne, gt, ge, lt, le +it \cond +vpsel.i16 q0, q1, q2 +.endr +.endm + +.syntax unified +.thumb +cond +it eq +vpseleq.i16 q0, q1, q2 +vpseleq.i16 q0, q1, q2 +vpst +vpseleq.i16 q0, q1, q2 +vpselt.i16 q0, q1, q2 +vpst +vpsel.i16 q0, q1, q2 + |