public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix testsuite fallout on stormy16 after IOR->PLUS change
@ 2024-06-21 22:00 Jeff Law
  2024-06-22 12:01 ` Georg-Johann Lay
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2024-06-21 22:00 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

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.

Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 878 bytes --]

	* config/stormy16/stormy16.md (swpn_zext): New pattern.

diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 7f12679847b..62318345cdc 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -1363,6 +1363,20 @@ (define_insn "*swpn_zext"
   "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

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

* Re: [committed] Fix testsuite fallout on stormy16 after IOR->PLUS change
  2024-06-21 22:00 [committed] Fix testsuite fallout on stormy16 after IOR->PLUS change Jeff Law
@ 2024-06-22 12:01 ` Georg-Johann Lay
  2024-06-22 14:11   ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Georg-Johann Lay @ 2024-06-22 12:01 UTC (permalink / raw)
  To: Jeff Law, gcc-patches



Am 22.06.24 um 00:00 schrieb Jeff Law:
> 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.

The avr backend has quite some (combine) patterns that combine IOR
and other operations like AND to bit move instructions etc.

Does this mean all such patterns are void now?

Johann

> 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.
> 
> Jeff

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

* Re: [committed] Fix testsuite fallout on stormy16 after IOR->PLUS change
  2024-06-22 12:01 ` Georg-Johann Lay
@ 2024-06-22 14:11   ` Jeff Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Law @ 2024-06-22 14:11 UTC (permalink / raw)
  To: Georg-Johann Lay, gcc-patches



On 6/22/24 6:01 AM, Georg-Johann Lay wrote:
> 
> 
> Am 22.06.24 um 00:00 schrieb Jeff Law:
>> 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.
> 
> The avr backend has quite some (combine) patterns that combine IOR
> and other operations like AND to bit move instructions etc.
> 
> Does this mean all such patterns are void now?
Certainly not void, though you may be missing optimizations.  The key 
properties to look for.

Rotation like patterns, but the target doesn't have a named pattern for 
rotation.  So an IOR with ASHIFT/LSHIFTRT operands and appropriate shift 
counts.

Those rotation patterns have other embedded operations such as a sign 
extension, logical ands to mask off bits and the like.


Jeff

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

end of thread, other threads:[~2024-06-22 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-21 22:00 [committed] Fix testsuite fallout on stormy16 after IOR->PLUS change Jeff Law
2024-06-22 12:01 ` Georg-Johann Lay
2024-06-22 14:11   ` Jeff Law

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).