From bef18c6382e3d0e610a73e05a400058fb0c7ac5c Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 22 Aug 2016 21:13:45 +0200 Subject: [PATCH] i386.md (*zero_extendsidi2): Add (*r,*k) alternative. * config/i386/i386.md (*zero_extendsidi2): Add (*r,*k) alternative. (zero_extenddi2): Ditto. (*zero_extendsi2): Ditto. (*zero_extendqihi2): Ditto. From-SVN: r239672 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.md | 45 +++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3cb421cfead..1518a449abe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-08-22 Uros Bizjak + + * config/i386/i386.md (*zero_extendsidi2): Add (*r,*k) alternative. + (zero_extenddi2): Ditto. + (*zero_extendsi2): Ditto. + (*zero_extendqihi2): Ditto. + 2016-08-22 Joseph Myers PR middle-end/77269 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 945445826c3..0deecb1b366 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -3696,10 +3696,10 @@ (define_insn "*zero_extendsidi2" [(set (match_operand:DI 0 "nonimmediate_operand" - "=r,?r,?o,r ,o,?*Ym,?!*y,?r ,?r,?*Yi,?*x") + "=r,?r,?o,r ,o,?*Ym,?!*y,?r ,?r,?*Yi,?*x,*r") (zero_extend:DI (match_operand:SI 1 "x86_64_zext_operand" - "0 ,rm,r ,rmWz,0,r ,m ,*Yj,*x,r ,m")))] + "0 ,rm,r ,rmWz,0,r ,m ,*Yj,*x,r ,m ,*k")))] "" { switch (get_attr_type (insn)) @@ -3725,6 +3725,9 @@ return "%vmovd\t{%1, %0|%0, %1}"; + case TYPE_MSKMOV: + return "kmovd\t{%1, %k0|%k0, %1}"; + default: gcc_unreachable (); } @@ -3732,7 +3735,7 @@ [(set (attr "isa") (cond [(eq_attr "alternative" "0,1,2") (const_string "nox64") - (eq_attr "alternative" "3,7") + (eq_attr "alternative" "3,7,11") (const_string "x64") (eq_attr "alternative" "8") (const_string "x64_sse4") @@ -3749,6 +3752,8 @@ (const_string "ssemov") (eq_attr "alternative" "8") (const_string "sselog1") + (eq_attr "alternative" "11") + (const_string "mskmov") ] (const_string "imovx"))) (set (attr "prefix_extra") @@ -3800,12 +3805,14 @@ "split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);") (define_insn "zero_extenddi2" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "register_operand" "=r,*r") (zero_extend:DI - (match_operand:SWI12 1 "nonimmediate_operand" "m")))] + (match_operand:SWI12 1 "nonimmediate_operand" "m,*k")))] "TARGET_64BIT" - "movz{l|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") + "@ + movz{l|x}\t{%1, %k0|%k0, %1} + kmov\t{%1, %k0|%k0, %1}" + [(set_attr "type" "imovx,mskmov") (set_attr "mode" "SI")]) (define_expand "zero_extendsi2" @@ -3849,13 +3856,15 @@ (set_attr "mode" "SI")]) (define_insn "*zero_extendsi2" - [(set (match_operand:SI 0 "register_operand" "=r") + [(set (match_operand:SI 0 "register_operand" "=r,*r") (zero_extend:SI - (match_operand:SWI12 1 "nonimmediate_operand" "m")))] + (match_operand:SWI12 1 "nonimmediate_operand" "m,*k")))] "!(TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))" - "movz{l|x}\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) + "@ + movz{l|x}\t{%1, %0|%0, %1} + kmov\t{%1, %0|%0, %1}" + [(set_attr "type" "imovx,mskmov") + (set_attr "mode" "SI,")]) (define_expand "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand") @@ -3898,12 +3907,14 @@ ; zero extend to SImode to avoid partial register stalls (define_insn "*zero_extendqihi2" - [(set (match_operand:HI 0 "register_operand" "=r") - (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))] + [(set (match_operand:HI 0 "register_operand" "=r,*r") + (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm,*k")))] "!(TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))" - "movz{bl|x}\t{%1, %k0|%k0, %1}" - [(set_attr "type" "imovx") - (set_attr "mode" "SI")]) + "@ + movz{bl|x}\t{%1, %k0|%k0, %1} + kmovb\t{%1, %k0|%k0, %1}" + [(set_attr "type" "imovx,mskmov") + (set_attr "mode" "SI,QI")]) (define_insn_and_split "*zext_doubleword_and" [(set (match_operand:DI 0 "register_operand" "=&") -- 2.30.2