From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 99E85385781B; Sat, 3 Apr 2021 01:11:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99E85385781B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work044)] Convert XXSPLTIW built-in functions to use VEC_DUPLICATE. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work044 X-Git-Oldrev: 7c99705565a712814aa16537576a1a3c3f44f96a X-Git-Newrev: bf295d2781c4afdd7137235af73e8aa42ed4b62a Message-Id: <20210403011129.99E85385781B@sourceware.org> Date: Sat, 3 Apr 2021 01:11:29 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2021 01:11:29 -0000 https://gcc.gnu.org/g:bf295d2781c4afdd7137235af73e8aa42ed4b62a commit bf295d2781c4afdd7137235af73e8aa42ed4b62a Author: Michael Meissner Date: Fri Apr 2 21:11:06 2021 -0400 Convert XXSPLTIW built-in functions to use VEC_DUPLICATE. This patch changes the vec_spliti and vec_splitid built-in functions that generate the XXSPLTIW instruction to use the native code generation for loading vector constants instead of generating an UNSPEC. These constants now generate XXSPLTIW directly. gcc/ 2021-04-02 Michael Meissner * config/rs6000/altivec.md (UNSPEC_XXSPLTIW): Delete. (xxspltiw_v4si): Rewrite to load a vector constant. (xxspltiw_v4sf): Rewrite to load a vector constant. (xxspltiw_v4sf_inst): Delete. gcc/testsuite/ 2021-04-02 Michael Meissner * gcc.target/powerpc/vec-splati-runnable.c: Update insn count. Diff: --- gcc/config/rs6000/altivec.md | 38 +++++++++------------- .../gcc.target/powerpc/vec-splati-runnable.c | 2 +- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 1351dafbc41..b3de51b6dd5 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -176,7 +176,6 @@ UNSPEC_VSTRIL UNSPEC_SLDB UNSPEC_SRDB - UNSPEC_XXSPLTIW UNSPEC_XXSPLTID UNSPEC_XXSPLTI32DX UNSPEC_XXBLEND @@ -820,35 +819,30 @@ "vsdbi %0,%1,%2,%3" [(set_attr "type" "vecsimple")]) -(define_insn "xxspltiw_v4si" - [(set (match_operand:V4SI 0 "register_operand" "=wa") - (unspec:V4SI [(match_operand:SI 1 "s32bit_cint_operand" "n")] - UNSPEC_XXSPLTIW))] +(define_expand "xxspltiw_v4si" + [(use (match_operand:V4SI 0 "register_operand")) + (use (match_operand:SI 1 "s32bit_cint_operand"))] "TARGET_POWER10" - "xxspltiw %x0,%1" - [(set_attr "type" "vecsimple") - (set_attr "prefixed" "yes")]) +{ + rtx op1 = operands[1]; + rtvec rv = gen_rtvec (4, op1, op1, op1, op1, op1); + rtx cv = gen_rtx_CONST_VECTOR (V4SImode, rv); + emit_move_insn (operands[0], cv); + DONE; +}) (define_expand "xxspltiw_v4sf" - [(set (match_operand:V4SF 0 "register_operand" "=wa") - (unspec:V4SF [(match_operand:SF 1 "const_double_operand" "n")] - UNSPEC_XXSPLTIW))] + [(use (match_operand:V4SF 0 "register_operand")) + (use (match_operand:SF 1 "const_double_operand"))] "TARGET_POWER10" { - long long value = rs6000_const_f32_to_i32 (operands[1]); - emit_insn (gen_xxspltiw_v4sf_inst (operands[0], GEN_INT (value))); + rtx op1 = operands[1]; + rtvec rv = gen_rtvec (4, op1, op1, op1, op1, op1); + rtx cv = gen_rtx_CONST_VECTOR (V4SFmode, rv); + emit_move_insn (operands[0], cv); DONE; }) -(define_insn "xxspltiw_v4sf_inst" - [(set (match_operand:V4SF 0 "register_operand" "=wa") - (unspec:V4SF [(match_operand:SI 1 "c32bit_cint_operand" "n")] - UNSPEC_XXSPLTIW))] - "TARGET_POWER10" - "xxspltiw %x0,%1" - [(set_attr "type" "vecsimple") - (set_attr "prefixed" "yes")]) - (define_expand "xxspltidp_v2df" [(set (match_operand:V2DF 0 "register_operand" ) (unspec:V2DF [(match_operand:SF 1 "const_double_operand")] diff --git a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c index 8edabe97cb0..a39ddcfee41 100644 --- a/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/vec-splati-runnable.c @@ -162,4 +162,4 @@ main (int argc, char *argv []) /* { dg-final { scan-assembler-times {\mxxspltiw\M} 3 } } */ /* { dg-final { scan-assembler-times {\mxxspltidp\M} 2 } } */ -/* { dg-final { scan-assembler-times {\mxxsplti32dx\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mxxsplti32dx\M} 1 } } */