From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id D3DF5395CC5A; Tue, 27 Oct 2020 16:30:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3DF5395CC5A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins3)] rs6000: Start cleaning up some discrepancies X-Act-Checkin: gcc X-Git-Author: Bill Schmidt X-Git-Refname: refs/users/wschmidt/heads/builtins3 X-Git-Oldrev: 730d80b163f4f6fb890bdc4ac3f5407b4bae0925 X-Git-Newrev: 09127b2b28e420f7c157e675b921743bd5d0dc7b Message-Id: <20201027163029.D3DF5395CC5A@sourceware.org> Date: Tue, 27 Oct 2020 16:30: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: Tue, 27 Oct 2020 16:30:29 -0000 https://gcc.gnu.org/g:09127b2b28e420f7c157e675b921743bd5d0dc7b commit 09127b2b28e420f7c157e675b921743bd5d0dc7b Author: Bill Schmidt Date: Fri Aug 28 16:11:33 2020 -0500 rs6000: Start cleaning up some discrepancies 2020-08-28 Bill Schmidt gcc/ * config/rs6000/rs6000-builtin-new.def (__builtin_altivec_mask_for_store): Remove. (__builtin_altivec_xst_len_r): Rename to __builtin_vec_xst_len_r. (__builtin_vsx_scalar_cmp_exp_qp_eq): Fix typo in name. (__builtin_altivec_vextduwvhx): Likewise. * config/rs6000/rs6000-builtin.def (MASK_FOR_STORE): Remove. * config/rs6000/rs6000-call.c (rs6000_expand_ldst_mask): Remove all logic for ALTIVEC_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Likewise. (altivec_init_builtins): Add debug code for __builtin_altivec_mask_for_load. Diff: --- gcc/config/rs6000/rs6000-builtin-new.def | 11 ++++------ gcc/config/rs6000/rs6000-call.c | 35 +++++++++++++------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin-new.def b/gcc/config/rs6000/rs6000-builtin-new.def index ddf4a4605a4..c0f8821be64 100644 --- a/gcc/config/rs6000/rs6000-builtin-new.def +++ b/gcc/config/rs6000/rs6000-builtin-new.def @@ -356,9 +356,6 @@ vuc __builtin_altivec_mask_for_load (long long, void *); MASK_FOR_LOAD altivec_lvsr_direct {ldstmask} - vuc __builtin_altivec_mask_for_store (long long, void *); - MASK_FOR_STORE altivec_lvsr_direct {ldstmask} - vus __builtin_altivec_mfvscr (); MFVSCR altivec_mfvscr {} @@ -2723,10 +2720,10 @@ ; 32 bits, and the return value is DImode, so it seems that ; TARGET_64BIT (actually TARGET_POWERPC64) is justified. TBD. #### [power9-64] -; The following two are inexplicably named __builtin_altivec_* while +; The following two are inexplicably named __builtin_{alti,}vec_* while ; their load counterparts are __builtin_vsx_*. Need to deprecate ; these interfaces in favor of the other naming scheme (or vice versa). - void __builtin_altivec_xst_len_r (vop, void *, unsigned long long); + void __builtin_vec_xst_len_r (vop, void *, unsigned long long); XST_LEN_R xst_len_r {} void __builtin_altivec_stxvl (vop, void *, unsigned long long); @@ -2774,7 +2771,7 @@ const unsigned __int128 __builtin_vsx_scalar_extract_sigq (_Float128); VSESQP xsxsigqp_kf {} - const signed int __buiiltin_vsx_scalar_cmp_exp_qp_eq (_Float128, _Float128); + const signed int __builtin_vsx_scalar_cmp_exp_qp_eq (_Float128, _Float128); VSCEQPEQ xscmpexpqp_eq_kf {} const signed int __builtin_vsx_scalar_cmp_exp_qp_gt (_Float128, _Float128); @@ -3042,7 +3039,7 @@ const vull __builtin_altivec_vextduhvlx (vus, vus, unsigned char); VEXTRACTHL vextractlv8hi {} - const vull __builtin_altivec_vextduwvrx (vui, vui, unsigned char); + const vull __builtin_altivec_vextduwvhx (vui, vui, unsigned char); VEXTRACTWR vextractrv4si {} const vull __builtin_altivec_vextduwvlx (vui, vui, unsigned char); diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 0a7286b560b..afc5147a1b6 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -13366,7 +13366,7 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) return false; } -/* Expand ALTIVEC_BUILTIN_MASK_FOR_LOAD/STORE. */ +/* Expand ALTIVEC_BUILTIN_MASK_FOR_LOAD. */ rtx rs6000_expand_ldst_mask (rtx target, rs6000_builtins fcode, tree arg0) { @@ -13381,16 +13381,10 @@ rs6000_expand_ldst_mask (rtx target, rs6000_builtins fcode, tree arg0) gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg0))); op = expand_expr (arg0, NULL_RTX, Pmode, EXPAND_NORMAL); addr = memory_address (mode, op); - if (fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE) - op = addr; - else - { - gcc_assert (fcode == ALTIVEC_BUILTIN_MASK_FOR_LOAD); - /* For the load case need to negate the address. */ - op = gen_reg_rtx (GET_MODE (addr)); - emit_insn (gen_rtx_SET (op, gen_rtx_NEG (GET_MODE (addr), - addr))); - } + gcc_assert (fcode == ALTIVEC_BUILTIN_MASK_FOR_LOAD); + /* We need to negate the address. */ + op = gen_reg_rtx (GET_MODE (addr)); + emit_insn (gen_rtx_SET (op, gen_rtx_NEG (GET_MODE (addr), addr))); op = gen_rtx_MEM (mode, op); if (target == 0 @@ -13859,7 +13853,6 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, } case ALTIVEC_BUILTIN_MASK_FOR_LOAD: - case ALTIVEC_BUILTIN_MASK_FOR_STORE: { int icode2 = (BYTES_BIG_ENDIAN ? (int) CODE_FOR_altivec_lvsr_direct : (int) CODE_FOR_altivec_lvsl_direct); @@ -13874,15 +13867,9 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg))); op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL); addr = memory_address (mode, op); - if (fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE) - op = addr; - else - { - /* For the load case need to negate the address. */ - op = gen_reg_rtx (GET_MODE (addr)); - emit_insn (gen_rtx_SET (op, gen_rtx_NEG (GET_MODE (addr), - addr))); - } + /* We need to negate the address. */ + op = gen_reg_rtx (GET_MODE (addr)); + emit_insn (gen_rtx_SET (op, gen_rtx_NEG (GET_MODE (addr), addr))); op = gen_rtx_MEM (mode, op); if (target == 0 @@ -14918,6 +14905,12 @@ altivec_init_builtins (void) ALTIVEC_BUILTIN_MASK_FOR_LOAD, BUILT_IN_MD, NULL, NULL_TREE); TREE_READONLY (decl) = 1; + if (TARGET_DEBUG_BUILTIN) + fprintf (stderr, "%s __builtin_altivec_mask_for_load (%s); [%4d]\n", + rs6000_debug_type (TREE_TYPE (v16qi_ftype_pcvoid)), + rs6000_debug_type (TREE_VALUE + (TYPE_ARG_TYPES (v16qi_ftype_pcvoid))), + (int) ALTIVEC_BUILTIN_MASK_FOR_LOAD); /* Record the decl. Will be used by rs6000_builtin_mask_for_load. */ altivec_builtin_mask_for_load = decl;