From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C53163857B9B; Thu, 27 Oct 2022 10:02:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C53163857B9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666864960; bh=Me1FLfBucn9GXbshVuRtKdRfnS6/t0R5lQQDLupkpwg=; h=From:To:Subject:Date:From; b=j/zb8qW6FU0FsxDzPx8NyI8DYDbmzicEwNqG6BU3l9iOaloFeyV2MN1QbVCGxZwv0 hPt5ZteswBu1btzcMSYeFW2aE1XyMuNL7lKpGSUtO97G6khpHEiSE1xKkaV2DkE/LR 9f0KG0BYgB/6ycvQGFAveZFrpAd1AB0T2uKc+dpc= From: "g.peterhoff@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107432] New: __builtin_convertvector generates inefficient code Date: Thu, 27 Oct 2022 10:02:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: g.peterhoff@t-online.de 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 107432 Summary: __builtin_convertvector generates inefficient code Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: g.peterhoff@t-online.de Target Milestone: --- Example: conversion int64_t -> int32_t avx512f + avx512vl HW conversions are available. avx2 There is a correctly working 32-bit-permutation (_mm256_permutevar8x32_epi32/vpermd) that can be used. I have not (yet) evaluated whether other conversions (larger int -> smaller int) are also affected. PS: On x86 it's already hell to optimize all cases depending on the instruc= tion set. PPS: What about -march=3Dznver4 ? https://godbolt.org/z/3s79bnh7v thx Gero=