aarch64 : Mark rotate immediates with '#' as per DDI0487iFc.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 25 Aug 2020 20:20:12 +0000 (21:20 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 25 Feb 2021 19:24:10 +0000 (19:24 +0000)
The armv8_arm manual [C6.2.226, ROR (immediate)] uses a # in front
of the immediate rotation quantity.

Although, it seems, GAS is able to infer the # (or is leninent about
its absence) assemblers based on the LLVM back end expect it.

gcc/ChangeLog:

* config/aarch64/aarch64.md (<optab>_rol<mode>3): Add a '#'
mark in front of the immediate quantity.
(<optab>_rolsi3_uxtw): Likewise.

gcc/config/aarch64/aarch64.md

index 65d00c4..b2abb5b 100644 (file)
                      (match_operand:QI 2 "aarch64_shift_imm_<mode>" "n"))
                     (match_operand:GPI 3 "register_operand" "r")))]
   ""
-  "<logical>\\t%<w>0, %<w>3, %<w>1, ror (<sizen> - %2)"
+  "<logical>\\t%<w>0, %<w>3, %<w>1, ror #(<sizen> - %2)"
   [(set_attr "type" "logic_shift_imm")]
 )
 
                      (match_operand:QI 2 "aarch64_shift_imm_si" "n"))
                     (match_operand:SI 3 "register_operand" "r"))))]
   ""
-  "<logical>\\t%w0, %w3, %w1, ror (32 - %2)"
+  "<logical>\\t%w0, %w3, %w1, ror #(32 - %2)"
   [(set_attr "type" "logic_shift_imm")]
 )