aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e7c5490..5e0a980 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11011,6 +11011,19 @@
[(set_attr "type" "negnot")
(set_attr "mode" "<MODE>")])
+;; Optimize *negsi_1 followed by *cmpsi_ccno_1 (PR target/91384)
+(define_peephole2
+ [(set (match_operand:SWI 0 "general_reg_operand")
+ (match_operand:SWI 1 "general_reg_operand"))
+ (parallel [(set (match_dup 0) (neg:SWI (match_dup 0)))
+ (clobber (reg:CC FLAGS_REG))])
+ (set (reg:CCZ FLAGS_REG) (compare:CCZ (match_dup 1) (const_int 0)))]
+ ""
+ [(set (match_dup 0) (match_dup 1))
+ (parallel [(set (reg:CCZ FLAGS_REG)
+ (compare:CCZ (neg:SWI (match_dup 0)) (const_int 0)))
+ (set (match_dup 0) (neg:SWI (match_dup 0)))])])
+
;; Special expand pattern to handle integer mode abs
(define_expand "abs<mode>2"