From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id AA4BD3858012; Tue, 30 Mar 2021 20:30:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA4BD3858012 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/work043)] Convert xxspltidp built-in to use normal vec_duplicate. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work043 X-Git-Oldrev: 0f1494f41ae272ef267c0de2a5b9382b2ca0aacd X-Git-Newrev: 1290fd0ea948ddbc835d53e183186fb21e7676d9 Message-Id: <20210330203009.AA4BD3858012@sourceware.org> Date: Tue, 30 Mar 2021 20:30:09 +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: Tue, 30 Mar 2021 20:30:09 -0000 https://gcc.gnu.org/g:1290fd0ea948ddbc835d53e183186fb21e7676d9 commit 1290fd0ea948ddbc835d53e183186fb21e7676d9 Author: Michael Meissner Date: Tue Mar 30 16:29:36 2021 -0400 Convert xxspltidp built-in to use normal vec_duplicate. If the vec_splatid built-in function is given a normal number that is not a denormal, convert the insn into a normal vec_duplicate. gcc/ 2021-03-30 Michael Meissner * config/rs6000/altivec.md (xxspltidp_v2df): Use vec_duplicate for normal inputs. Handle denormal inputs specially. (xxspltidp_v2df_denormal): Rename fromxxspltidp_v2df_inst. Diff: --- gcc/config/rs6000/altivec.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 228d88210bf..ed5c19afa52 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -880,12 +880,30 @@ UNSPEC_XXSPLTID))] "TARGET_POWER10" { - long value = rs6000_const_f32_to_i32 (operands[1]); - emit_insn (gen_xxspltidp_v2df_inst (operands[0], GEN_INT (value))); + rtx op0 = operands[0]; + rtx op1 = operands[1]; + const struct real_value *rv = CONST_DOUBLE_REAL_VALUE (op1); + + /* If the value is not denormal, convert it to DFmode and generate a + vec_duplicate. */ + if (xxspltidp_operand (op1, SFmode)) + { + rtx op1_df = const_double_from_real_value (*rv, DFmode); + rtx dup = gen_rtx_VEC_DUPLICATE (V2DFmode, op1_df); + emit_insn (gen_rtx_SET (op0, dup)); + DONE; + } + + /* If the value is denormal, create an insn with the int value. There is a + warning for this condition when the built-in was expanded in + rs6000_expand_unop_builtin. */ + long value; + REAL_VALUE_TO_TARGET_SINGLE (*rv, value); + emit_insn (gen_xxspltidp_v2df_denormal (op0, GEN_INT (value))); DONE; }) -(define_insn "xxspltidp_v2df_inst" +(define_insn "xxspltidp_v2df_denormal" [(set (match_operand:V2DF 0 "register_operand" "=wa") (unspec:V2DF [(match_operand:SI 1 "c32bit_cint_operand" "n")] UNSPEC_XXSPLTID))]