public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* math tests failed when the argument is out of domain
@ 2022-10-11 20:25 Yu-Chien Peter Lin
  2022-10-13  9:24 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Yu-Chien Peter Lin @ 2022-10-11 20:25 UTC (permalink / raw)
  To: libc-help; +Cc: ycliang

Hi all, 

We run the glibc testsuite on RISC-V targets and got some 
common failure of following test in math subdir. 

FAIL: math/test-double-acos
FAIL: math/test-double-asin
FAIL: math/test-float64-acos
FAIL: math/test-float64-asin
FAIL: math/test-float32x-acos
FAIL: math/test-float32x-asin

The return values and errno of acos and asin are correct, but
they don't raise "Invalid operation" exception when the argument
is inf, -inf, 1.125, -1.125, max_value and -max_value.

These failed cases are listed test results [1] since glibc 2.33,
but it seems not a reported bug on sourceware bugzilla. so I want
to know the status on this issue.

[1] https://sourceware.org/glibc/wiki/Release/2.35#RISC-V_.28rv64imafdc.2Flp64d.29

These tests run at below environments.
- glibc 2.35
- gcc 10.2.1
- binutils 2.38
- Linux 5.4

Best Regards,
Peter Lin

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

* Re: math tests failed when the argument is out of domain
  2022-10-11 20:25 math tests failed when the argument is out of domain Yu-Chien Peter Lin
@ 2022-10-13  9:24 ` Szabolcs Nagy
  2022-10-16 11:08   ` Yu-Chien Peter Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2022-10-13  9:24 UTC (permalink / raw)
  To: Yu-Chien Peter Lin; +Cc: libc-help, ycliang

The 10/11/2022 20:25, Yu-Chien Peter Lin wrote:
> Hi all, 
> 
> We run the glibc testsuite on RISC-V targets and got some 
> common failure of following test in math subdir. 
> 
> FAIL: math/test-double-acos
> FAIL: math/test-double-asin
> FAIL: math/test-float64-acos
> FAIL: math/test-float64-asin
> FAIL: math/test-float32x-acos
> FAIL: math/test-float32x-asin
> 
> The return values and errno of acos and asin are correct, but
> they don't raise "Invalid operation" exception when the argument
> is inf, -inf, 1.125, -1.125, max_value and -max_value.


fwiw i saw this on aarch64 with some version of gcc-10 when
'return INFINITY/INFINITY;' is optimized to 'return NAN;'
so the fenv exception is not set.

this could be fixed via a more robust arithmetic to set nan
e.g. (x-x)/(x-x) or ensuring gcc takes exceptions into account
when const folding float operations.

> 
> These failed cases are listed test results [1] since glibc 2.33,
> but it seems not a reported bug on sourceware bugzilla. so I want
> to know the status on this issue.
> 
> [1] https://sourceware.org/glibc/wiki/Release/2.35#RISC-V_.28rv64imafdc.2Flp64d.29
> 
> These tests run at below environments.
> - glibc 2.35
> - gcc 10.2.1
> - binutils 2.38
> - Linux 5.4
> 
> Best Regards,
> Peter Lin

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

* Re: math tests failed when the argument is out of domain
  2022-10-13  9:24 ` Szabolcs Nagy
@ 2022-10-16 11:08   ` Yu-Chien Peter Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Yu-Chien Peter Lin @ 2022-10-16 11:08 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: libc-help, ycliang

On Thu, Oct 13, 2022 at 10:24:59AM +0100, Szabolcs Nagy wrote:
> The 10/11/2022 20:25, Yu-Chien Peter Lin wrote:
> > Hi all, 
> > 
> > We run the glibc testsuite on RISC-V targets and got some 
> > common failure of following test in math subdir. 
> > 
> > FAIL: math/test-double-acos
> > FAIL: math/test-double-asin
> > FAIL: math/test-float64-acos
> > FAIL: math/test-float64-asin
> > FAIL: math/test-float32x-acos
> > FAIL: math/test-float32x-asin
> > 
> > The return values and errno of acos and asin are correct, but
> > they don't raise "Invalid operation" exception when the argument
> > is inf, -inf, 1.125, -1.125, max_value and -max_value.
> 
> 
> fwiw i saw this on aarch64 with some version of gcc-10 when
> 'return INFINITY/INFINITY;' is optimized to 'return NAN;'
> so the fenv exception is not set.
> 
> this could be fixed via a more robust arithmetic to set nan
> e.g. (x-x)/(x-x) or ensuring gcc takes exceptions into account
> when const folding float operations.

Hi Szabolcs,

Thanks, these tests are pass with your patch applied.

Best Regards,
Peter Lin

> > 
> > These failed cases are listed test results [1] since glibc 2.33,
> > but it seems not a reported bug on sourceware bugzilla. so I want
> > to know the status on this issue.
> > 
> > [1] https://sourceware.org/glibc/wiki/Release/2.35#RISC-V_.28rv64imafdc.2Flp64d.29
> > 
> > These tests run at below environments.
> > - glibc 2.35
> > - gcc 10.2.1
> > - binutils 2.38
> > - Linux 5.4
> > 
> > Best Regards,
> > Peter Lin

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

end of thread, other threads:[~2022-10-16  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 20:25 math tests failed when the argument is out of domain Yu-Chien Peter Lin
2022-10-13  9:24 ` Szabolcs Nagy
2022-10-16 11:08   ` Yu-Chien Peter 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).