]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Add basic target_print_operand support for CONST_STRING
authorVictor Do Nascimento <victor.donascimento@arm.com>
Fri, 7 Jul 2023 12:08:45 +0000 (13:08 +0100)
committerVictor Do Nascimento <victor.donascimento@arm.com>
Fri, 27 Oct 2023 09:46:35 +0000 (10:46 +0100)
Motivated by the need to print system register names in output
assembly, this patch adds the required logic to
`aarch64_print_operand' to accept rtxs of type CONST_STRING and
process these accordingly.

Consequently, an rtx such as:

  (set (reg/i:DI 0 x0)
         (unspec:DI [(const_string ("s3_3_c13_c2_2"))])

can now be output correctly using the following output pattern when
composing `define_insn's:

  "mrs\t%x0, %1"

gcc/ChangeLog

* config/aarch64/aarch64.cc (aarch64_print_operand): Add
support for CONST_STRING.

gcc/config/aarch64/aarch64.cc

index 91e4d2358917c8477a7aa43e84edab9c7f5924ec..5fd7063663c67a15e654eea66ffe7193caebf6b6 100644 (file)
@@ -12366,6 +12366,11 @@ aarch64_print_operand (FILE *f, rtx x, int code)
 
       switch (GET_CODE (x))
        {
+       case CONST_STRING:
+         {
+           asm_fprintf (f, "%s", XSTR (x, 0));
+           break;
+         }
        case REG:
          if (aarch64_sve_data_mode_p (GET_MODE (x)))
            {