From patchwork Thu May 12 13:57:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Revital Eres X-Patchwork-Id: 1466 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:52:12 -0000 Delivered-To: patches@linaro.org Received: by 10.224.61.3 with SMTP id r3cs107613qah; Thu, 12 May 2011 06:57:21 -0700 (PDT) Received: by 10.213.36.8 with SMTP id r8mr674183ebd.86.1305208640595; Thu, 12 May 2011 06:57:20 -0700 (PDT) Received: from mail-ew0-f50.google.com (mail-ew0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id k34si2837649wej.36.2011.05.12.06.57.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 May 2011 06:57:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) client-ip=209.85.215.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) smtp.mail=revital.eres@linaro.org Received: by ewy10 with SMTP id 10so505010ewy.37 for ; Thu, 12 May 2011 06:57:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.33.67 with SMTP id g3mr676038ebd.13.1305208639598; Thu, 12 May 2011 06:57:19 -0700 (PDT) Received: by 10.213.108.203 with HTTP; Thu, 12 May 2011 06:57:19 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 May 2011 16:57:19 +0300 Message-ID: Subject: Re: [PATCH, SMS 1/3] Support closing_branch_deps (second try) From: Revital Eres To: Ramana Radhakrishnan Cc: gcc-patches@gcc.gnu.org, Patch Tracking 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. 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" } } */ + +