Commit 112a6193 by Uros Bizjak Committed by Uros Bizjak

i386.md (wide AND insn to QImode splitter): Use explicit mode macros.

	* config/i386/i386.md (wide AND insn to QImode splitter): Use
	explicit mode macros.
	(wide OR insn to QImode splitter): Ditto.

From-SVN: r242852
parent 292edab3
2016-11-24 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (wide AND insn to QImode splitter): Use
explicit mode macros.
(wide OR insn to QImode splitter): Ditto.
2016-11-24 Vladimir Makarov <vmakarov@redhat.com> 2016-11-24 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77541 PR rtl-optimization/77541
...@@ -8625,14 +8625,13 @@ ...@@ -8625,14 +8625,13 @@
;; of memory mismatch stalls. We may want to do the splitting for optimizing ;; of memory mismatch stalls. We may want to do the splitting for optimizing
;; for size, but that can (should?) be handled by generic code instead. ;; for size, but that can (should?) be handled by generic code instead.
(define_split (define_split
[(set (match_operand 0 "QIreg_operand") [(set (match_operand:SWI248 0 "QIreg_operand")
(and (match_operand 1 "register_operand") (and:SWI248 (match_operand:SWI248 1 "register_operand")
(match_operand 2 "const_int_operand"))) (match_operand:SWI248 2 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"reload_completed "reload_completed
&& (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(~INTVAL (operands[2]) & ~(255 << 8)) && !(~INTVAL (operands[2]) & ~(255 << 8))"
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
(and:SI (zero_extract:SI (match_dup 1) (and:SI (zero_extract:SI (match_dup 1)
(const_int 8) (const_int 8)) (const_int 8) (const_int 8))
...@@ -8647,15 +8646,14 @@ ...@@ -8647,15 +8646,14 @@
;; Since AND can be encoded with sign extended immediate, this is only ;; Since AND can be encoded with sign extended immediate, this is only
;; profitable when 7th bit is not set. ;; profitable when 7th bit is not set.
(define_split (define_split
[(set (match_operand 0 "any_QIreg_operand") [(set (match_operand:SWI248 0 "any_QIreg_operand")
(and (match_operand 1 "general_operand") (and:SWI248 (match_operand:SWI248 1 "general_operand")
(match_operand 2 "const_int_operand"))) (match_operand:SWI248 2 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"reload_completed "reload_completed
&& (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(~INTVAL (operands[2]) & ~255) && !(~INTVAL (operands[2]) & ~255)
&& !(INTVAL (operands[2]) & 128) && !(INTVAL (operands[2]) & 128)"
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (strict_low_part (match_dup 0)) [(parallel [(set (strict_low_part (match_dup 0))
(and:QI (match_dup 1) (and:QI (match_dup 1)
(match_dup 2))) (match_dup 2)))
...@@ -9020,15 +9018,19 @@ ...@@ -9020,15 +9018,19 @@
(set_attr "length_immediate" "0") (set_attr "length_immediate" "0")
(set_attr "mode" "QI")]) (set_attr "mode" "QI")])
;; Convert wide OR instructions with immediate operand to shorter QImode
;; equivalents when possible.
;; Don't do the splitting with memory operands, since it introduces risk
;; of memory mismatch stalls. We may want to do the splitting for optimizing
;; for size, but that can (should?) be handled by generic code instead.
(define_split (define_split
[(set (match_operand 0 "QIreg_operand") [(set (match_operand:SWI248 0 "QIreg_operand")
(any_or (match_operand 1 "register_operand") (any_or:SWI248 (match_operand:SWI248 1 "register_operand")
(match_operand 2 "const_int_operand"))) (match_operand:SWI248 2 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"reload_completed "reload_completed
&& (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~(255 << 8)) && !(INTVAL (operands[2]) & ~(255 << 8))"
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
(any_or:SI (zero_extract:SI (match_dup 1) (any_or:SI (zero_extract:SI (match_dup 1)
(const_int 8) (const_int 8)) (const_int 8) (const_int 8))
...@@ -9043,15 +9045,14 @@ ...@@ -9043,15 +9045,14 @@
;; Since OR can be encoded with sign extended immediate, this is only ;; Since OR can be encoded with sign extended immediate, this is only
;; profitable when 7th bit is set. ;; profitable when 7th bit is set.
(define_split (define_split
[(set (match_operand 0 "any_QIreg_operand") [(set (match_operand:SWI248 0 "any_QIreg_operand")
(any_or (match_operand 1 "general_operand") (any_or:SWI248 (match_operand:SWI248 1 "general_operand")
(match_operand 2 "const_int_operand"))) (match_operand:SWI248 2 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"reload_completed "reload_completed
&& (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)) && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~255) && !(INTVAL (operands[2]) & ~255)
&& (INTVAL (operands[2]) & 128) && (INTVAL (operands[2]) & 128)"
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (strict_low_part (match_dup 0)) [(parallel [(set (strict_low_part (match_dup 0))
(any_or:QI (match_dup 1) (any_or:QI (match_dup 1)
(match_dup 2))) (match_dup 2)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment