https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124316

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot org

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
Patch.

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index b4e397bc925b..075e47a2b94c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -30272,7 +30272,7 @@ (define_insn "ptwrite<mode>"
   [(unspec_volatile [(match_operand:SWI48 0 "nonimmediate_operand" "rm")]
                    UNSPECV_PTWRITE)]
   "TARGET_PTWRITE"
-  "ptwrite\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/pr124316.c
b/gcc/testsuite/gcc.target/i386/pr124316.c
new file mode 100644
index 000000000000..c1959611a926
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr124316.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mptwrite" } */
+#include <x86gprintrin.h>
+
+unsigned long long ull;
+unsigned u;
+void foo()
+{
+    _ptwrite64(ull);
+    _ptwrite32(u);
+}
+
+/* { dg-final { scan-assembler-times "ptwritel" 1 } } */
+/* { dg-final { scan-assembler-times "ptwriteq" 1 } } */

Reply via email to