[PATCH] PowerPC: Support for Prefixed Add Immediate Shifted Instruction (RFC02686)

Peter Bergner bergner@linux.ibm.com
Mon Apr 21 22:22:42 GMT 2025


On 3/5/25 11:24 AM, Surya Kumari Jangala wrote:
> opcodes/
> 	* ppc-opc.c (insert_si32, extract_si32, insert_nsi32,
> 	extract_nsi32): New functions.
> 	(SI32, NSI32, P_D_SI32_MASK, P_DRAPCREL_SI32_MASK): New macros.
> 	(IM32): Update for new macros.

s/IM32/IMM32/




> diff --git a/gas/testsuite/gas/ppc/future.s b/gas/testsuite/gas/ppc/future.s
> index fec99e348bf..90e5e894bc1 100644
> --- a/gas/testsuite/gas/ppc/future.s
> +++ b/gas/testsuite/gas/ppc/future.s
> @@ -49,3 +49,16 @@ _start:
>  	xxgfmul128gcm 1, 2, 3
>  	xxgfmul128 31, 32, 33, 1
>  	xxgfmul128xts 31, 32, 33
> +	paddis 12, 9, 15, 0
> +	paddis 12, 9, ~(1<<15), 0
> +	paddis 9, 0, 25, 1
> +	paddis 24, 0, 2147483647, 0
> +	plis 24, 2147483647
> +	paddis 30, 10, -2147483648, 0
> +	psubis 30, 10, 2147483648, 0
> +	nop
> +	paddis 30, 10, 2147483647, 0
> +	psubis 30, 10, -2147483647, 0
> +	paddis 15, 0, 2147483647, 1
> +	psubis 15, 0, -2147483647, 1

For the tests that end with ',0', ie, the R=0 versions, please add an extra
test without the ',0' too.  So for the test:
    paddis 12, 9, 15, 0
add an extra test:
    paddis 12, 9, 15

The paddis instruction has an extended mnemonic for the R=0 case and I
like to include those in the tests too using the same operands as the
normal mnemonic so they come out identically in the future.d expected
output.



> +/* The same as P_D_MASK, but with the RA and PCREL fields specified.  */
> +#define P_DRAPCREL_SI32_MASK (P_D_SI32_MASK | PCREL_MASK | RA_MASK)

As Jan mentioned s/P_D_MASK/P_D_SI32_MASK/



>  {"psubi",	  PMLS|OP(14),	       P_D_MASK,	POWER10, EXT,	{RT, RA0, NSI34, PCREL}},
> +
> +{"plis",	  PMLS|OP(15),	       P_DRAPCREL_SI32_MASK,	FUTURE,  EXT,	{RT, SI32}},
> +{"paddis",	  PMLS|OP(15),	       P_D_SI32_MASK,		FUTURE,  0,	{RT, RA0, SI32, PCREL}},
> +{"psubis",	  PMLS|OP(15),	       P_D_SI32_MASK,		FUTURE,  EXT,	{RT, RA0, NSI32, PCREL}},
> +
>  {"xxsplti32dx",	  P8RR|VSOP(32,0),     P_VSI_MASK,	POWER10, 0,	{XTS, IX, IMM32}},

Please remove the 2 extra blank lines.


Ok for mainline with the above changes.  Sorry for the late review!

Peter




More information about the Binutils mailing list