[PATCH v2 2/5] ppc/svp64: support setvl instructions

Peter Bergner bergner@linux.ibm.com
Tue Jun 21 18:25:01 GMT 2022


One or more of the following files ( byte-swap-test.pl ) violates IBM policy and all attachment(s) have been removed from the message.

**********************************************************************
On 6/21/22 6:51 AM, Dmitry Selyutin via Binutils wrote:
> +       0:	36 00 00 58 	setvl   r0,r0,1,0,0,0
> +       4:	36 01 00 58 	setvl   r0,r0,1,0,0,1
> +       8:	b6 00 00 58 	setvl   r0,r0,1,0,1,0
> +       c:	b6 01 00 58 	setvl   r0,r0,1,0,1,1
> +      10:	76 00 00 58 	setvl   r0,r0,1,1,0,0
> +      14:	76 01 00 58 	setvl   r0,r0,1,1,0,1

I have learned that not specifying the exact offset in the foo.d file is
beneficial when you want to make changes to that file in the future,
especially if you want to add a new instruction test in the beginning
or middle of the test.  If you do that, all of the offsets for the
following tests will change and your patch will be LARGE.  The offset
is really not important, so you don't need it.  I recommend just using:

.*:

...for the offset of all of the instructions.  It makes adding new test
lines much easier for the patch reviewer! :-)

Secondly, ppc is a bi-endian architecture and I assume libre-soc is as well?
If so, I recommend following what Alan and I have done with the Power server
tests (eg, power10.d) and accept the encoding as both big or little endian.
Taking both of those suggestions on the snipit from setvl.d, you'd have:

.*:	(36 00 00 58|58 00 00 36) 	setvl   r0,r0,1,0,0,0
.*:	(36 01 00 58|58 00 01 36) 	setvl   r0,r0,1,0,0,1
.*:	(b6 00 00 58|58 00 00 b6) 	setvl   r0,r0,1,0,1,0
.*:	(b6 01 00 58|58 00 01 b6) 	setvl   r0,r0,1,0,1,1
.*:	(76 00 00 58|58 00 00 76) 	setvl   r0,r0,1,1,0,0
.*:	(76 01 00 58|58 00 01 76) 	setvl   r0,r0,1,1,0,1


We also place a "#pass" on the last line of the foo.d file which fixes
some issue which I can't remember off hand.  Alan, can you remind me/us
why we place that there?  I've attached a hackish perl script that will
take an "objdump -dr setvl.o" output and convert it into a setvl.d test
file for you.  It'll create lines like the above for you.  You do need
to verify that your objdump output is correct though! :-)

You'll also need a ChangeLog entry for these changes before you can push
your commit.

Peter




More information about the Binutils mailing list