public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [SH] Target testcase fixes
@ 2011-09-27  2:29 Oleg Endo
  2011-09-28  0:02 ` Kaz Kojima
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Endo @ 2011-09-27  2:29 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

Hello,

The gcc.target/sh/mfmovd.c test was ran even for targets that can't
support it at all. While I was at it, I've also noticed that for some
reason SH4A specific tests were ran for other targets and reported a
fake pass, although the tests are actually unsupported. 

Cheers,
Oleg


2011-09-27  Oleg Endo  <oleg.endo@t-online.de>

	* gcc.target/sh/mfmovd.c: Extended list of supported targets.
	* gcc.target/sh/struct-arg-dw2.c: Typo fix.
	* gcc.target/sh/sh4a-sincos.c: Made test SH4A only.
	* gcc.target/sh/sh4a-sincosf.c: Ditto.
	* gcc.target/sh/sh4a-cos.c: Ditto.
	* gcc.target/sh/sh4a-cosf.c: Ditto.
	* gcc.target/sh/sh4a-sin.c: Ditto.
	* gcc.target/sh/sh4a-sinf.c: Ditto.
	* gcc.target/sh/sh4a-fsrra.c: Ditto.
	* gcc.target/sh/sh4a-memmovua.c: Ditto.
	* gcc.target/sh/sh4a-bitmovua.c: Ditto.


[-- Attachment #2: sh_test_fixes.patch --]
[-- Type: text/x-patch, Size: 8999 bytes --]

Index: gcc/testsuite/gcc.target/sh/sh4a-sincosf.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-sincosf.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-sincosf.c	(working copy)
@@ -3,12 +3,10 @@
    sine and cosine.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler-times "\tfsca\t" 1 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler-times "fsca" 1 } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 float test(float f) { return sinf(f) + cosf(f); }
-#else
-asm ("fsca\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-cos.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-cos.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-cos.c	(working copy)
@@ -1,13 +1,11 @@
 /* Verify that we generate single-precision sine and cosine approximate
-   (fsca) in fast math mode.  */
+   (fsca) in fast math mode on SH4A with FPU.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler "fsca" } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 double test(double f) { return cos(f); }
-#else
-asm ("fsca\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-sin.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-sin.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-sin.c	(working copy)
@@ -1,13 +1,11 @@
 /* Verify that we generate single-precision sine and cosine approximate
-   (fsca) in fast math mode.  */
+   (fsca) in fast math mode on SH4A with FPU.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler "fsca" } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 double test(double f) { return sin(f); }
-#else
-asm ("fsca\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/mfmovd.c
===================================================================
--- gcc/testsuite/gcc.target/sh/mfmovd.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/mfmovd.c	(working copy)
@@ -1,7 +1,9 @@
+/* Verify that we generate fmov.d instructions to move doubles when -mfmovd 
+   option is enabled.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-mfmovd" } */
-/* { dg-skip-if "No double precision FPU support" { "sh*-*-*" } "-m2a-nofpu -m2a-single-only -m4-nofpu -m4-single-only -m4a-nofpu -m4a-single-only" { "" } }  */
-/* { dg-final { scan-assembler "fmov.d"} }  */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a" "-m2a-single" "-m4" "-m4-single" "-m4-100" "-m4-100-single" "-m4-200" "-m4-200-single" "-m4-300" "-m4-300-single" "-m4a" "-m4a-single" } }  */
+/* { dg-final { scan-assembler "fmov.d" } } */
 
 extern double g;
 
Index: gcc/testsuite/gcc.target/sh/sh4a-sincos.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-sincos.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-sincos.c	(working copy)
@@ -3,12 +3,10 @@
    sine and cosine.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler-times "\tfsca\t" 1 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler-times "fsca" 1 } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 double test(double f) { return sin(f) + cos(f); }
-#else
-asm ("fsca\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-sinf.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-sinf.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-sinf.c	(working copy)
@@ -1,13 +1,11 @@
 /* Verify that we generate single-precision sine and cosine approximate
-   (fsca) in fast math mode.  */
+   (fsca) in fast math mode on SH4A with FPU.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler "fsca" } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 float test(float f) { return sinf(f); }
-#else
-asm ("fsca\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-fsrra.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-fsrra.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-fsrra.c	(working copy)
@@ -1,13 +1,11 @@
 /* Verify that we generate single-precision square root reciprocal
-   approximate (fsrra) in fast math mode.  */
+   approximate (fsrra) in fast math mode on SH4A with FPU.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsrra\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler "fsrra" } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 float test(float f) { return 1 / sqrtf(f); }
-#else
-asm ("fsrra\t");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-memmovua.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-memmovua.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-memmovua.c	(working copy)
@@ -1,17 +1,14 @@
 /* Verify that we generate movua to copy unaligned memory regions to
-   32-bit-aligned addresses.  */
+   32-bit-aligned addresses on SH4A.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O" } */
-/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 2 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } }  */
+/* { dg-final { scan-assembler-times "movua.l" 2 } } */
 
-#ifdef __SH4A__
 #include <string.h>
 
 struct s { int i; char a[10], b[10]; } x;
 int f() {
   memcpy(x.a, x.b, 10);
 }
-#else
-asm ("movua.l\t+");
-asm ("movua.l\t+");
-#endif
+
Index: gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c	(working copy)
@@ -1,9 +1,9 @@
-/* Verify that we generate movua to load unaligned 32-bit values.  */
+/* Verify that we generate movua to load unaligned 32-bit values on SH4A.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O" } */
-/* { dg-final { scan-assembler-times "\tmovua\\.l\t" 6 } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } }  */
+/* { dg-final { scan-assembler-times "movua.l" 6 } } */
 
-#ifdef __SH4A__
 /* Aligned.  */
 struct s0 { long long d : 32; } x0;
 long long f0() {
@@ -63,11 +63,5 @@
 unsigned long long g4() {
   return y4.d;
 }
-#else
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-asm ("movua.l\t");
-#endif
+
+
Index: gcc/testsuite/gcc.target/sh/struct-arg-dw2.c
===================================================================
--- gcc/testsuite/gcc.target/sh/struct-arg-dw2.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/struct-arg-dw2.c	(working copy)
@@ -1,4 +1,4 @@
-/* Verify that we don't generate fame related insn against stack adjustment
+/* Verify that we don't generate frame related insn against stack adjustment
    for the object sent partially in registers. */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-g" } */
Index: gcc/testsuite/gcc.target/sh/sh4a-cosf.c
===================================================================
--- gcc/testsuite/gcc.target/sh/sh4a-cosf.c	(revision 179143)
+++ gcc/testsuite/gcc.target/sh/sh4a-cosf.c	(working copy)
@@ -1,13 +1,11 @@
 /* Verify that we generate single-precision sine and cosine approximate
-   (fsca) in fast math mode.  */
+   (fsca) in fast math mode on SH4A with FPU.  */
 /* { dg-do compile { target "sh*-*-*" } } */
 /* { dg-options "-O -ffast-math" } */
-/* { dg-final { scan-assembler "\tfsca\t" } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } }  */
+/* { dg-final { scan-assembler "fsca" } } */
 
-#if defined __SH4A__ && ! defined __SH4_NOFPU__
 #include <math.h>
 
 float test(float f) { return cosf(f); }
-#else
-asm ("fsca\t");
-#endif
+

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

* Re: [SH] Target testcase fixes
  2011-09-27  2:29 [SH] Target testcase fixes Oleg Endo
@ 2011-09-28  0:02 ` Kaz Kojima
  0 siblings, 0 replies; 2+ messages in thread
From: Kaz Kojima @ 2011-09-28  0:02 UTC (permalink / raw)
  To: oleg.endo; +Cc: gcc-patches

Oleg Endo <oleg.endo@t-online.de> wrote:
> The gcc.target/sh/mfmovd.c test was ran even for targets that can't
> support it at all. While I was at it, I've also noticed that for some
> reason SH4A specific tests were ran for other targets and reported a
> fake pass, although the tests are actually unsupported. 

The patch looks fine.  Use imperative forms for ChangeLog entries
next time.  I've applied your patch with

2011-09-27  Oleg Endo  <oleg.endo@t-online.de>

	* gcc.target/sh/mfmovd.c: Extend list of supported targets.
	* gcc.target/sh/struct-arg-dw2.c: Fix typo.
	* gcc.target/sh/sh4a-sincos.c: Make test SH4A only.
	* gcc.target/sh/sh4a-sincosf.c: Ditto.
	* gcc.target/sh/sh4a-cos.c: Ditto.
	* gcc.target/sh/sh4a-cosf.c: Ditto.
	* gcc.target/sh/sh4a-sin.c: Ditto.
	* gcc.target/sh/sh4a-sinf.c: Ditto.
	* gcc.target/sh/sh4a-fsrra.c: Ditto.
	* gcc.target/sh/sh4a-memmovua.c: Ditto.
	* gcc.target/sh/sh4a-bitmovua.c: Ditto.

Regards,
	kaz

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

end of thread, other threads:[~2011-09-27 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27  2:29 [SH] Target testcase fixes Oleg Endo
2011-09-28  0:02 ` Kaz Kojima

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