From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F2CE53860C3C; Fri, 28 Oct 2022 03:36:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2CE53860C3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666928213; bh=4z3+FRvD3tt3TQZXslB0/+I16/ZAXzknVszJZ+yCQ4k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Dj7yJCcIAxdgdTj5JXLvNQp3FWNTNkxBRPYaf4v0tQXSBaBcNQ9d5G1Vlnlvdfy6t BXPB9VpePKDETGq+wsim4uCogAVDO8ht2Y6H5IEn+qdeEzb5cVAhsOP+GLvhJ8yTKj lpMKjUozCH2uyzArFFDThTLfq71NLnjI6+p+3jN4= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107432] __builtin_convertvector generates inefficient code Date: Fri, 28 Oct 2022 03:36:53 +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: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107432 --- Comment #4 from Hongtao.liu --- (In reply to Hongtao.liu from comment #3) > typedef int v4si __attribute__((vector_size(16))); > typedef long long v4di __attribute__((vector_size(32))); >=20 > v4si > foo (v4di a) > { > return __builtin_convertvector (a, v4si); > } >=20 > hmm, we actually support truncv4div4si2, but some how gcc failed to gener= ate > .VEC_CONVERT with truncmn2. >=20 /* IFN_VEC_CONVERT is supposed to be expanded at pass_lower_vector. So this dummy function should never be called. */ static void expand_VEC_CONVERT (internal_fn, gcall *) { gcc_unreachable (); } It's lowered by pass_lower_vector, ideally, can we use truncmn2 in expand_VEC_CONVERT if src is bigger integer mode than dest.=