]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
x86: Compile avx2-vpcmpgtq-1.c with -fno-fuse-ops-with-volatile-access
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 8 Dec 2025 05:32:55 +0000 (13:32 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 8 Dec 2025 07:23:07 +0000 (15:23 +0800)
When -march=cascadelake is added, we generate

vmovdqa x(%rip), %ymm0
vpcmpq $1, x(%rip), %ymm0, %k0
vpmovm2q %k0, %ymm0
vmovdqa %ymm0, x(%rip)

instead of

vmovdqa x(%rip), %ymm1
vmovdqa x(%rip), %ymm0
vpcmpgtq %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, x(%rip)

Compile avx2-vpcmpgtq-1.c with -fno-fuse-ops-with-volatile-access to
generate vpcmpgtq instead of vpcmpq.

PR target/122343
* gcc.target/i386/avx2-vpcmpgtq-1.c: Compile with
-fno-fuse-ops-with-volatile-access.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/testsuite/gcc.target/i386/avx2-vpcmpgtq-1.c

index 7a983808b10c0b7d15a8dc9ad4d0ef917f730cb2..5e6f43105170a6576aed9cc5e19d12cfea0612b0 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mavx2 -O2" } */
+/* { dg-options "-mavx2 -O2 -fno-fuse-ops-with-volatile-access" } */
 /* { dg-final { scan-assembler "vpcmpgtq\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */
 
 #include <immintrin.h>