From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 93EDF386EC42; Thu, 30 Apr 2020 00:21:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93EDF386EC42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588206097; bh=E52VpK18kGRls7bZkHLTgJmfFo5brO2LXreKVYQ0858=; h=From:To:Subject:Date:From; b=JNP8JARfiz5HNYlZxKHrpFzAie1fwQgv5smEAMldpg6hmOj3wH1lKQFa5SsHVBBrT f8v0xO3sc/CxFHkEXpzyEB0DehgT3C3Y3ShjS7iCIA3hmho7YDFwFgNHqylnED3rz4 7tv4+xWCsLTS1JX+2VYZ2lvVU78jt7wLWz6CRJpg= From: "gabravier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94866] New: Failure to optimize pinsrq of 0 with index 1 into movq Date: Thu, 30 Apr 2020 00:21:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gabravier 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: 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 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, 30 Apr 2020 00:21:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94866 Bug ID: 94866 Summary: Failure to optimize pinsrq of 0 with index 1 into movq Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- typedef int64_t v2di __attribute__((vector_size(16))); typedef int32_t v2si __attribute__((vector_size(8))); v2di _mm_move_epi64(v2di a) { return v2di{a[0], 0LL}; } LLVM with `-O3 -msse4.1` compiles this to this :=20 _mm_move_epi64(long __vector(2)): # @_mm_move_epi64(long __vector(2)) movq xmm0, xmm0 # xmm0 =3D xmm0[0],zero ret GCC gives : _mm_move_epi64(long __vector(2)): xor eax, eax pinsrq xmm0, rax, 1 ret GCC's output seems like it would naturally be much slower, so unless there = is something seriously messed up with x86 chips that I've missed, LLVM's versi= on should be faster=