]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Extend %R for integer registers
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 1 Apr 2020 10:43:00 +0000 (11:43 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 1 Apr 2020 10:43:00 +0000 (11:43 +0100)
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

        Backport from mainline
        2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

        * config/aarch64/aarch64.c (aarch64_print_operand): Allow integer
        registers with %R.

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

index 2b1ce7df14ace9cab1f4eec75c846c3435756b90..9860ae1b19a3aeba5cf9636a1af2c77ea282fd71 100644 (file)
@@ -1,3 +1,11 @@
+2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       Backport from mainline
+       2019-09-19  Richard Henderson  <richard.henderson@linaro.org>
+
+       * config/aarch64/aarch64.c (aarch64_print_operand): Allow integer
+       registers with %R.
+
 2020-03-31  Carl Love  <cel@us.ibm.com>
 
        Backport of:
index 2b09f317978e26de07a6044f436c9c4072ef1f78..23846b2339d2c03428ab9a9d40dc5e3476362646 100644 (file)
@@ -7542,7 +7542,7 @@ sizetochar (int size)
      'S/T/U/V':                Print a FP/SIMD register name for a register list.
                        The register printed is the FP/SIMD register name
                        of X + 0/1/2/3 for S/T/U/V.
-     'R':              Print a scalar FP/SIMD register name + 1.
+     'R':              Print a scalar Integer/FP/SIMD register name + 1.
      'X':              Print bottom 16 bits of integer constant in hex.
      'w/x':            Print a general register name or the zero register
                        (32-bit or 64-bit).
@@ -7734,12 +7734,13 @@ aarch64_print_operand (FILE *f, rtx x, int code)
       break;
 
     case 'R':
-      if (!REG_P (x) || !FP_REGNUM_P (REGNO (x)))
-       {
-         output_operand_lossage ("incompatible floating point / vector register operand for '%%%c'", code);
-         return;
-       }
-      asm_fprintf (f, "q%d", REGNO (x) - V0_REGNUM + 1);
+      if (REG_P (x) && FP_REGNUM_P (REGNO (x)))
+       asm_fprintf (f, "q%d", REGNO (x) - V0_REGNUM + 1);
+      else if (REG_P (x) && GP_REGNUM_P (REGNO (x)))
+       asm_fprintf (f, "x%d", REGNO (x) - R0_REGNUM + 1);
+      else
+       output_operand_lossage ("incompatible register operand for '%%%c'",
+                               code);
       break;
 
     case 'X':