AArch64 - allow insv_imm to handle bigger immediates via masking to 16 bits
authorIan Bolton <ian.bolton@arm.com>
Fri, 24 May 2013 14:54:15 +0000 (14:54 +0000)
committerIan Bolton <ibolton@gcc.gnu.org>
Fri, 24 May 2013 14:54:15 +0000 (14:54 +0000)
From-SVN: r199293

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md

index dd36f0b33df08792c8e9f7d22fb3d767bcbed732..f607fdfb4f919a2348fd0ccc672c2c7ea63afce3 100644 (file)
@@ -1,3 +1,10 @@
+2013-05-24  Ian Bolton  <ian.bolton@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_print_operand): Change the
+       X format specifier to only display bottom 16 bits.
+       * config/aarch64/aarch64.md (insv_imm<mode>): Allow any size of
+       immediate to match for operand 2, since it will be masked.
+
 2013-05-24  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/57287
index 12a705587824cc15bd81dca26dbd35ecafcfc515..e580a1bcafc144d390182b1cf102c3324b090db9 100644 (file)
@@ -3428,13 +3428,13 @@ aarch64_print_operand (FILE *f, rtx x, char code)
       break;
 
     case 'X':
-      /* Print integer constant in hex.  */
+      /* Print bottom 16 bits of integer constant in hex.  */
       if (GET_CODE (x) != CONST_INT)
        {
          output_operand_lossage ("invalid operand for '%%%c'", code);
          return;
        }
-      asm_fprintf (f, "0x%wx", UINTVAL (x));
+      asm_fprintf (f, "0x%wx", UINTVAL (x) & 0xffff);
       break;
 
     case 'w':
index e1ec48f552202852bdf346d6408a71019e8dd871..2bdbfa90bf7fcfcaca740ab09c4b7e9f9c34def9 100644 (file)
                          (const_int 16)
                          (match_operand:GPI 1 "const_int_operand" "n"))
        (match_operand:GPI 2 "const_int_operand" "n"))]
-  "INTVAL (operands[1]) < GET_MODE_BITSIZE (<MODE>mode)
-   && INTVAL (operands[1]) % 16 == 0
-   && UINTVAL (operands[2]) <= 0xffff"
+  "UINTVAL (operands[1]) < GET_MODE_BITSIZE (<MODE>mode)
+   && UINTVAL (operands[1]) % 16 == 0"
   "movk\\t%<w>0, %X2, lsl %1"
   [(set_attr "v8type" "movk")
    (set_attr "mode" "<MODE>")]