spu: make some constants unsigned
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Thu, 19 May 2016 02:39:18 +0000 (22:39 -0400)
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Mon, 23 May 2016 05:20:09 +0000 (01:20 -0400)
The field in spu_opcode is unsigned, and for some values of opcode we can end
up shifting into the high bit.  So avoid possibly creating a negative number
and then assigning it to a unsigned field by shifting an unsigned constant.

gas/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-spu.c (APUOP): Use OPCODE as an unsigned constant.

gas/ChangeLog
gas/config/tc-spu.c

index 20c8702..6809c67 100644 (file)
@@ -1,5 +1,9 @@
 2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+       * config/tc-spu.c (APUOP): Use OPCODE as an unsigned constant.
+
+2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
        * config/tc-tic54x.c (tic54x_mmregs): Adjust.
        (md_begin): Likewise.
        (encode_condition): Likewise.
index c08dcb5..24969c9 100644 (file)
@@ -26,7 +26,7 @@
 
 const struct spu_opcode spu_opcodes[] = {
 #define APUOP(TAG,MACFORMAT,OPCODE,MNEMONIC,ASMFORMAT,DEP,PIPE) \
-       { MACFORMAT, (OPCODE) << (32-11), MNEMONIC, ASMFORMAT },
+       { MACFORMAT, (OPCODE ## u) << (32-11), MNEMONIC, ASMFORMAT },
 #define APUOPFB(TAG,MACFORMAT,OPCODE,FB,MNEMONIC,ASMFORMAT,DEP,PIPE) \
        { MACFORMAT, ((OPCODE) << (32-11)) | ((FB) << (32-18)), MNEMONIC, ASMFORMAT },
 #include "opcode/spu-insns.h"