From ea298f7ad0170458e740b03eb9af9b90b697f92f Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 15 Jul 2019 22:26:43 +0200 Subject: [PATCH] i386.md (@test_ccno_1): Rename from test_ccno_1. * config/i386/i386.md (@test_ccno_1): Rename from test_ccno_1. (*testdi_1): Remove redundant alternatives. Remove modrm attribute. (*testqi_1_maybe_si): Remove modrm attribute. (*test_1): Ditto. * config/i386/i386-expand.c (ix86_split_idivmod): Use gen_test_ccno_1 and gen_extend_insn. From-SVN: r273496 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/i386/i386-expand.c | 21 ++++++++------------- gcc/config/i386/i386.md | 14 ++++---------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e56ae5fb204..92aed39806b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2019-07-15 Uroš Bizjak + + * config/i386/i386.md (@test_ccno_1): + Rename from test_ccno_1. + (*testdi_1): Remove redundant alternatives. Remove modrm attribute. + (*testqi_1_maybe_si): Remove modrm attribute. + (*test_1): Ditto. + * config/i386/i386-expand.c (ix86_split_idivmod): Use + gen_test_ccno_1 and gen_extend_insn. + 2019-07-15 Jan Hubicka * tree-ssa-alias.c (aliasing_component_refs_walk): Initialize same_p diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index 0519da8a07f..d50e21e8a1c 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -1122,8 +1122,6 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], rtx_insn *insn; rtx scratch, tmp0, tmp1, tmp2; rtx (*gen_divmod4_1) (rtx, rtx, rtx, rtx); - rtx (*gen_zero_extend) (rtx, rtx); - rtx (*gen_test_ccno_1) (rtx, rtx); switch (mode) { @@ -1135,21 +1133,16 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], else gen_divmod4_1 = unsigned_p ? gen_udivmodsi4_zext_2 : gen_divmodsi4_zext_2; - gen_zero_extend = gen_zero_extendqisi2; } else - { - gen_divmod4_1 - = unsigned_p ? gen_udivmodsi4_zext_1 : gen_divmodsi4_zext_1; - gen_zero_extend = gen_zero_extendqidi2; - } - gen_test_ccno_1 = gen_testsi_ccno_1; + gen_divmod4_1 + = unsigned_p ? gen_udivmodsi4_zext_1 : gen_divmodsi4_zext_1; break; + case E_DImode: gen_divmod4_1 = unsigned_p ? gen_udivmoddi4_1 : gen_divmoddi4_1; - gen_test_ccno_1 = gen_testdi_ccno_1; - gen_zero_extend = gen_zero_extendqidi2; break; + default: gcc_unreachable (); } @@ -1164,7 +1157,7 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], emit_move_insn (scratch, operands[2]); scratch = expand_simple_binop (mode, IOR, scratch, operands[3], scratch, 1, OPTAB_DIRECT); - emit_insn (gen_test_ccno_1 (scratch, GEN_INT (-0x100))); + emit_insn (gen_test_ccno_1 (mode, scratch, GEN_INT (-0x100))); tmp0 = gen_rtx_REG (CCNOmode, FLAGS_REG); tmp0 = gen_rtx_EQ (VOIDmode, tmp0, const0_rtx); tmp0 = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp0, @@ -1227,7 +1220,9 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], /* Zero extend quotient from AL. */ tmp1 = gen_lowpart (QImode, tmp0); - insn = emit_insn (gen_zero_extend (operands[0], tmp1)); + insn = emit_insn (gen_extend_insn + (operands[0], tmp1, + GET_MODE (operands[0]), QImode, 1)); set_unique_reg_note (insn, REG_EQUAL, div); emit_label (end_label); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 58797baa6dc..19d1682317b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -8124,7 +8124,7 @@ ;; On Pentium, "test imm, reg" is pairable only with eax, ax, and al. ;; Note that this excludes ah. -(define_expand "test_ccno_1" +(define_expand "@test_ccno_1" [(set (reg:CCNO FLAGS_REG) (compare:CCNO (and:SWI48 @@ -8142,19 +8142,15 @@ [(set (reg FLAGS_REG) (compare (and:DI - (match_operand:DI 0 "nonimmediate_operand" "%!*a,r,!*a,r,rm") - (match_operand:DI 1 "x86_64_szext_nonmemory_operand" "Z,Z,e,e,re")) + (match_operand:DI 0 "nonimmediate_operand" "r,rm") + (match_operand:DI 1 "x86_64_szext_nonmemory_operand" "Z,re")) (const_int 0)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" "@ test{l}\t{%k1, %k0|%k0, %k1} - test{l}\t{%k1, %k0|%k0, %k1} - test{q}\t{%1, %0|%0, %1} - test{q}\t{%1, %0|%0, %1} test{q}\t{%1, %0|%0, %1}" [(set_attr "type" "test") - (set_attr "modrm" "0,1,0,1,1") - (set_attr "mode" "SI,SI,DI,DI,DI")]) + (set_attr "mode" "SI,DI")]) (define_insn "*testqi_1_maybe_si" [(set (reg FLAGS_REG) @@ -8177,7 +8173,6 @@ return "test{b}\t{%1, %0|%0, %1}"; } [(set_attr "type" "test") - (set_attr "modrm" "0,1,1,1") (set_attr "mode" "QI,QI,QI,SI") (set_attr "pent_pair" "uv,np,uv,np")]) @@ -8191,7 +8186,6 @@ "ix86_match_ccmode (insn, CCNOmode)" "test{}\t{%1, %0|%0, %1}" [(set_attr "type" "test") - (set_attr "modrm" "0,1,1") (set_attr "mode" "") (set_attr "pent_pair" "uv,np,uv")]) -- 2.30.2