Power10 Set boolean extension

Alan Modra amodra@gmail.com
Mon May 11 11:33:48 GMT 2020


opcodes/
	* ppc-opc.c (powerpc_opcodes) <setbc, setbcr, setnbc, setnbcr>: New
	mnemonics.
gas/
	* testsuite/gas/ppc/set_bool.d,
	* testsuite/gas/ppc/set_bool.s: New test.
	* testsuite/gas/ppc/ppc.exp: Run it.

diff --git a/gas/testsuite/gas/ppc/ppc.exp b/gas/testsuite/gas/ppc/ppc.exp
index 0e53a4caa3..e1c7bdefb0 100644
--- a/gas/testsuite/gas/ppc/ppc.exp
+++ b/gas/testsuite/gas/ppc/ppc.exp
@@ -141,3 +141,4 @@ run_dump_test "outerprod"
 run_dump_test "maskmanip"
 run_dump_test "genpcv"
 run_dump_test "bitmanip"
+run_dump_test "set_bool"
diff --git a/gas/testsuite/gas/ppc/set_bool.d b/gas/testsuite/gas/ppc/set_bool.d
new file mode 100644
index 0000000000..6bf1ed6c6f
--- /dev/null
+++ b/gas/testsuite/gas/ppc/set_bool.d
@@ -0,0 +1,14 @@
+#as: -mpower10
+#objdump: -dr -Mpower10
+#name: set bool
+
+.*
+
+
+Disassembly of section \.text:
+
+0+00 <_start>:
+.*:	(7d 41 03 00|00 03 41 7d) 	setbc   r10,gt
+.*:	(7d 62 03 40|40 03 62 7d) 	setbcr  r11,eq
+.*:	(7d 83 03 80|80 03 83 7d) 	setnbc  r12,so
+.*:	(7d a0 03 c0|c0 03 a0 7d) 	setnbcr r13,lt
diff --git a/gas/testsuite/gas/ppc/set_bool.s b/gas/testsuite/gas/ppc/set_bool.s
new file mode 100644
index 0000000000..95f28814b4
--- /dev/null
+++ b/gas/testsuite/gas/ppc/set_bool.s
@@ -0,0 +1,6 @@
+	.text
+_start:
+	setbc	10,1
+	setbcr	11,2
+	setnbc	12,3
+	setnbcr	13,0
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index b8c841cc14..e15fcf5ea6 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -6770,6 +6770,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 {"popcntw",	X(31,378),	XRB_MASK,    POWER7|PPCA2, 0,		{RA, RS}},
 
+{"setbc",	X(31,384),	XRB_MASK,    POWER10,	0,		{RT, BI}},
+
 {"mtdcrx",	X(31,387),	X_MASK,	     BOOKE|PPCA2|PPC476, TITAN,	{RA, RS}},
 {"mtdcrx.",	XRC(31,387,1),	X_MASK,	     PPCA2,	0,		{RA, RS}},
 
@@ -6804,6 +6806,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 {"sthepx",	X(31,415),	X_MASK,	  E500MC|PPCA2, 0,		{RS, RA0, RB}},
 
+{"setbcr",	X(31,416),	XRB_MASK,    POWER10,	0,		{RT, BI}},
+
 {"mtdcrux",	X(31,419),	X_MASK,	 PPC464|PPC476,	0,		{RA, RS}},
 
 {"stvexhx",	X(31,421),	X_MASK,	     E6500,	0,		{VS, RA0, RB}},
@@ -6841,6 +6845,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 {"mr.",		XRC(31,444,1),	X_MASK,	     COM,	0,		{RA, RSB}},
 {"or.",		XRC(31,444,1),	X_MASK,	     COM,	0,		{RA, RS, RB}},
 
+{"setnbc",	X(31,448),	XRB_MASK,    POWER10,	0,		{RT, BI}},
+
 {"mtexisr",	XSPR(31,451, 64), XSPR_MASK, PPC403,	0,		{RS}},
 {"mtexier",	XSPR(31,451, 66), XSPR_MASK, PPC403,	0,		{RS}},
 {"mtbr0",	XSPR(31,451,128), XSPR_MASK, PPC403,	0,		{RS}},
@@ -7083,6 +7089,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 {"nand",	XRC(31,476,0),	X_MASK,	     COM,	0,		{RA, RS, RB}},
 {"nand.",	XRC(31,476,1),	X_MASK,	     COM,	0,		{RA, RS, RB}},
 
+{"setnbcr",	X(31,480),	XRB_MASK,    POWER10,	0,		{RT, BI}},
+
 {"dsn",		X(31,483),	XRT_MASK,    E500MC,	0,		{RA, RB}},
 
 {"dcread",	X(31,486),	X_MASK,	 PPC403|PPC440, PPCA2,		{RT, RA0, RB}},

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list