From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C37143888C66; Fri, 29 Apr 2022 12:38:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C37143888C66 From: "kspalaiologos at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105429] Unnecessary moves generated with _mm_crc32_u64 Date: Fri, 29 Apr 2022 12:38:35 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: kspalaiologos 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 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: Fri, 29 Apr 2022 12:38:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105429 --- Comment #2 from Palaiologos --- I have observed the same behaviour with and without `mov eax, eax`. CRC32 i= s a 32-bit checksum, so I'd presume that the high bits aren't considered by the instruction. To support my claim, Vol. 2A 3-257 of Intel Software Development Manual giv= es the following operation for 2 REX.W 0F 38 F1 /r: >>> TEMP1[63-0] :=3D BIT_REFLECT64 (SRC[63-0]) TEMP2[31-0] :=3D BIT_REFLECT32 (DEST[31-0]) TEMP3[95-0] :=3D TEMP1[63-0] =C2=AB 32 TEMP4[95-0] :=3D TEMP2[31-0] =C2=AB 64 TEMP5[95-0] :=3D TEMP3[95-0] XOR TEMP4[95-0] TEMP6[31-0] :=3D TEMP5[95-0] MOD2 11EDC6F41H DEST[31-0] :=3D BIT_REFLECT (TEMP6[31-0]) DEST[63-32] :=3D 00000000H <<<=