]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix masm ptwrite again
authorAndi Kleen <ak@gcc.gnu.org>
Mon, 18 May 2026 15:40:53 +0000 (08:40 -0700)
committerAndi Kleen <ak@gcc.gnu.org>
Tue, 19 May 2026 02:06:43 +0000 (19:06 -0700)
The earlier 64bit ptwrite as 32bit fix broke Intel syntax output. Handle
that too by using an alternative. In Intel syntax the instruction
data type is defined by the operands.

I'll commit it as obvious in a day or so for 15/16/trunk, unless there
are objections.

PR target/125351

gcc/ChangeLog:

* config/i386/i386.md: Use alternative to handle masm ptwrite
syntax.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr125351.c: New test.

gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr125351.c [new file with mode: 0644]

index 5ed7ea4599cf097dbc04dbad6ca8d0e729337eed..cd95a2862985da55e607b947e73077facb01ff66 100644 (file)
   [(unspec_volatile [(match_operand:SWI48 0 "nonimmediate_operand" "rm")]
                    UNSPECV_PTWRITE)]
   "TARGET_PTWRITE"
-  "ptwrite<imodesuffix>\t%0"
+  "ptwrite{<imodesuffix>|}\t%0"
   [(set_attr "type" "other")
    (set_attr "prefix_0f" "1")
    (set_attr "prefix_rep" "1")])
diff --git a/gcc/testsuite/gcc.target/i386/pr125351.c b/gcc/testsuite/gcc.target/i386/pr125351.c
new file mode 100644 (file)
index 0000000..f21adca
--- /dev/null
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-mptwrite -masm=intel" } */
+void foo() { __builtin_ia32_ptwrite32(0); }