From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id AD32B385BF9C; Fri, 2 Apr 2021 17:55:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD32B385BF9C 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)] Switch power10 XXSPLTIW built-ins to use VEC_DUPLICATE. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work044 X-Git-Oldrev: 640a6913db7a4429659a709b83c75da55401a197 X-Git-Newrev: a67dde6a82f9277d6fb4d4abd841c92028b17568 Message-Id: <20210402175541.AD32B385BF9C@sourceware.org> Date: Fri, 2 Apr 2021 17:55:41 +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: Fri, 02 Apr 2021 17:55:41 -0000 https://gcc.gnu.org/g:a67dde6a82f9277d6fb4d4abd841c92028b17568 commit a67dde6a82f9277d6fb4d4abd841c92028b17568 Author: Michael Meissner Date: Fri Apr 2 13:55:23 2021 -0400 Switch power10 XXSPLTIW built-ins to use VEC_DUPLICATE. This patch switches the power10 vec_splati and vec_splatid built-in functions to use the XXSPLTIB support instead of using UNSPECs. gcc/ 2021-04-02 Michael Meissner * config/rs6000/altivec.md (UNSPEC_XXSPLTIW): Delete. (xxspltiw_v4si): Rewrite to use VEC_DUPLICATE. (xxspltiw_v4sf): Rewrite to use VEC_DUPLICATE. (xxspltiw_v4sf_inst): Delete. Diff: --- gcc/config/rs6000/altivec.md | 48 ++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 1351dafbc41..65148b0986c 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 @@ -821,33 +820,30 @@ [(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))] - "TARGET_POWER10" - "xxspltiw %x0,%1" - [(set_attr "type" "vecsimple") - (set_attr "prefixed" "yes")]) - -(define_expand "xxspltiw_v4sf" - [(set (match_operand:V4SF 0 "register_operand" "=wa") - (unspec:V4SF [(match_operand:SF 1 "const_double_operand" "n")] - UNSPEC_XXSPLTIW))] - "TARGET_POWER10" + [(set (match_operand:V4SI 0 "register_operand" "=wa,wa,v,wa") + (vec_duplicate:V4SI + (match_operand 1 "s32bit_cint_operand" "O,wM,wB,n")))] + "TARGET_XXSPLTIW" + "@ + xxspltisb %x0,0 + xxspltisb %x0,255 + vspltisw %0,%1 + xxspltiw %x0,%1" + [(set_attr "type" "vecperm") + (set_attr "prefixed" "*,*,*,yes")]) + +(define_insn "xxspltiw_v4sf" + [(set (match_operand:V4SF 0 "register_operand" "=wa,wa") + (vec_duplicate:V4SF + (match_operand:SF 1 "const_double_operand" "F,F")))] + "TARGET_XXSPLTIW" { - long long value = rs6000_const_f32_to_i32 (operands[1]); - emit_insn (gen_xxspltiw_v4sf_inst (operands[0], GEN_INT (value))); - DONE; -}) + if (operands[1] == CONST0_RTX (SFmode)) + return "xxspltib %x0,0"; -(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")]) + operands[2] = GEN_INT (rs6000_const_f32_to_i32 (operands[1])); + return "xxspltiw %x0,%2"; +}) (define_expand "xxspltidp_v2df" [(set (match_operand:V2DF 0 "register_operand" )