public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Add pattern for bswap + rotate [PR 110039]
@ 2023-05-31  9:28 Christophe Lyon
  2023-05-31  9:49 ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Lyon @ 2023-05-31  9:28 UTC (permalink / raw)
  To: gcc-patches, Kyrylo.Tkachov, richard.sandiford; +Cc: Christophe Lyon

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_rev16<mode>2_alt3): New
	pattern.
---
 gcc/config/aarch64/aarch64.md | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 8b8951d7b14..663353791fd 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -6267,6 +6267,16 @@
   [(set_attr "type" "rev")]
 )
 
+;; Similar pattern to mache (rotate (bswap) 16)
+(define_insn "aarch64_rev16<mode>2_alt3"
+  [(set (match_operand:GPI 0 "register_operand" "=r")
+        (rotate:GPI (bswap:GPI (match_operand:GPI 1 "register_operand" "r"))
+                    (const_int 16)))]
+  ""
+  "rev16\\t%<w>0, %<w>1"
+  [(set_attr "type" "rev")]
+)
+
 ;; zero_extend version of above
 (define_insn "*bswapsi2_uxtw"
   [(set (match_operand:DI 0 "register_operand" "=r")
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-31 13:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31  9:28 [PATCH] aarch64: Add pattern for bswap + rotate [PR 110039] Christophe Lyon
2023-05-31  9:49 ` Richard Sandiford
2023-05-31 10:08   ` Christophe Lyon
2023-05-31 10:22     ` Richard Sandiford
2023-05-31 13:13       ` [PATCH v2] " Christophe Lyon
2023-05-31 13:15         ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).