public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728]
@ 2023-04-12  2:27 HAO CHEN GUI
  2023-04-13  8:32 ` Kewen.Lin
  0 siblings, 1 reply; 4+ messages in thread
From: HAO CHEN GUI @ 2023-04-12  2:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool, David, Kewen.Lin, Peter Bergner

Hi,
  This patch xfails a float128 comparison test case on powerpc64 that
fails due to a longstanding issue with floating-point compares.

  See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more
information.

  The patch passed regression test on Power Linux platforms.

Thanks
Gui Haochen

ChangeLog
rs6000: xfail float128 comparison test case that fails on powerpc64.

This patch xfails a float128 comparison test case on powerpc64 that
fails due to a longstanding issue with floating-point compares.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more information.

gcc/testsuite/
	PR target/108728
	* gcc.dg/torture/float128-cmp-invalid.c: Add xfail.

patch.diff
diff --git a/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c b/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
index 1f675efdd61..f52686e0a24 100644
--- a/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
+++ b/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
@@ -1,5 +1,5 @@
 /* Test for "invalid" exceptions from __float128 comparisons.  */
-/* { dg-do run } */
+/* { dg-do run { xfail { powerpc*-*-* } } } */
 /* { dg-options "" } */
 /* { dg-require-effective-target __float128 } */
 /* { dg-require-effective-target base_quadfloat_support } */

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

* Re: [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728]
  2023-04-12  2:27 [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728] HAO CHEN GUI
@ 2023-04-13  8:32 ` Kewen.Lin
  2023-04-14  1:34   ` HAO CHEN GUI
  0 siblings, 1 reply; 4+ messages in thread
From: Kewen.Lin @ 2023-04-13  8:32 UTC (permalink / raw)
  To: HAO CHEN GUI; +Cc: Segher Boessenkool, David, Peter Bergner, gcc-patches

Hi Haochen,

on 2023/4/12 10:27, HAO CHEN GUI wrote:
> Hi,
>   This patch xfails a float128 comparison test case on powerpc64 that
> fails due to a longstanding issue with floating-point compares.
> 
>   See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more
> information.
> 
>   The patch passed regression test on Power Linux platforms.
> 
> Thanks
> Gui Haochen
> 
> ChangeLog
> rs6000: xfail float128 comparison test case that fails on powerpc64.
> 
> This patch xfails a float128 comparison test case on powerpc64 that
> fails due to a longstanding issue with floating-point compares.
> 
> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more information.
> 
> gcc/testsuite/
> 	PR target/108728
> 	* gcc.dg/torture/float128-cmp-invalid.c: Add xfail.
> 
> patch.diff
> diff --git a/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c b/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
> index 1f675efdd61..f52686e0a24 100644
> --- a/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
> +++ b/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
> @@ -1,5 +1,5 @@
>  /* Test for "invalid" exceptions from __float128 comparisons.  */
> -/* { dg-do run } */
> +/* { dg-do run { xfail { powerpc*-*-* } } } */

xfail all powerpc*-*-* can have some XPASSes on those ENVs with
software emulation.  Since the related hw insn xscmpuqp is guarded
with TARGET_FLOAT128_HW, could we use the effective target
ppc_float128_hw instead?

Maybe something like:

/* { dg-xfail-run-if "unexpected xscmpuqp" { ppc_float128_hw } } */

BR,
Kewen

>  /* { dg-options "" } */
>  /* { dg-require-effective-target __float128 } */
>  /* { dg-require-effective-target base_quadfloat_support } */



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

* Re: [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728]
  2023-04-13  8:32 ` Kewen.Lin
@ 2023-04-14  1:34   ` HAO CHEN GUI
  2023-04-14  5:11     ` Kewen.Lin
  0 siblings, 1 reply; 4+ messages in thread
From: HAO CHEN GUI @ 2023-04-14  1:34 UTC (permalink / raw)
  To: Kewen.Lin; +Cc: Segher Boessenkool, David, Peter Bergner, gcc-patches

Hi Kewen,

在 2023/4/13 16:32, Kewen.Lin 写道:
> xfail all powerpc*-*-* can have some XPASSes on those ENVs with
> software emulation.  Since the related hw insn xscmpuqp is guarded
> with TARGET_FLOAT128_HW, could we use the effective target
> ppc_float128_hw instead?

Thanks for your review comments. It's tricky. It invokes "__lekf2"
with "-mno-float128_hw". But it doesn't always pass the check.
With math library on P8, it can. With the library on P9, it fails.
So it's totally depended on the version of library which is not
controlled by GCC. What's your opinion?

Test result on P9
make check-gcc-c RUNTESTFLAGS="--target_board=unix'{-mno-float128-hardware}' dg-torture.exp=float128-cmp-invalid.c"

FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test

                === gcc Summary ===

# of expected passes            7
# of unexpected failures        7

Gui Haochen
Thanks

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

* Re: [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728]
  2023-04-14  1:34   ` HAO CHEN GUI
@ 2023-04-14  5:11     ` Kewen.Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Kewen.Lin @ 2023-04-14  5:11 UTC (permalink / raw)
  To: HAO CHEN GUI; +Cc: Segher Boessenkool, David, Peter Bergner, gcc-patches

Hi Haochen,

on 2023/4/14 09:34, HAO CHEN GUI wrote:
> Hi Kewen,
> 
> 在 2023/4/13 16:32, Kewen.Lin 写道:
>> xfail all powerpc*-*-* can have some XPASSes on those ENVs with
>> software emulation.  Since the related hw insn xscmpuqp is guarded
>> with TARGET_FLOAT128_HW, could we use the effective target
>> ppc_float128_hw instead?
> 
> Thanks for your review comments. It's tricky. It invokes "__lekf2"
> with "-mno-float128_hw". But it doesn't always pass the check.
> With math library on P8, it can. With the library on P9, it fails.

Math library doesn't provide it, __lekf2 is from libgcc (GCC itself).
The reason why the __lekf2 behaves differently on P8 and P9 is that
we have SW and HW versions for __lekf2, when the underlying "CPU
"supports 128-bit IEEE binary floating point instructions.", it will
use __lekf2_hw instead of __lekf2_sw, the former still adopts
insn xscmpuqp, then it fails.

> So it's totally depended on the version of library which is not
> controlled by GCC. What's your opinion?

So 
1) for ppc_float128_hw, it generates xscmpuqp then fails.
2) for !ppc_float128_hw, it uses __lekf2 but the underlying ENV
   supports __builtin_cpu_supports ("ieee128"), it exploits
   xscmpuqp, then fails.

Ideally we should use one effective target like ppc_ieee128_hw to
indicate the underlying ENV supports __builtin_cpu_supports ("ieee128")
but I think it may not be worth to adding that at this stage, so
I'd suggest xfail-ing it for "ppc_float128_hw || (ppc_cpu_supports_hw && p9vector_hw)".

BR,
Kewen

> 
> Test result on P9
> make check-gcc-c RUNTESTFLAGS="--target_board=unix'{-mno-float128-hardware}' dg-torture.exp=float128-cmp-invalid.c"
> 
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O0  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O1  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O3 -g  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -Os  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
> FAIL: gcc.dg/torture/float128-cmp-invalid.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test
> 
>                 === gcc Summary ===
> 
> # of expected passes            7
> # of unexpected failures        7
> 
> Gui Haochen
> Thanks

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

end of thread, other threads:[~2023-04-14  5:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12  2:27 [PATCH, rs6000] xfail float128 comparison test case that fails on powerpc64 [PR108728] HAO CHEN GUI
2023-04-13  8:32 ` Kewen.Lin
2023-04-14  1:34   ` HAO CHEN GUI
2023-04-14  5:11     ` Kewen.Lin

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