* [x86 PATCH] Standardize shift amount constants as QImode.
@ 2023-06-18 9:05 Roger Sayle
2023-06-18 11:18 ` Uros Bizjak
0 siblings, 1 reply; 2+ messages in thread
From: Roger Sayle @ 2023-06-18 9:05 UTC (permalink / raw)
To: gcc-patches; +Cc: 'Uros Bizjak'
[-- Attachment #1: Type: text/plain, Size: 728 bytes --]
This clean-up improves consistency within i386.md by using QImode for
the constant shift count in patterns that specify a mode.
This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
and make -k check, both with and without --target_board=unix{-m32}
with no new failures. Ok for mainline?
2023-06-18 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
* config/i386/i386.md (*concat<mode><dwi>3_1): Use QImode
for the immediate constant shift count.
(*concat<mode><dwi>3_2): Likewise.
(*concat<mode><dwi>3_3): Likewise.
(*concat<mode><dwi>3_4): Likewise.
(*concat<mode><dwi>3_5): Likewise.
(*concat<mode><dwi>3_6): Likewise.
Thanks,
Roger
--
[-- Attachment #2: patchqi.txt --]
[-- Type: text/plain, Size: 2502 bytes --]
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 93794c1..b8d2e3a 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -12211,7 +12211,7 @@
[(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r")
(any_or_plus:<DWI>
(ashift:<DWI> (match_operand:<DWI> 1 "register_operand" "r,r")
- (match_operand:<DWI> 2 "const_int_operand"))
+ (match_operand:QI 2 "const_int_operand"))
(zero_extend:<DWI>
(match_operand:DWIH 3 "nonimmediate_operand" "r,m"))))]
"INTVAL (operands[2]) == <MODE_SIZE> * BITS_PER_UNIT"
@@ -12230,7 +12230,7 @@
(zero_extend:<DWI>
(match_operand:DWIH 1 "nonimmediate_operand" "r,m"))
(ashift:<DWI> (match_operand:<DWI> 2 "register_operand" "r,r")
- (match_operand:<DWI> 3 "const_int_operand"))))]
+ (match_operand:QI 3 "const_int_operand"))))]
"INTVAL (operands[3]) == <MODE_SIZE> * BITS_PER_UNIT"
"#"
"&& reload_completed"
@@ -12247,7 +12247,7 @@
(ashift:<DWI>
(zero_extend:<DWI>
(match_operand:DWIH 1 "nonimmediate_operand" "r,m,r,m"))
- (match_operand:<DWI> 2 "const_int_operand"))
+ (match_operand:QI 2 "const_int_operand"))
(zero_extend:<DWI>
(match_operand:DWIH 3 "nonimmediate_operand" "r,r,m,m"))))]
"INTVAL (operands[2]) == <MODE_SIZE> * BITS_PER_UNIT"
@@ -12267,7 +12267,7 @@
(ashift:<DWI>
(zero_extend:<DWI>
(match_operand:DWIH 2 "nonimmediate_operand" "r,r,m,m"))
- (match_operand:<DWI> 3 "const_int_operand"))))]
+ (match_operand:QI 3 "const_int_operand"))))]
"INTVAL (operands[3]) == <MODE_SIZE> * BITS_PER_UNIT"
"#"
"&& reload_completed"
@@ -12281,7 +12281,7 @@
[(set (match_operand:DWI 0 "nonimmediate_operand" "=r,o,o")
(any_or_plus:DWI
(ashift:DWI (match_operand:DWI 1 "register_operand" "r,r,r")
- (match_operand:DWI 2 "const_int_operand"))
+ (match_operand:QI 2 "const_int_operand"))
(match_operand:DWI 3 "const_scalar_int_operand" "n,n,Wd")))]
"INTVAL (operands[2]) == <MODE_SIZE> * BITS_PER_UNIT / 2
&& (<MODE>mode == DImode
@@ -12313,7 +12313,7 @@
(ashift:<DWI>
(zero_extend:<DWI>
(match_operand:DWIH 1 "nonimmediate_operand" "r,r,r,m"))
- (match_operand:<DWI> 2 "const_int_operand"))
+ (match_operand:QI 2 "const_int_operand"))
(match_operand:<DWI> 3 "const_scalar_int_operand" "n,n,Wd,n")))]
"INTVAL (operands[2]) == <MODE_SIZE> * BITS_PER_UNIT
&& (<DWI>mode == DImode
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [x86 PATCH] Standardize shift amount constants as QImode.
2023-06-18 9:05 [x86 PATCH] Standardize shift amount constants as QImode Roger Sayle
@ 2023-06-18 11:18 ` Uros Bizjak
0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2023-06-18 11:18 UTC (permalink / raw)
To: Roger Sayle; +Cc: gcc-patches
On Sun, Jun 18, 2023 at 11:05 AM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This clean-up improves consistency within i386.md by using QImode for
> the constant shift count in patterns that specify a mode.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32}
> with no new failures. Ok for mainline?
>
>
> 2023-06-18 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> * config/i386/i386.md (*concat<mode><dwi>3_1): Use QImode
> for the immediate constant shift count.
> (*concat<mode><dwi>3_2): Likewise.
> (*concat<mode><dwi>3_3): Likewise.
> (*concat<mode><dwi>3_4): Likewise.
> (*concat<mode><dwi>3_5): Likewise.
> (*concat<mode><dwi>3_6): Likewise.
OK.
Thanks,
Uros.
>
>
> Thanks,
> Roger
> --
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-18 11:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-18 9:05 [x86 PATCH] Standardize shift amount constants as QImode Roger Sayle
2023-06-18 11:18 ` Uros Bizjak
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).