From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29788 invoked by alias); 18 Jul 2011 13:10:46 -0000 Received: (qmail 29599 invoked by uid 22791); 18 Jul 2011 13:10:44 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jul 2011 13:10:27 +0000 Received: (qmail 27018 invoked from network); 18 Jul 2011 13:10:25 -0000 Received: from unknown (HELO ?192.168.1.14?) (cltang@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Jul 2011 13:10:25 -0000 Message-ID: <4E2430BA.6000906@codesourcery.com> Date: Mon, 18 Jul 2011 14:30:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Richard Earnshaw CC: gcc-patches Subject: Re: [PATCH] Canonicalize compares in combine [3/3] ARM backend part References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------070703010207050508050203" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01401.txt.bz2 This is a multi-part message in MIME format. --------------070703010207050508050203 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-length: 586 On 2011/7/18 04:46 PM, Richard Earnshaw wrote: > The patch to arm.c is ok, but the change to the test is not as it will cause problems with multilib testing. A better fix is to skip the test if the target is thumb1. > > The other test needs a similar check as it seems to expect a movs instruction. > > R. Yes it seems more logical to skip for thumb1, at least for the movs one. For the uxtb test, I think probably using "dg-require-effective-target arm_thumb2_ok" would be more suitable wrt multilib testing. Updated patch for the testcase parts, is this okay? Thanks, Chung-Lin --------------070703010207050508050203 Content-Type: text/plain; name="testcase.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="testcase.diff" Content-length: 1039 Index: combine-movs.c =================================================================== --- combine-movs.c (revision 0) +++ combine-movs.c (revision 0) @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { arm_thumb1 } } */ +/* { dg-options "-O" } */ + +void foo (unsigned long r[], unsigned int d) +{ + int i, n = d / 32; + for (i = 0; i < n; ++i) + r[i] = 0; +} + +/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */ Index: unsigned-extend-2.c =================================================================== --- unsigned-extend-2.c (revision 0) +++ unsigned-extend-2.c (revision 0) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_thumb2_ok } */ +/* { dg-options "-O" } */ + +unsigned short foo (unsigned short x) +{ + unsigned char i = 0; + for (i = 0; i < 8; i++) + { + x >>= 1; + x &= 0x7fff; + } + return x; +} + +/* { dg-final { scan-assembler "ands" } } */ +/* { dg-final { scan-assembler-not "uxtb" } } */ +/* { dg-final { scan-assembler-not "cmp" } } */ --------------070703010207050508050203--