]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.md (@test<mode>_ccno_1): Rename from test<mode>_ccno_1.
authorUros Bizjak <ubizjak@gmail.com>
Mon, 15 Jul 2019 20:26:43 +0000 (22:26 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 15 Jul 2019 20:26:43 +0000 (22:26 +0200)
* config/i386/i386.md (@test<mode>_ccno_1):
Rename from test<mode>_ccno_1.
(*testdi_1): Remove redundant alternatives.  Remove modrm attribute.
(*testqi_1_maybe_si): Remove modrm attribute.
(*test<mode>_1): Ditto.
* config/i386/i386-expand.c (ix86_split_idivmod): Use
gen_test_ccno_1 and gen_extend_insn.

From-SVN: r273496

gcc/ChangeLog
gcc/config/i386/i386-expand.c
gcc/config/i386/i386.md

index e56ae5fb204d770dd2c64715201726decde1d144..92aed39806b818e0c586050f3ef4d03f22d83b87 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-15  Uroš Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.md (@test<mode>_ccno_1):
+       Rename from test<mode>_ccno_1.
+       (*testdi_1): Remove redundant alternatives.  Remove modrm attribute.
+       (*testqi_1_maybe_si): Remove modrm attribute.
+       (*test<mode>_1): Ditto.
+       * config/i386/i386-expand.c (ix86_split_idivmod): Use
+       gen_test_ccno_1 and gen_extend_insn.
+
 2019-07-15  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree-ssa-alias.c (aliasing_component_refs_walk): Initialize same_p
index 0519da8a07f2ed7e21e7f0115171aed9f714d151..d50e21e8a1cee37660908a60a633b8d7d4e0c6dc 100644 (file)
@@ -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);
index 58797baa6dc54d18155204c50e5f2720074af0c3..19d1682317b0a3189bda4813302b03d82332b73a 100644 (file)
 ;; On Pentium, "test imm, reg" is pairable only with eax, ax, and al.
 ;; Note that this excludes ah.
 
-(define_expand "test<mode>_ccno_1"
+(define_expand "@test<mode>_ccno_1"
   [(set (reg:CCNO FLAGS_REG)
        (compare:CCNO
          (and:SWI48
   [(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)
   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")])
 
   "ix86_match_ccmode (insn, CCNOmode)"
   "test{<imodesuffix>}\t{%1, %0|%0, %1}"
   [(set_attr "type" "test")
-   (set_attr "modrm" "0,1,1")
    (set_attr "mode" "<MODE>")
    (set_attr "pent_pair" "uv,np,uv")])