From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1386C39484A7; Thu, 27 Jan 2022 21:16:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1386C39484A7 From: "meissner 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: Thu, 27 Jan 2022 21:16:08 +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: meissner at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2022 21:16:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104124 --- Comment #3 from Michael Meissner --- There are two things going on. 1) There is no vspltisd instruction, so we can't generate a single instruct= ion to load constants other than 0 or -1. Unfortunately, this was not added in either power9 or power10. 2) On the power9 and power10 we have the xxspltib and vecsb2d instructions,= and we generate those if -mcpu=3Dpower9. To add support for new types of constants, the procedure is: 1) You need to modify easy_altivec_constant and gen_altivec_constant in rs6000.c (or rs6000.cc in GCC 12). Then add new predicates in predicate.md= for these new patterns. 2) Look for the predicates "easy_vector_constant_add_self" and so forth in predicates.md and add a new predicate here. 3) Then in altivec.md, look for the define_splits that use the various easy_vector_const_* functions and add a new pattern.=