From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D14463858407; Wed, 28 Jun 2023 08:39:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D14463858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687941578; bh=tH8e6dNcmmqp+ARnIb4WwdpE5avGVNkkKOelHSdYMGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OHCoYIM03RqXoNZhg1zY2FdXNHxlF1De58TA3SuD+z9rZo8wXuagaisPm/E203GGH qEQ4m+vvPOWCNIWWrXZWq+lBM1lkr9/nxmBbklXdk5y2x+nSP2eUFDuSQ9Uz6r18C+ B6LdnBnCUJg0RE4UxIG271hIL9I98f7MnmBiSDJI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104124] Poor optimization for vector splat DW with small consts Date: Wed, 28 Jun 2023 08:39:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.1.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: guihaoc at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104124 --- Comment #4 from CVS Commits --- The master branch has been updated by HaoChen Gui : https://gcc.gnu.org/g:f3d87219dd502d5c11608ffb83fbe66c79baf784 commit r14-2153-gf3d87219dd502d5c11608ffb83fbe66c79baf784 Author: Haochen Gui Date: Wed Jun 28 16:30:44 2023 +0800 rs6000: Splat vector small V2DI constants with vspltisw and vupkhsw This patch adds a new insn for vector splat with small V2DI constants on P8. If the value of constant is in RANGE (-16, 15) but not 0 or -1, it can = be loaded with vspltisw and vupkhsw on P8. gcc/ PR target/104124 * config/rs6000/altivec.md (*altivec_vupkhs_direct): Rename to... (altivec_vupkhs_direct): ...this. * config/rs6000/predicates.md (vspltisw_vupkhsw_constant_split): New predicate to test if a constant can be loaded with vspltisw and vupkhsw. (easy_vector_constant): Call vspltisw_vupkhsw_constant_p to Che= ck if a vector constant can be synthesized with a vspltisw and a vupk= hsw. * config/rs6000/rs6000-protos.h (vspltisw_vupkhsw_constant_p): Declare. * config/rs6000/rs6000.cc (vspltisw_vupkhsw_constant_p): New function to return true if OP mode is V2DI and can be synthesiz= ed with vupkhsw and vspltisw. * config/rs6000/vsx.md (*vspltisw_v2di_split): New insn to load= up constants with vspltisw and vupkhsw. gcc/testsuite/ PR target/104124 * gcc.target/powerpc/pr104124.c: New.=