From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF9003858C50; Thu, 9 Feb 2023 12:22:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF9003858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675945376; bh=9vuilwlXYyzuhurgb5CuBKDAyuT0u2EkfGHgT90vwX8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e2G3HQCwcGkqquR6x0ek7AbUYgxf0PAEXkTlxTZ3l2Ufjw/RX2wDs1dw56VQ1uGZb DyIjPcTE9CPqS93HVsijXoluMkwuELIsOFyGg9IioGJ9nq6Vo0pYkWz64qPadqmXu+ i4Qab2CbQ8uhTF4LdAndi9fNmuQABO0DcTWv4xLY= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100758] __builtin_cpu_supports does not (always) detect "sse2" Date: Thu, 09 Feb 2023 12:22:56 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin 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=3D100758 --- Comment #16 from Jakub Jelinek --- (In reply to Erich Eckner from comment #4) > Created attachment 50871 [details] > cpuid probing >=20 > Does the attached program yield, what you need? (Sry, I'm quite unfamiliar > with asm in gcc) >=20 > It gives: >=20 > 00000001 746e6543 736c7561 48727561=20 > 000006d0 00000800 00004181 a7c9bbff=20 >=20 > and >=20 > 0000000a 746e6543 736c7561 48727561=20 > 000006fa 00010800 008863a9 afc9fbff=20 >=20 > on the two machines, respectively. Erich, if you still have access to those CPUs, could you retry with: #include static void cpuid( unsigned int ax, unsigned int cx, unsigned int *p ) { unsigned int flags; __asm __volatile ("movl %%ebx, %%esi\n\t" "cpuid\n\t" "xchgl %%ebx, %%esi" : "=3Da" (p[0]), "=3DS" (p[1]), "=3Dc" (p[2]), "=3Dd" (p[3]) : "0" (ax), "2" (cx)); } int main() { unsigned int regs[4]; for (int j=3D0; j<=3D18; j++) { int k =3D j > 10 ? -__INT_MAX__ - 1 + (j - 11) : j; cpuid( k, regs, 0 ); printf("%d %d ", k, 0); for (int i=3D0; i<4; i++) { printf("%08x ", regs[i]); } printf("\n"); cpuid( k, regs, 1 ); printf("%d %d ", k, 1); for (int i=3D0; i<4; i++) { printf("%08x ", regs[i]); } printf("\n"); } return 0; } Thanks. I've posted a different patch to gcc-patches: https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611632.html=