From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id 683813844051; Wed, 24 Feb 2021 03:59:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 683813844051 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/builtins4)] rs6000: More bug fixes X-Act-Checkin: gcc X-Git-Author: Bill Schmidt X-Git-Refname: refs/users/wschmidt/heads/builtins4 X-Git-Oldrev: 3586794c78153ceb8021bbe1fd45dbb1b84050b2 X-Git-Newrev: b8d15e6d2f80a758ea331110e70701adfd8b725c Message-Id: <20210224035936.683813844051@sourceware.org> Date: Wed, 24 Feb 2021 03:59:36 +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: Wed, 24 Feb 2021 03:59:36 -0000 https://gcc.gnu.org/g:b8d15e6d2f80a758ea331110e70701adfd8b725c commit b8d15e6d2f80a758ea331110e70701adfd8b725c Author: Bill Schmidt Date: Tue Feb 23 21:59:11 2021 -0600 rs6000: More bug fixes 2021-02-23 Bill Schmidt gcc/ * config/rs6000/rs6000-builtin-new.def (__builtin_vsx_xvcvsxddp_scale): Add constant restriction. (__builtin_vsx_xvcvuxddp_scale): Likewise. * config/rs6000/rs6000-call.c (rs6000_expand_new_builtin): Call rs6000_invalid_new_builtin and expand calls normally. Diff: --- gcc/config/rs6000/rs6000-builtin-new.def | 15 +----- gcc/config/rs6000/rs6000-call.c | 93 +++++++++++++++++++++++++------- 2 files changed, 75 insertions(+), 33 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin-new.def b/gcc/config/rs6000/rs6000-builtin-new.def index 6a29726ec09..2e6616dd290 100644 --- a/gcc/config/rs6000/rs6000-builtin-new.def +++ b/gcc/config/rs6000/rs6000-builtin-new.def @@ -1727,7 +1727,7 @@ const vd __builtin_vsx_xvcvsxddp (vsll); XVCVSXDDP vsx_floatv2div2df2 {} - const vd __builtin_vsx_xvcvsxddp_scale (vsll, const int); + const vd __builtin_vsx_xvcvsxddp_scale (vsll, const int<5>); XVCVSXDDP_SCALE vsx_xvcvsxddp_scale {} const vf __builtin_vsx_xvcvsxdsp (vsll); @@ -1742,7 +1742,7 @@ const vd __builtin_vsx_xvcvuxddp (vull); XVCVUXDDP vsx_floatunsv2div2df2 {} - const vd __builtin_vsx_xvcvuxddp_scale (vull, const int); + const vd __builtin_vsx_xvcvuxddp_scale (vull, const int<5>); XVCVUXDDP_SCALE vsx_xvcvuxddp_scale {} ; Redundant with __builtin_vsx_xvcvuxddp @@ -3484,17 +3484,6 @@ PEXTD pextd {} -; TODO: Land-mine alert. -; -; The original built-in support has code that assumes the internal -; copy of an MMA built-in function appears immediately after the -; external copy in the built-in table. This is fragile. For the -; new support, we should transition this to do a name lookup in -; the built-in hash table, but to start with we will honor the -; positioning of the built-ins in the table. Note that right now -; there is going to be breakage with __builtin_mma_disassemble_{acc,pair} -; since they each require a blank builtin to follow them with icode -; CODE_FOR_nothing. [mma] void __builtin_mma_assemble_acc (v512 *, vuc, vuc, vuc, vuc); ASSEMBLE_ACC nothing {mma} diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 18218206e71..25ccbcc26b8 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -15264,82 +15264,135 @@ rs6000_expand_new_builtin (tree exp, rtx target, case ENB_P5: if (!TARGET_POPCNTB) { - error ("%qs requires at least %qs\n", - bifaddr->bifname, "-mcpu=power5"); + rs6000_invalid_new_builtin (fcode); return expand_call (exp, target, ignore); } break; case ENB_P6: if (!TARGET_CMPB) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_ALTIVEC: if (!TARGET_ALTIVEC) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_CELL: if (!TARGET_ALTIVEC || rs6000_cpu != PROCESSOR_CELL) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_VSX: if (!TARGET_VSX) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P7: if (!TARGET_POPCNTD) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P7_64: if (!TARGET_POPCNTD || !TARGET_POWERPC64) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P8: if (!TARGET_DIRECT_MOVE) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P8V: if (!TARGET_P8_VECTOR) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P9: if (!TARGET_MODULO) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P9_64: if (!TARGET_MODULO || !TARGET_POWERPC64) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P9V: if (!TARGET_P9_VECTOR) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_IEEE128_HW: if (!TARGET_FLOAT128_HW) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_DFP: if (!TARGET_DFP) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_CRYPTO: if (!TARGET_CRYPTO) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_HTM: if (!TARGET_HTM) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P10: if (!TARGET_POWER10) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_P10_64: if (!TARGET_POWER10 || !TARGET_POWERPC64) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; case ENB_MMA: if (!TARGET_MMA) - return const0_rtx; + { + rs6000_invalid_new_builtin (fcode); + return expand_call (exp, target, ignore); + } break; };