diff mbox

[PTX] more tests annotations

Message ID 4886f0ca-c7ca-7270-8301-7818a4406f4a@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 26, 2016, 2:45 p.m. UTC
Applied the attached to markup some more tests that PTX either crashes on or 
doesn't apply strict IEEE semantics to.  In one case it's about debug info that 
we don't emit.

nathan

Comments

Alexander Monakov May 26, 2016, 5:16 p.m. UTC | #1
Hello,

On Thu, 26 May 2016, Nathan Sidwell wrote:

> Applied the attached to markup some more tests that PTX either crashes on or
> doesn't apply strict IEEE semantics to.  In one case it's about debug info
> that we don't emit.

> Index: gcc.dg/torture/c99-contract-1.c
> ===================================================================
> --- gcc.dg/torture/c99-contract-1.c	(revision 236702)
> +++ gcc.dg/torture/c99-contract-1.c	(working copy)
> @@ -2,6 +2,7 @@
>     expressions.  */
>  /* { dg-do run } */
>  /* { dg-options "-std=c99 -pedantic-errors" } */
> +/* { dg-skip-if "ptx only loosely follows IEEE" { "nvptx-*-*" } { "*" } { "" } } */

AFAIK both PTX and the underlying hardware implementation have good support
for IEEE semantics.  Here, either GCC emits fused multiply-add directly (at
-Os23), or it emits mul/add instructions without explicit rounding modifiers,
which allows PTX translation to contract the operations. In both cases that is
a GCC bug, correctly exposed by the testcase.

> Index: c-c++-common/torture/complex-sign-mixed-add.c
> ===================================================================
> --- c-c++-common/torture/complex-sign-mixed-add.c	(revision 236702)
> +++ c-c++-common/torture/complex-sign-mixed-add.c	(working copy)
> @@ -2,6 +2,7 @@
>     addition.  */
>  /* { dg-do run } */
>  /* { dg-options "-std=gnu99" { target c } } */
> +/* { dg-skip-if "ptx can elide zero additions" { "nvptx-*-*" } { "-O0" } { "" } } */

In light of the above I think this and the other similar case shouldn't be
disabled, not without deeper investigation.

Alexander
diff mbox

Patch

2016-05-26  Nathan Sidwell  <nathan@acm.org>

	* gcc.dg/20060410.c: Xfail on ptx.
	* gcc.dg/torture/c99-contract-1.c: Skip on ptx.
	* c-c++-common/torture/complex-sign-mixed-add.c: Skip on ptx -O0
	* c-c++-common/torture/complex-sign-mixed-sub.c: Skip on ptx -O0
	* gcc.c-torture/execute/pr68185.c: Skip on ptx -O0 & Os.
	* gcc.c-torture/execute/20020529-1.c: Skip on ptx -00.

Index: gcc.dg/20060410.c
===================================================================
--- gcc.dg/20060410.c	(revision 236702)
+++ gcc.dg/20060410.c	(working copy)
@@ -13,4 +13,4 @@  int bar (void)
     return ((struct foo *)0x1234)->i;
 }
 
-/* { dg-final { scan-assembler "foo" } } */
+/* { dg-final { scan-assembler "foo" { xfail nvptx-*-* } } } */
Index: gcc.dg/torture/c99-contract-1.c
===================================================================
--- gcc.dg/torture/c99-contract-1.c	(revision 236702)
+++ gcc.dg/torture/c99-contract-1.c	(working copy)
@@ -2,6 +2,7 @@ 
    expressions.  */
 /* { dg-do run } */
 /* { dg-options "-std=c99 -pedantic-errors" } */
+/* { dg-skip-if "ptx only loosely follows IEEE" { "nvptx-*-*" } { "*" } { "" } } */
 
 extern void abort (void);
 extern void exit (int);
Index: c-c++-common/torture/complex-sign-mixed-add.c
===================================================================
--- c-c++-common/torture/complex-sign-mixed-add.c	(revision 236702)
+++ c-c++-common/torture/complex-sign-mixed-add.c	(working copy)
@@ -2,6 +2,7 @@ 
    addition.  */
 /* { dg-do run } */
 /* { dg-options "-std=gnu99" { target c } } */
+/* { dg-skip-if "ptx can elide zero additions" { "nvptx-*-*" } { "-O0" } { "" } } */
 
 #include "complex-sign.h"
 
Index: c-c++-common/torture/complex-sign-mixed-sub.c
===================================================================
--- c-c++-common/torture/complex-sign-mixed-sub.c	(revision 236702)
+++ c-c++-common/torture/complex-sign-mixed-sub.c	(working copy)
@@ -2,6 +2,7 @@ 
    subtraction.  */
 /* { dg-do run } */
 /* { dg-options "-std=gnu99" { target c } } */
+/* { dg-skip-if "ptx can elide zero additions" { "nvptx-*-*" } { "-O0" } { "" } } */
 
 #include "complex-sign.h"
 
Index: gcc.c-torture/execute/pr68185.c
===================================================================
--- gcc.c-torture/execute/pr68185.c	(revision 236702)
+++ gcc.c-torture/execute/pr68185.c	(working copy)
@@ -1,4 +1,4 @@ 
-/* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "-O0" } { "" } } */
+/* { dg-skip-if "ptxas crashes or executes incorrectly" { nvptx-*-* } { "-O0" "-Os" } { "" } } Reported 2015-11-20  */
 
 int a, b, d = 1, e, f, o, u, w = 1, z;
 short c, q, t;
Index: gcc.c-torture/execute/20020529-1.c
===================================================================
--- gcc.c-torture/execute/20020529-1.c	(revision 236702)
+++ gcc.c-torture/execute/20020529-1.c	(working copy)
@@ -12,6 +12,10 @@ 
    forced a splitter through the output pattern "#", but there was no
    matching splitter.  */
 
+/* The ptx assembler appears to clobber 'b' inside foo during the f1 call.
+   Reported to nvidia 2016-05-18.  */
+/* { dg-skip-if "PTX assembler bug" { nvptx-*-* } { "-O0" } { "" } } */
+
 struct xx
  {
    int a;