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 20c87025fbc420533d45372ae0a2449a3912b304..6809c67766b7ef9ff289beaa8554d8b4d1c1ffcf 100644 (file)
@@ -1,3 +1,7 @@
+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.
index c08dcb56475ade477b2e12618104612c5355a6d0..24969c97abd55515a8c812ca95ca7747498a152c 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"
This page took 0.027022 seconds and 4 git commands to generate.