From: Dmitry Selyutin Date: Sun, 28 May 2023 22:04:55 +0000 (+0300) Subject: ppc/svp64: support shadd/shadduw instructions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25e267bc3d06aa1f0e4929740a8e0701d57e4ada;p=binutils-gdb.git ppc/svp64: support shadd/shadduw instructions --- diff --git a/gas/testsuite/gas/ppc/ppc.exp b/gas/testsuite/gas/ppc/ppc.exp index dabde01e0ef..6138de6a31a 100644 --- a/gas/testsuite/gas/ppc/ppc.exp +++ b/gas/testsuite/gas/ppc/ppc.exp @@ -170,3 +170,4 @@ run_dump_test "bmask" run_dump_test "fptrans" run_dump_test "maddedu" run_dump_test "divmod2du" +run_dump_test "sadd" diff --git a/gas/testsuite/gas/ppc/sadd.d b/gas/testsuite/gas/ppc/sadd.d new file mode 100644 index 00000000000..a1c1124e81c --- /dev/null +++ b/gas/testsuite/gas/ppc/sadd.d @@ -0,0 +1,24 @@ +#as: -mlibresoc +#objdump: -dr -Mlibresoc + +.*: file format .* + + +Disassembly of section \.text: +0+ <\.text>: +.*:\s+(5b e0 00 dc|dc 00 e0 5b)\s+sadd\s+r31,r0,r0,0 +.*:\s+(58 1f 00 dc|dc 00 1f 58)\s+sadd\s+r0,r31,r0,0 +.*:\s+(58 00 f8 dc|dc f8 00 58)\s+sadd\s+r0,r0,r31,0 +.*:\s+(58 00 06 dc|dc 06 00 58)\s+sadd\s+r0,r0,r0,3 +.*:\s+(5b e0 00 dd|dd 00 e0 5b)\s+sadd.\s+r31,r0,r0,0 +.*:\s+(58 1f 00 dd|dd 00 1f 58)\s+sadd.\s+r0,r31,r0,0 +.*:\s+(58 00 f8 dd|dd f8 00 58)\s+sadd.\s+r0,r0,r31,0 +.*:\s+(58 00 06 dd|dd 06 00 58)\s+sadd.\s+r0,r0,r0,3 +.*:\s+(5b e0 01 dc|dc 01 e0 5b)\s+sadduw\s+r31,r0,r0,0 +.*:\s+(58 1f 01 dc|dc 01 1f 58)\s+sadduw\s+r0,r31,r0,0 +.*:\s+(58 00 f9 dc|dc f9 00 58)\s+sadduw\s+r0,r0,r31,0 +.*:\s+(58 00 07 dc|dc 07 00 58)\s+sadduw\s+r0,r0,r0,3 +.*:\s+(5b e0 01 dd|dd 01 e0 5b)\s+sadduw.\s+r31,r0,r0,0 +.*:\s+(58 1f 01 dd|dd 01 1f 58)\s+sadduw.\s+r0,r31,r0,0 +.*:\s+(58 00 f9 dd|dd f9 00 58)\s+sadduw.\s+r0,r0,r31,0 +.*:\s+(58 00 07 dd|dd 07 00 58)\s+sadduw.\s+r0,r0,r0,3 diff --git a/gas/testsuite/gas/ppc/sadd.s b/gas/testsuite/gas/ppc/sadd.s new file mode 100644 index 00000000000..196edd67fa1 --- /dev/null +++ b/gas/testsuite/gas/ppc/sadd.s @@ -0,0 +1,16 @@ +sadd 31,0,0,0 +sadd 0,31,0,0 +sadd 0,0,31,0 +sadd 0,0,0,3 +sadd. 31,0,0,0 +sadd. 0,31,0,0 +sadd. 0,0,31,0 +sadd. 0,0,0,3 +sadduw 31,0,0,0 +sadduw 0,31,0,0 +sadduw 0,0,31,0 +sadduw 0,0,0,3 +sadduw. 31,0,0,0 +sadduw. 0,31,0,0 +sadduw. 0,0,31,0 +sadduw. 0,0,0,3 diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c index 23385cc24a1..d78f81c2f93 100644 --- a/opcodes/ppc-opc.c +++ b/opcodes/ppc-opc.c @@ -3795,6 +3795,7 @@ const struct powerpc_operand powerpc_operands[] = #define RMC A_L + 1 #define CY RMC #define ew RMC +#define SHP1 RMC { 0x3, 9, NULL, NULL, 0 }, #define R RMC + 1 @@ -7047,6 +7048,11 @@ const struct powerpc_opcode powerpc_opcodes[] = { {"svremap", SVRM(22,57), SVRM_MASK, SVP64, PPCVLE, {SVme, mi0, mi1, mi2, mo0, mo1, pst}}, +{"sadd", ZRC(22,110,0), Z2_MASK, SVP64, PPCVLE, {RT, RA, RB, SHP1}}, +{"sadd.", ZRC(22,110,1), Z2_MASK, SVP64, PPCVLE, {RT, RA, RB, SHP1}}, +{"sadduw", ZRC(22,238,0), Z2_MASK, SVP64, PPCVLE, {RT, RA, RB, SHP1}}, +{"sadduw.", ZRC(22,238,1), Z2_MASK, SVP64, PPCVLE, {RT, RA, RB, SHP1}}, + {"cprop", XRC(22,398,0), X_MASK, SVP64, PPCVLE, {RT, RA, RB}}, {"cprop.", XRC(22,398,1), X_MASK, SVP64, PPCVLE, {RT, RA, RB}},