OSDN Git Service

PR middle-end/29274
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Apr 2010 11:25:44 +0000 (11:25 +0000)
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Apr 2010 11:25:44 +0000 (11:25 +0000)
* gcc.target/arm/wmul-1.c: New test.
* gcc.target/arm/wmul-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158642 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/wmul-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/wmul-2.c [new file with mode: 0644]

index 026b4ba..4edbd72 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-22  Bernd Schmidt  <bernds@codesourcery.com>
+
+       PR middle-end/29274
+       * gcc.target/arm/wmul-1.c: New test.
+       * gcc.target/arm/wmul-2.c: New test.
+
 2010-04-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43845
 2010-04-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43845
diff --git a/gcc/testsuite/gcc.target/arm/wmul-1.c b/gcc/testsuite/gcc.target/arm/wmul-1.c
new file mode 100644 (file)
index 0000000..df85e7c
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv6t2" } */
+
+int mac(const short *a, const short *b, int sqr, int *sum)
+{
+  int i;
+  int dotp = *sum;
+
+  for (i = 0; i < 150; i++) {
+    dotp += b[i] * a[i];
+    sqr += b[i] * b[i];
+  }
+
+  *sum = dotp;
+  return sqr;
+}
+
+/* { dg-final { scan-assembler-times "smulbb" 2 } } */
diff --git a/gcc/testsuite/gcc.target/arm/wmul-2.c b/gcc/testsuite/gcc.target/arm/wmul-2.c
new file mode 100644 (file)
index 0000000..0c092f1
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv6t2" } */
+
+void vec_mpy(int y[], const short x[], short scaler)
+{
+ int i;
+
+ for (i = 0; i < 150; i++)
+   y[i] += ((scaler * x[i]) >> 31);
+}
+
+/* { dg-final { scan-assembler-times "smulbb" 1 } } */