PowerPC: Add new xxmr and xxlnot extended mnemonics [committed]

Peter Bergner bergner@linux.ibm.com
Fri May 28 21:48:16 GMT 2021


On 5/28/21 9:33 AM, Alan Modra wrote:
> You'll notice the FIXME, which is saying to do..
>  
>> If that doesn't work, one other option is to add a RAW mask to the
>> deprecated field in the extended mnemonics. That way, our existing
>> machinery will automatically disable them.
> 
> ..this.  Painful as all the editing was.

Adding the deprecated field definitely would be the most robust fix,
but yeah, a lot of changes and we'd have to ensure each new added
mnemonic is marked correctly.  I did test adding a RAW field to xxmr
and that was all that was needed to work correctly:


bergner@pike:~$ cat xxmr.s 
	.text
start:
	xxlor 3,4,4
	xxmr 3,4
bergner@pike:~$ /home/bergner/binutils/build/binutils-xxmr-raw/binutils/objdump -d xxmr.o 
0000000000000000 <start>:
   0:	90 24 64 f0 	xxmr    vs3,vs4
   4:	90 24 64 f0 	xxmr    vs3,vs4
bergner@pike:~$ /home/bergner/binutils/build/binutils-xxmr-raw/binutils/objdump -d -Mraw xxmr.o 
0000000000000000 <start>:
   0:	90 24 64 f0 	xxlor   vs3,vs4,vs4
   4:	90 24 64 f0 	xxlor   vs3,vs4,vs4


That said, an automatic option like your patch is probably preferable,
since we wouldn't have to do anything special when adding new mnemonics.
We could use the deprecated field method for any "weird" insns, where
your code somehow cannot correctly identify the extended mnemonic.
If there are even any.



> +  /* If the mask implies that OP1 has more fixed bits than OP2,
> +     then OP1 is more specialized.  */
> +  if ((op1->mask & ~op2->mask) != 0)
> +    return true;

I know this was the original test, but this doesn't really ensure
that op1->mask has more bits set than op2->mask.  It just tells us
that op1->mask has bits that are not set in op2->mask.  It could
be op2->mask has set bits that op1->mask doesn't have too.
That said, this would probably only happen between 2 different
extended mnemonics being compared to each other and I would expect
the base mnemonic to win out over both of them, so we're probably
fine with the test as is.

Thanks for cleaning up after me!

Peter



More information about the Binutils mailing list