From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E1443858D39; Mon, 27 Feb 2023 23:06:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E1443858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677539213; bh=YTVLhRtu0qlhGq1pbtFgmO/mOHIsXnvA53Yn3RzF7xo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=riRP8RIglSKyavo0s+9vSMekLNHQ1cz2cS84/cWhTC2f/ZoLQZ/by+pGv5PiXTRuh Pz2u5noFhNgaKNr9GSbXuI37UlDr4kY0VFYPgD2jt/SrL7ThbQk78owRjtk6kGfvmf OAOm+w2eF82ji6SCwruRyZ4X3zeDhdDzjCMBF3xA= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106770] PPCLE: Unnecessary xxpermdi before mfvsrd Date: Mon, 27 Feb 2023 23:06:52 +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.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jskumari 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=3D106770 --- Comment #5 from Segher Boessenkool --- (In reply to Jens Seifert from comment #4) > PPCLE with no special option means -mcpu=3Dpower8 -maltivec (altivecle t= o be > mor precise). What? No. $ sh config.sub ppcle=20=20=20=20=20=20 powerpcle-unknown-none This is typically the old 32-bit PowerPC ELF format. powerpcle-elf (which non-canonically can be called ppcle-elf) for example, or ppcle-linux, but n= ot ppcle-aix and the like (that one doesn't even exist; at least one COFF format has existed in the past though). This may not matter for you, but it is awfully confusing for others. powerpc64le-linux (and I believe all other existing ELFv2 ports) require a p8 or later CPU, sure; but it is perfectly valid to have no AltiVec even then, or for a port to default to some other CPU. Currently we have no such thing, and all default defaults are like you say, but that might change. > vec_promote(, 1) should be a noop on ppcle. It never is, not on powerpc64le either. It always duplicates the selected elt to all lanes. > But value gets > splatted to both left and right part of vector register. =3D> 2 unnecesary > xxpermdi So why are those not optimised away? *That* is the question! > The rest of the operations are done on left and right part. >=20 > vec_extract(, 1) should be noop on ppcle. But value gets > taken from right part of register which requires a xxpermdi >=20 > Overall 3 unnecessary xxpermdi. Don't know why the right part of register > gets "preferred". I don't know what you mean there? The ABIs say where parameters and return values are stored, but you mean something else?=