public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Chung-Lin Tang <cltang@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Canonicalize compares in combine [3/3] ARM backend part
Date: Mon, 18 Jul 2011 18:40:00 -0000	[thread overview]
Message-ID: <4E24725C.4070804@arm.com> (raw)
In-Reply-To: <4E2430BA.6000906@codesourcery.com>

On 18/07/11 14:10, Chung-Lin Tang wrote:
> 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
> 

OK.

R.

> 
> testcase.diff
> 
> 
> 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" } } */


  reply	other threads:[~2011-07-18 17:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18  9:37 Richard Earnshaw
2011-07-18 14:30 ` Chung-Lin Tang
2011-07-18 18:40   ` Richard Earnshaw [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-04-22 16:23 Chung-Lin Tang
2011-06-15 13:58 ` Richard Earnshaw
2011-07-18  8:32   ` Chung-Lin Tang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E24725C.4070804@arm.com \
    --to=rearnsha@arm.com \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).