From: Uros Bizjak Date: Tue, 5 May 2020 09:31:52 +0000 (+0200) Subject: i386: Use int_nonimmediate_operand more X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59e4474a22cbf23b777f244d2a28d1ee4b54d3ce;p=gcc.git 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_movcc_0_m1_neg_leu to a combine pass splitter. * config/i386/i386.md (*testqi_ext_3): Use int_nonimmediate_operand instead of manual mode checks. (*x86_movcc_0_m1_neg_leu): Use int_nonimmediate_operand predicate. Rewrite define_insn_and_split pattern to a combine pass splitter. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa904548808..8c46dcd92c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2020-05-05 Uroš Bizjak + + * config/i386/i386.md (*testqi_ext_3): Use + int_nonimmediate_operand instead of manual mode checks. + (*x86_movcc_0_m1_neg_leu): + Use int_nonimmediate_operand predicate. Rewrite + define_insn_and_split pattern to a combine pass splitter. + 2020-05-05 Rainer Orth * configure.ac : Add --32 to tls_as_opt on Solaris. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 76c00867231..5cad481fd9f 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 == DImode @@ -18038,18 +18034,15 @@ (set_attr "mode" "") (set_attr "length_immediate" "0")]) -(define_insn_and_split "*x86_movcc_0_m1_neg_leu" - [(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" "m") - (match_operand:SWI 2 "" "")))) - (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))))