From d5d9703a2caeb411411e02a102756493587073a6 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 3 Feb 2017 19:54:20 +0100 Subject: [PATCH] i386.c (dimode_scalar_chain::convert_reg): Use pextrd for TARGET_SSE4_1 when creating scalar copy. * config/i386/i386.c (dimode_scalar_chain::convert_reg): Use pextrd for TARGET_SSE4_1 when creating scalar copy. From-SVN: r245161 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 733a32519af..d722840f519 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-02-03 Uros Bizjak + + * config/i386/i386.c (dimode_scalar_chain::convert_reg): + Use pextrd for TARGET_SSE4_1 when creating scalar copy. + 2017-02-03 Walter Lee PR target/78862 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 01a05c63ccd..3a659458ab0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3622,11 +3622,26 @@ dimode_scalar_chain::convert_reg (unsigned regno) if (scalar_copy) { - rtx vcopy = gen_reg_rtx (V2DImode); - start_sequence (); - if (TARGET_INTER_UNIT_MOVES_FROM_VEC) + if (TARGET_SSE4_1) + { + rtx tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (1, const0_rtx)); + emit_insn + (gen_rtx_SET + (gen_rtx_SUBREG (SImode, scopy, 0), + gen_rtx_VEC_SELECT (SImode, + gen_rtx_SUBREG (V4SImode, reg, 0), tmp))); + + tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (1, const1_rtx)); + emit_insn + (gen_rtx_SET + (gen_rtx_SUBREG (SImode, scopy, 4), + gen_rtx_VEC_SELECT (SImode, + gen_rtx_SUBREG (V4SImode, reg, 0), tmp))); + } + else if (TARGET_INTER_UNIT_MOVES_FROM_VEC) { + rtx vcopy = gen_reg_rtx (V2DImode); emit_move_insn (vcopy, gen_rtx_SUBREG (V2DImode, reg, 0)); emit_move_insn (gen_rtx_SUBREG (SImode, scopy, 0), gen_rtx_SUBREG (SImode, vcopy, 0)); -- 2.30.2