PPC_OPERAND_SIGNOPT range.
authorAlan Modra <amodra@gmail.com>
Wed, 18 May 2016 01:57:56 +0000 (11:27 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 18 May 2016 03:13:21 +0000 (12:43 +0930)
Commit b84bf58a accidentally extended the range of allowed negative
numbers.

* config/tc-ppc.c (ppc_insert_operand): Trim PPC_OPERAND_SIGNOPT
allowed negative range.
* testsuite/gas/ppc/power9.s: Test xxspltib of -128, not -256.
* testsuite/gas/ppc/power9.d: Update.

gas/ChangeLog
gas/config/tc-ppc.c
gas/testsuite/gas/ppc/power9.d
gas/testsuite/gas/ppc/power9.s

index 745c13c..59bf350 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-18  Alan Modra  <amodra@gmail.com>
+
+       * config/tc-ppc.c (ppc_insert_operand): Trim PPC_OPERAND_SIGNOPT
+       allowed negative range.
+       * testsuite/gas/ppc/power9.s: Test xxspltib of -128, not -256.
+       * testsuite/gas/ppc/power9.d: Update.
+
 2016-05-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * testsuite/gas/arm/archv8m-cmse-msr-base.d: Force Thumb when
index 6346570..2492573 100644 (file)
@@ -1787,17 +1787,15 @@ ppc_insert_operand (unsigned long insn,
 
   if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0)
     {
-      /* Extend the allowed range for addis to [-65536, 65535].
-        Similarly for some VLE high part insns.  For 64-bit it
-        would be good to disable this for signed fields since the
+      /* Extend the allowed range for addis to [-32768, 65535].
+        Similarly for cmpli and some VLE high part insns.  For 64-bit
+        it would be good to disable this for signed fields since the
         value is sign extended into the high 32 bits of the register.
         If the value is, say, an address, then we might care about
         the high bits.  However, gcc as of 2014-06 uses unsigned
         values when loading the high part of 64-bit constants using
-        lis.
-        Use the same extended range for cmpli, to allow at least
-        [-32768, 65535].  */
-      min = ~max & -right;
+        lis.  */
+      min = ~(max >> 1) & -right;
     }
   else if ((operand->flags & PPC_OPERAND_SIGNED) != 0)
     {
index d84e635..a1d4681 100644 (file)
@@ -140,7 +140,7 @@ Disassembly of section \.text:
 .*:    (f0 80 2a 94|94 2a 80 f0)       xxextractuw vs4,vs5,0
 .*:    (f1 0f 92 97|97 92 0f f1)       xxextractuw vs40,vs50,15
 .*:    (f0 80 02 d0|d0 02 80 f0)       xxspltib vs4,0
-.*:    (f0 80 02 d0|d0 02 80 f0)       xxspltib vs4,0
+.*:    (f0 84 02 d0|d0 02 84 f0)       xxspltib vs4,128
 .*:    (f1 27 fa d1|d1 fa 27 f1)       xxspltib vs41,255
 .*:    (f1 27 fa d1|d1 fa 27 f1)       xxspltib vs41,255
 .*:    (f0 a0 32 d4|d4 32 a0 f0)       xxinsertw vs5,vs6,0
index 9cf306c..34576b7 100644 (file)
@@ -131,7 +131,7 @@ power9:
        xxextractuw 4,5,0x0
        xxextractuw 40,50,0xf
        xxspltib    4,0x0
-       xxspltib    4,-256
+       xxspltib    4,-128
        xxspltib    41,255
        xxspltib    41,-1
        xxinsertw   5,6,0