public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5933] i386: Improve cmpstrnqi_1 insn pattern [PR112494]
@ 2023-11-28 15:57 Uros Bizjak
0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2023-11-28 15:57 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:99db2ce2419245e40808a9fad45113315496a907
commit r14-5933-g99db2ce2419245e40808a9fad45113315496a907
Author: Uros Bizjak <ubizjak@gmail.com>
Date: Tue Nov 28 16:56:29 2023 +0100
i386: Improve cmpstrnqi_1 insn pattern [PR112494]
REPZ CMPSB instruction does not update FLAGS register when %ecx register
equals zero. Improve cmpstrnqi_1 insn pattern to set FLAGS_REG to its
previous value instead of (const_int 0) when operand 2 equals zero.
PR target/112494
gcc/ChangeLog:
* config/i386/i386.md (cmpstrnqi_1): Set FLAGS_REG to its previous
value when operand 2 equals zero.
(*cmpstrnqi_1): Ditto.
(*cmpstrnqi_1 peephole2): Ditto.
Diff:
---
gcc/config/i386/i386.md | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index cb32de7fab8..7641b479670 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -23333,9 +23333,8 @@
(const_int 0))
(compare:CC (match_operand 4 "memory_operand")
(match_operand 5 "memory_operand"))
- (const_int 0)))
+ (reg:CC FLAGS_REG)))
(use (match_operand:SI 3 "immediate_operand"))
- (use (reg:CC FLAGS_REG))
(clobber (match_operand 0 "register_operand"))
(clobber (match_operand 1 "register_operand"))
(clobber (match_dup 2))])]
@@ -23351,9 +23350,8 @@
(const_int 0))
(compare:CC (mem:BLK (match_operand:P 4 "register_operand" "0"))
(mem:BLK (match_operand:P 5 "register_operand" "1")))
- (const_int 0)))
+ (reg:CC FLAGS_REG)))
(use (match_operand:SI 3 "immediate_operand" "i"))
- (use (reg:CC FLAGS_REG))
(clobber (match_operand:P 0 "register_operand" "=S"))
(clobber (match_operand:P 1 "register_operand" "=D"))
(clobber (match_operand:P 2 "register_operand" "=c"))]
@@ -23464,9 +23462,8 @@
(const_int 0))
(compare:CC (mem:BLK (match_operand 4 "register_operand"))
(mem:BLK (match_operand 5 "register_operand")))
- (const_int 0)))
+ (reg:CC FLAGS_REG)))
(use (match_operand:SI 3 "immediate_operand"))
- (use (reg:CC FLAGS_REG))
(clobber (match_operand 0 "register_operand"))
(clobber (match_operand 1 "register_operand"))
(clobber (match_operand 2 "register_operand"))])
@@ -23484,9 +23481,8 @@
(const_int 0))
(compare:CC (mem:BLK (match_dup 4))
(mem:BLK (match_dup 5)))
- (const_int 0)))
+ (reg:CC FLAGS_REG)))
(use (match_dup 3))
- (use (reg:CC FLAGS_REG))
(clobber (match_dup 0))
(clobber (match_dup 1))
(clobber (match_dup 2))])])
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-28 15:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 15:57 [gcc r14-5933] i386: Improve cmpstrnqi_1 insn pattern [PR112494] 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).