diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2023-11-28 16:56:29 +0100 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2023-11-28 16:57:25 +0100 |
commit | 99db2ce2419245e40808a9fad45113315496a907 (patch) | |
tree | 268cad7ecdddea7dde0c16510395fc5515d5a115 /gcc/config | |
parent | 82273cd6ed19884549ea514ebe120f188297ace9 (diff) | |
download | gcc-99db2ce2419245e40808a9fad45113315496a907.zip gcc-99db2ce2419245e40808a9fad45113315496a907.tar.gz gcc-99db2ce2419245e40808a9fad45113315496a907.tar.bz2 |
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.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.md | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index cb32de7..7641b47 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))])]) |