Hi!

The immediate operand 0x44 in this insn was incorrectly emitted as
$0x44 even in -masm=intel syntax.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
approved by Uros in the PR, committed to trunk.

2026-03-05  Jakub Jelinek  <[email protected]>

        PR target/124367
        * config/i386/sse.md (*andnot<mode>3): Use 0x44 rather than $0x44
        for -masm=intel.

        * gcc.target/i386/avx512vl-pr124367.c: New test.

--- gcc/config/i386/sse.md.jj   2026-03-04 13:59:16.034958138 +0100
+++ gcc/config/i386/sse.md      2026-03-04 22:07:35.198575770 +0100
@@ -18897,9 +18897,9 @@ (define_insn "*andnot<mode>3"
       tmp = "pternlog";
       ssesuffix = "<ternlogsuffix>";
       if (which_alternative != 4 || TARGET_AVX512VL)
-       ops = "v%s%s\t{$0x44, %%1, %%2, %%0|%%0, %%2, %%1, $0x44}";
+       ops = "v%s%s\t{$0x44, %%1, %%2, %%0|%%0, %%2, %%1, 0x44}";
       else
-       ops = "v%s%s\t{$0x44, %%g1, %%g2, %%g0|%%g0, %%g2, %%g1, $0x44}";
+       ops = "v%s%s\t{$0x44, %%g1, %%g2, %%g0|%%g0, %%g2, %%g1, 0x44}";
       break;
     default:
       gcc_unreachable ();
--- gcc/testsuite/gcc.target/i386/avx512vl-pr124367.c.jj        2026-03-04 
22:30:47.365189378 +0100
+++ gcc/testsuite/gcc.target/i386/avx512vl-pr124367.c   2026-03-04 
22:34:14.904702187 +0100
@@ -0,0 +1,14 @@
+/* PR target/124367 */
+/* { dg-do assemble { target { { int128 && avx512vl } && masm_intel } } } */
+/* { dg-options "-O -mavx512vl -masm=intel" } */
+
+union {
+  __int128 a;
+  __attribute__((__vector_size__(sizeof (__int128)))) long long b;
+} u;
+
+void
+foo ()
+{
+  u.b ^= 0 > u.a | u.b;
+}

        Jakub

Reply via email to