From patchwork Mon Jul 18 13:10:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chung-Lin Tang X-Patchwork-Id: 105265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 16D02B6F9F for ; Mon, 18 Jul 2011 23:10:49 +1000 (EST) 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 21:10:18 +0800 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: X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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" } } */