aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-06-21 15:58:12 -0600
committerJeff Law <jlaw@ventanamicro.com>2024-06-21 15:59:29 -0600
commit37f3000a57d62b808188eb6a14a369f6a789e1ea (patch)
tree6ece26ef9d86149a4fa2f375fc40a206bafc3fb5
parent52a82359073653e312aaa5703f7e0ce339588961 (diff)
downloadgcc-37f3000a57d62b808188eb6a14a369f6a789e1ea.zip
gcc-37f3000a57d62b808188eb6a14a369f6a789e1ea.tar.gz
gcc-37f3000a57d62b808188eb6a14a369f6a789e1ea.tar.bz2
[committed] Fix testsuite fallout on stormy16 after IOR->PLUS change
More minor fallout from the IOR->PLUS change a little while ago. This time on xstormy16. The pattern to swap nibbles actually tries to handle all the cases of IOR, XOR and PLUS. But when we generate PLUS earlier in the pipeline, the simplifications/canonicalizations are slightly different resulting in the pattern not matching. This patch adds an alternate pattern which matches what we get now. Basically it looks like QImode rotate by 4, zero extended to HI. Run in my tester to verify the regression was fixed. Pushing to the trunk. gcc/ * config/stormy16/stormy16.md (swpn_zext): New pattern.
-rw-r--r--gcc/config/stormy16/stormy16.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 7f12679..6231834 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -1363,6 +1363,20 @@
"swpn %0 | and %0,#255"
[(set_attr "length" "6")])
+;; Alternate form when we use PLUS instead of IOR early in the
+;; expanders.
+(define_insn "*swpn_zext"
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (zero_extend:HI
+ (subreg:QI
+ (any_or_plus:HI
+ (ashift:HI (match_operand:HI 1 "register_operand" "0")
+ (const_int 4))
+ (lshiftrt:HI (match_dup 1) (const_int 4))) 0)))]
+ ""
+ "swpn %0 | and %0,#255"
+ [(set_attr "length" "6")])
+
(define_insn "*swpn_sext"
[(set (match_operand:HI 0 "register_operand" "=r")
(sign_extend:HI