diff mbox series

[committed] i386/testsuite: Add testcase for fixed PR [PR51492]

Message ID CAFULd4YhniLYhvLntAjC+z8p=Nd+6EduZs0PGwbtEVq5U2_SiA@mail.gmail.com
State New
Headers show
Series [committed] i386/testsuite: Add testcase for fixed PR [PR51492] | expand

Commit Message

Uros Bizjak July 30, 2024, 6:04 p.m. UTC
PR target/51492

gcc/testsuite/ChangeLog:

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

Tested on x86_64-linux-gnu {,-m32}.

Uros.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/i386/pr51492.c b/gcc/testsuite/gcc.target/i386/pr51492.c
new file mode 100644
index 00000000000..0892e0c79a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr51492.c
@@ -0,0 +1,19 @@ 
+/* PR target/51492 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -msse2" } */
+
+#define SIZE 65536
+#define WSIZE 64
+unsigned short head[SIZE] __attribute__((aligned(64)));
+
+void
+f(void)
+{
+  for (unsigned n = 0; n < SIZE; ++n) {
+    unsigned short m = head[n];
+    head[n] = (unsigned short)(m >= WSIZE ? m-WSIZE : 0);
+  }
+}
+
+/* { dg-final { scan-assembler "psubusw" } } */
+/* { dg-final { scan-assembler-not "paddw" } } */