aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2020-05-05 11:31:52 +0200
committerUros Bizjak <ubizjak@gmail.com>2020-05-05 11:33:55 +0200
commit59e4474a22cbf23b777f244d2a28d1ee4b54d3ce (patch)
tree1fbb2f4c1efc85b5995599e8f7f0065b0894c1ed
parentcfbbceed1dad352e5be9e2af7b665ae7d9d2537e (diff)
downloadgcc-59e4474a22cbf23b777f244d2a28d1ee4b54d3ce.zip
gcc-59e4474a22cbf23b777f244d2a28d1ee4b54d3ce.tar.gz
gcc-59e4474a22cbf23b777f244d2a28d1ee4b54d3ce.tar.bz2
i386: Use int_nonimmediate_operand more
Pattern explosing and manual mode checks can be avoided by using int_nonimmediate_operand special predicate. While there, rewrite *x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode> to a combine pass splitter. * config/i386/i386.md (*testqi_ext_3): Use int_nonimmediate_operand instead of manual mode checks. (*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>): Use int_nonimmediate_operand predicate. Rewrite define_insn_and_split pattern to a combine pass splitter.
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.md23
2 files changed, 16 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aa90454..8c46dcd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-05-05 Uroš Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*testqi_ext_3): Use
+ int_nonimmediate_operand instead of manual mode checks.
+ (*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>):
+ Use int_nonimmediate_operand predicate. Rewrite
+ define_insn_and_split pattern to a combine pass splitter.
+
2020-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac <i[34567]86-*-*>: Add --32 to tls_as_opt on Solaris.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 76c0086..5cad481 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -8714,16 +8714,12 @@
[(set (match_operand 0 "flags_reg_operand")
(match_operator 1 "compare_operator"
[(zero_extract:SWI248
- (match_operand 2 "nonimmediate_operand" "rm")
+ (match_operand 2 "int_nonimmediate_operand" "rm")
(match_operand 3 "const_int_operand" "n")
(match_operand 4 "const_int_operand" "n"))
(const_int 0)]))]
- "((TARGET_64BIT && GET_MODE (operands[2]) == DImode)
- || GET_MODE (operands[2]) == SImode
- || GET_MODE (operands[2]) == HImode
- || GET_MODE (operands[2]) == QImode)
- /* Ensure that resulting mask is zero or sign extended operand. */
- && INTVAL (operands[4]) >= 0
+ "/* Ensure that resulting mask is zero or sign extended operand. */
+ INTVAL (operands[4]) >= 0
&& ((INTVAL (operands[3]) > 0
&& INTVAL (operands[3]) + INTVAL (operands[4]) <= 32)
|| (<MODE>mode == DImode
@@ -18038,18 +18034,15 @@
(set_attr "mode" "<MODE>")
(set_attr "length_immediate" "0")])
-(define_insn_and_split "*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>"
- [(set (match_operand:SWI48 0 "register_operand" "=r")
+(define_split
+ [(set (match_operand:SWI48 0 "register_operand")
(neg:SWI48
(leu:SWI48
- (match_operand:SWI 1 "nonimmediate_operand" "<SWI:r>m")
- (match_operand:SWI 2 "<SWI:immediate_operand>" "<SWI:i>"))))
- (clobber (reg:CC FLAGS_REG))]
- "CONST_INT_P (operands[2])
+ (match_operand 1 "int_nonimmediate_operand")
+ (match_operand 2 "const_int_operand"))))]
+ "x86_64_immediate_operand (operands[2], VOIDmode)
&& INTVAL (operands[2]) != -1
&& INTVAL (operands[2]) != 2147483647"
- "#"
- ""
[(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
(parallel [(set (match_dup 0)
(neg:SWI48 (ltu:SWI48 (reg:CC FLAGS_REG) (const_int 0))))