public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
@ 2012-08-22  1:18 Terry Guo
  2012-08-22 10:06 ` Richard Earnshaw
  0 siblings, 1 reply; 6+ messages in thread
From: Terry Guo @ 2012-08-22  1:18 UTC (permalink / raw)
  To: gcc-patches

Hi,

Due to the impact of ARM UAL, the Thumb1 and Thumb2 mode use LSRS
instruction while the ARM mode uses MOVS instruction. So the following case
is updated accordingly. Is it OK to trunk?

BR,
Terry

2012-08-21  Terry Guo  <terry.guo@arm.com>

        * gcc.target/arm/combine-movs.c: Check movs for ARM mode 
        and lsrs for other mode.

diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c
b/gcc/testsuite/gcc.target/arm/combine-movs.c
index 4209a33..fbef9df 100644
--- a/gcc/testsuite/gcc.target/arm/combine-movs.c
+++ b/gcc/testsuite/gcc.target/arm/combine-movs.c
@@ -1,5 +1,4 @@
 /* { dg-do compile } */
-/* { dg-skip-if "" { arm_thumb1 } } */
 /* { dg-options "-O" }  */

 void foo (unsigned long r[], unsigned int d)
@@ -9,4 +8,5 @@ void foo (unsigned long r[], unsigned int d)
     r[i] = 0;
 }

-/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
+/* { dg-final { scan-assembler "movs\tr\[0-9\]" { target arm_nothumb } } }
*/
+/* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target { ! arm_nothumb }
} } } */



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
  2012-08-22  1:18 [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode Terry Guo
@ 2012-08-22 10:06 ` Richard Earnshaw
  2012-08-22 11:15   ` Terry Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Earnshaw @ 2012-08-22 10:06 UTC (permalink / raw)
  To: Terry Guo; +Cc: gcc-patches

On 22/08/12 02:20, Terry Guo wrote:
> Hi,
> 
> Due to the impact of ARM UAL, the Thumb1 and Thumb2 mode use LSRS
> instruction while the ARM mode uses MOVS instruction. So the following case
> is updated accordingly. Is it OK to trunk?
> 
> BR,
> Terry
> 
> 2012-08-21  Terry Guo  <terry.guo@arm.com>
> 
>         * gcc.target/arm/combine-movs.c: Check movs for ARM mode 
>         and lsrs for other mode.
> 

This can't be right.  Thumb1 doesn't use unified syntax.

R.

> diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c
> b/gcc/testsuite/gcc.target/arm/combine-movs.c
> index 4209a33..fbef9df 100644
> --- a/gcc/testsuite/gcc.target/arm/combine-movs.c
> +++ b/gcc/testsuite/gcc.target/arm/combine-movs.c
> @@ -1,5 +1,4 @@
>  /* { dg-do compile } */
> -/* { dg-skip-if "" { arm_thumb1 } } */
>  /* { dg-options "-O" }  */
> 
>  void foo (unsigned long r[], unsigned int d)
> @@ -9,4 +8,5 @@ void foo (unsigned long r[], unsigned int d)
>      r[i] = 0;
>  }
> 
> -/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
> +/* { dg-final { scan-assembler "movs\tr\[0-9\]" { target arm_nothumb } } }
> */
> +/* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target { ! arm_nothumb }
> } } } */
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
  2012-08-22 10:06 ` Richard Earnshaw
@ 2012-08-22 11:15   ` Terry Guo
  2012-08-22 14:16     ` Richard Earnshaw
  2012-09-14 10:14     ` Ulrich Weigand
  0 siblings, 2 replies; 6+ messages in thread
From: Terry Guo @ 2012-08-22 11:15 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gcc-patches


> >
> > Due to the impact of ARM UAL, the Thumb1 and Thumb2 mode use LSRS
> > instruction while the ARM mode uses MOVS instruction. So the
> following case
> > is updated accordingly. Is it OK to trunk?
> >
> > BR,
> > Terry
> >
> > 2012-08-21  Terry Guo  <terry.guo@arm.com>
> >
> >         * gcc.target/arm/combine-movs.c: Check movs for ARM mode
> >         and lsrs for other mode.
> >
> 
> This can't be right.  Thumb1 doesn't use unified syntax.
> 
> R.
> 

oops. You are right. Sorry for making such obvious mistake. 
Here is patch updated to distinguish ARM and Thumb2. 
Tested for Thumb1, Thumb2 and ARM modes. No regression.

Is it OK?

BR,
Terry

2012-08-21  Terry Guo  <terry.guo@arm.com>

        * gcc.target/arm/combine-movs.c: Check movs for ARM mode 
        and lsrs for Thumb2 mode.


diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c
b/gcc/testsuite/gcc.target/arm/combine-movs.c
index 4209a33..3e36033 100644
--- a/gcc/testsuite/gcc.target/arm/combine-movs.c
+++ b/gcc/testsuite/gcc.target/arm/combine-movs.c
@@ -9,4 +9,5 @@ void foo (unsigned long r[], unsigned int d)
     r[i] = 0;
 }
 
-/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
+/* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target arm_thumb2_ok } }
}  */
+/* { dg-final { scan-assembler "movs\tr\[0-9\]" { target { ! arm_thumb2_ok
} } } } */


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
  2012-08-22 11:15   ` Terry Guo
@ 2012-08-22 14:16     ` Richard Earnshaw
  2012-09-04  6:02       ` Terry Guo
  2012-09-14 10:14     ` Ulrich Weigand
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Earnshaw @ 2012-08-22 14:16 UTC (permalink / raw)
  To: Terry Guo; +Cc: gcc-patches

On 22/08/12 12:16, Terry Guo wrote:
> 
>>>
>>> Due to the impact of ARM UAL, the Thumb1 and Thumb2 mode use LSRS
>>> instruction while the ARM mode uses MOVS instruction. So the
>> following case
>>> is updated accordingly. Is it OK to trunk?
>>>
>>> BR,
>>> Terry
>>>
>>> 2012-08-21  Terry Guo  <terry.guo@arm.com>
>>>
>>>         * gcc.target/arm/combine-movs.c: Check movs for ARM mode
>>>         and lsrs for other mode.
>>>
>>
>> This can't be right.  Thumb1 doesn't use unified syntax.
>>
>> R.
>>
> 
> oops. You are right. Sorry for making such obvious mistake. 
> Here is patch updated to distinguish ARM and Thumb2. 
> Tested for Thumb1, Thumb2 and ARM modes. No regression.
> 
> Is it OK?
> 
> BR,
> Terry
> 
> 2012-08-21  Terry Guo  <terry.guo@arm.com>
> 
>         * gcc.target/arm/combine-movs.c: Check movs for ARM mode 
>         and lsrs for Thumb2 mode.
> 
> 

OK.

R.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
  2012-08-22 14:16     ` Richard Earnshaw
@ 2012-09-04  6:02       ` Terry Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Terry Guo @ 2012-09-04  6:02 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gcc-patches



> -----Original Message-----
> From: Richard Earnshaw
> Sent: Wednesday, August 22, 2012 10:00 PM
> To: Terry Guo
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [Patch ARM] Update the test case to differ movs and lsrs
> for ARM mode and non-ARM mode
> 
> On 22/08/12 12:16, Terry Guo wrote:
> >
> >>>
> >>> Due to the impact of ARM UAL, the Thumb1 and Thumb2 mode use LSRS
> >>> instruction while the ARM mode uses MOVS instruction. So the
> >> following case
> >>> is updated accordingly. Is it OK to trunk?
> >>>
> >>> BR,
> >>> Terry
> >>>
> >>> 2012-08-21  Terry Guo  <terry.guo@arm.com>
> >>>
> >>>         * gcc.target/arm/combine-movs.c: Check movs for ARM mode
> >>>         and lsrs for other mode.
> >>>
> >>
> >> This can't be right.  Thumb1 doesn't use unified syntax.
> >>
> >> R.
> >>
> >
> > oops. You are right. Sorry for making such obvious mistake.
> > Here is patch updated to distinguish ARM and Thumb2.
> > Tested for Thumb1, Thumb2 and ARM modes. No regression.
> >
> > Is it OK?
> >
> > BR,
> > Terry
> >
> > 2012-08-21  Terry Guo  <terry.guo@arm.com>
> >
> >         * gcc.target/arm/combine-movs.c: Check movs for ARM mode
> >         and lsrs for Thumb2 mode.
> >
> >
> 
> OK.
> 
> R.

Hi Richard,

Is it ok to apply this fix to gcc 4.7 branch?

BR,
Terry


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode
  2012-08-22 11:15   ` Terry Guo
  2012-08-22 14:16     ` Richard Earnshaw
@ 2012-09-14 10:14     ` Ulrich Weigand
  1 sibling, 0 replies; 6+ messages in thread
From: Ulrich Weigand @ 2012-09-14 10:14 UTC (permalink / raw)
  To: Terry Guo; +Cc: Richard Earnshaw, gcc-patches

Terry Guo wrote:

> -/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
> +/* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target arm_thumb2_ok } }
> }  */
> +/* { dg-final { scan-assembler "movs\tr\[0-9\]" { target { ! arm_thumb2_ok
> } } } } */

This causes the arm.exp testcase to fail with a tcl error for me:

ERROR: tcl error sourcing /home/uweigand/fsf/gcc-head/gcc/testsuite/gcc.target/arm/arm.exp.
ERROR: unmatched open brace in list
    while executing
"foreach op $tmp {
        verbose "Processing option: $op" 3
        set status [catch "$op" errmsg]
        if { $status != 0 } {
            if { 0 && [info exists errorInfo] }..."
    (procedure "saved-dg-test" line 75)
    invoked from within
"saved-dg-test /home/uweigand/fsf/gcc-head/gcc/testsuite/gcc.target/arm/combine-movs.c {} { -ansi -pedantic-errors}"
    ("eval" body line 1)
    invoked from within
"eval saved-dg-test $args "
    (procedure "dg-test" line 10)
    invoked from within
"dg-test $testcase $flags ${default-extra-flags}"
    (procedure "dg-runtest" line 10)
    invoked from within
"dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
        "" $DEFAULT_CFLAGS"
    (file "/home/uweigand/fsf/gcc-head/gcc/testsuite/gcc.target/arm/arm.exp" line 37)
    invoked from within
"source /home/uweigand/fsf/gcc-head/gcc/testsuite/gcc.target/arm/arm.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /home/uweigand/fsf/gcc-head/gcc/testsuite/gcc.target/arm/arm.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

which seems to be caused by a missing space between two closing braces.

Fixed by the following patch.
Committed to mainline as obvious.

Bye,
Ulrich

ChangeLog:

	* gcc.target/arm/combine-movs.c: Add missing space.

Index: gcc/testsuite/gcc.target/arm/combine-movs.c
===================================================================
*** gcc/testsuite/gcc.target/arm/combine-movs.c	(revision 191254)
--- gcc/testsuite/gcc.target/arm/combine-movs.c	(working copy)
*************** void foo (unsigned long r[], unsigned in
*** 9,13 ****
      r[i] = 0;
  }
  
! /* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target arm_thumb2_ok } }} */
  /* { dg-final { scan-assembler "movs\tr\[0-9\]" { target { ! arm_thumb2_ok} } } } */
--- 9,13 ----
      r[i] = 0;
  }
  
! /* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target arm_thumb2_ok } } } */
  /* { dg-final { scan-assembler "movs\tr\[0-9\]" { target { ! arm_thumb2_ok} } } } */

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-14 10:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22  1:18 [Patch ARM] Update the test case to differ movs and lsrs for ARM mode and non-ARM mode Terry Guo
2012-08-22 10:06 ` Richard Earnshaw
2012-08-22 11:15   ` Terry Guo
2012-08-22 14:16     ` Richard Earnshaw
2012-09-04  6:02       ` Terry Guo
2012-09-14 10:14     ` Ulrich Weigand

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).