https://gcc.gnu.org/g:8b737ec289da83e9e2a9672be0336980616e8932

commit r15-2419-g8b737ec289da83e9e2a9672be0336980616e8932
Author: Uros Bizjak <ubiz...@gmail.com>
Date:   Tue Jul 30 20:02:36 2024 +0200

    i386/testsuite: Add testcase for fixed PR [PR51492]
    
            PR target/51492
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr51492.c: New test.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr51492.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/testsuite/gcc.target/i386/pr51492.c 
b/gcc/testsuite/gcc.target/i386/pr51492.c
new file mode 100644
index 000000000000..0892e0c79a7b
--- /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" } } */

Reply via email to