PowerPC POWER10 updates to dcbf, sync and wait instructions

Peter Bergner bergner@linux.ibm.com
Mon May 18 03:36:34 GMT 2020


On 5/17/20 9:36 PM, Alan Modra wrote:
> On Sat, May 16, 2020 at 05:53:20PM -0500, Peter Bergner wrote:
>> -/* The 2-bit L field in a SYNC or WC field in a WAIT instruction.
>> +/* The 2-bit/3-bit L or 2-bit WC field in a SYNC, DCBF or WAIT instruction.
>>     For SYNC, some L values are reserved:
>> -     * Value 3 is reserved on newer server cpus.
>> -     * Values 2 and 3 are reserved on all other cpus.  */
>> +     * Values 3, 6 and 7 are reserved on all cpus.
>> +     * Value 2 is reserved on all other cpus.
> 
> The above needs fixing.

How so?


> So if "(value & mask) != value" then no checks are done?  That doesn't
> seem correct.  The same problem occurs later too.

Well, no checks are done here.  If (value & mask) != value, then
we've already triggered an operand out of range bug and there is no
need for another test here.  It's only if the value fits within the
mask range that we need to check for illegal values within the mask
range.  If we didn't do this, we'd sometimes end up with an operand
out of range error and a possible illegal value error.

Fr example, notice below how line 5 is an illegal value for power10,
but an out of range error for power9 and earlier.

Peter


bergner@pike:~$ cat -n sync.s 
     1		.text
     2	_start:
     3		sync 2
     4		sync 4
     5		sync 6
bergner@pike:~$ /home/bergner/binutils/build/binutils-p10/gas/as-new -mpower10 sync.s 
sync.s: Assembler messages:
sync.s:5: Error: illegal L operand value
bergner@pike:~$ /home/bergner/binutils/build/binutils-p10/gas/as-new -mpower9 sync.s 
sync.s: Assembler messages:
sync.s:4: Error: operand out of range (4 is not between 0 and 3)
sync.s:5: Error: operand out of range (6 is not between 0 and 3)
bergner@pike:~$ /home/bergner/binutils/build/binutils-p10/gas/as-new -mcom sync.s 
sync.s: Assembler messages:
sync.s:3: Error: illegal L operand value
sync.s:4: Error: operand out of range (4 is not between 0 and 3)
sync.s:5: Error: operand out of range (6 is not between 0 and 3)


More information about the Binutils mailing list