diff mbox

[SMS,1/3] Support closing_branch_deps (second try)

Message ID BANLkTikBkyT+FvpOih64318DE5vv+PCBeA@mail.gmail.com
State New
Headers show

Commit Message

Revital Eres May 12, 2011, 1:57 p.m. UTC
Hello Ramana,

Following our conversation; here is the patch again without
the arm specific flags. Tested on ARM machine configured with
[--with-arch=armv7-a] --with-mode=thumb.

OK for mainline?

Thanks,
Revital

testsuite/Changlog:

        * gcc.target/arm/sms-9.c: New file.
        * gcc.target/arm/sms-10.c: New file.
diff mbox

Patch

Index: arm/sms-9.c
===================================================================
--- arm/sms-9.c	(revision 0)
+++ arm/sms-9.c	(revision 0)
@@ -0,0 +1,73 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms -fno-auto-inc-dec" } */
+
+extern void abort (void);
+
+int filter1[8][4] = {
+  {
+   23170, -23170, -23170, 23170,},
+  {
+   22005, -26319, -16846, 29621,},
+  {
+   22005, -26319, -16846, 29621,},
+  {
+   5, -26319, -16846, 29621,},
+  {
+   55, -26319, -16846, 29621,},
+  {
+   77, -26319, -16846, 29621,},
+  {
+   22005, -26319, -16846, 29621,},
+  {
+   22005, -26319, -16846, 29621,},
+
+};
+
+
+int out[32] = {
+  22, -22, -22, 22, 21, -25, -16, 28, 21, -25, -16, 28, 0, -25, -16, 28, 0,
+    -25, -16, 28, 0, -25, -16, 28, 21, -25, -16, 28, 21, -25, -16, 28
+};
+
+__attribute__ ((noinline))
+static void
+foo (int *arr, int *accums)
+{
+  typedef int NN[8][4];
+  static NN *filter;
+  int i;
+  filter = &filter1;
+
+  int *filterp;
+  int *arrp;
+  arrp = arr;
+  filterp = (int *) ((*filter)[0]);
+  i = 32;
+
+  while (i--)
+    {
+      *accums++ = (arrp[0] * filterp[0] + arrp[8] * filterp[0]) / 32768;
+      filterp += 1;
+    }
+}
+
+int
+main ()
+{
+  int inarr[32];
+  int accums[32];
+  int i;
+  for (i = 0; i < 32; i++)
+    inarr[i] = i << 2;
+  foo (inarr, accums);
+  for (i = 0; i < 32; i++)
+    if (out[i] != accums[i])
+      abort ();
+  return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" } }  */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
+
Index: arm/sms-10.c
===================================================================
--- arm/sms-10.c	(revision 0)
+++ arm/sms-10.c	(revision 0)
@@ -0,0 +1,35 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms -fno-auto-inc-dec -fmodulo-sched-allow-regmoves -gtoggle" } */
+
+extern void abort (void);
+
+unsigned char filter1[8] = { 2, 3, 1, 2, 3, 2, 2, 1 };
+
+
+void
+foo (int val, unsigned int size, unsigned char *dest)
+{
+  while (size != 0)
+    {
+      *dest++ = val & 0xff;
+      --size;
+    }
+}
+
+
+int
+main ()
+{
+  int i;
+  foo (50, 4, filter1);
+  for (i = 0; i < 4; i++)
+    if (filter1[i] != 50)
+      abort ();
+  return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "OK" 1 "sms" } }  */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
+