]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Add pattern for bswap + rotate [PR 110039]
authorChristophe Lyon <christophe.lyon@linaro.org>
Wed, 31 May 2023 09:23:16 +0000 (09:23 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 31 May 2023 13:26:49 +0000 (13:26 +0000)
After commit g:d8545fb2c71683f407bfd96706103297d4d6e27b, we missed a
pattern to match the new GIMPLE form.

With this patch, gcc.target/aarch64/rev16_2.c passes again.

2023-05-31  Christophe Lyon  <christophe.lyon@linaro.org>

PR target/110039
gcc/
* config/aarch64/aarch64.md (aarch64_rev16si2_alt3): New
pattern.

gcc/config/aarch64/aarch64.md

index f26d11cf8e7927dc29442a6e2e99965c7f94d695..c2ba726f8a03caab9c849145b04f795b4b9da820 100644 (file)
   [(set_attr "type" "rev")]
 )
 
+;; Similar pattern to match (rotate (bswap) 16)
+(define_insn "aarch64_rev16si2_alt3"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+        (rotate:SI (bswap:SI (match_operand:SI 1 "register_operand" "r"))
+                   (const_int 16)))]
+  ""
+  "rev16\\t%w0, %w1"
+  [(set_attr "type" "rev")]
+)
+
 ;; zero_extend version of above
 (define_insn "*bswapsi2_uxtw"
   [(set (match_operand:DI 0 "register_operand" "=r")