[Bug 254911] lib/msun/ctrig_test fails if compiled with AVX (-mavx) or any CPUSET enabling AVX
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Apr 9 19:58:25 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254911
Dimitry Andric <dim at FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |arichardson at FreeBSD.org,
| |dim at FreeBSD.org,
| |emaste at freebsd.org
--- Comment #1 from Dimitry Andric <dim at FreeBSD.org> ---
This is what happens on my system (I just set CPUTYPE=sandybridge):
testing csinh(0 + 0 I) == 0 + 0 I
testing csinh(0 + -0 I) == 0 + -0 I
testing csinhf(0 + 0 I) == 0 + 0 I
testing csinhf(0 + -0 I) == 0 + -0 I
testing csinh(-0 + -0 I) == -0 + -0 I
testing csinh(-0 + 0 I) == -0 + 0 I
testing csinhf(-0 + -0 I) == -0 + -0 I
testing csinhf(-0 + 0 I) == -0 + 0 I
testing csin(0 + 0 I) == 0 + 0 I
testing csin(0 + -0 I) == 0 + -0 I
testing csinf(0 + 0 I) == 0 + 0 I
testing csinf(0 + -0 I) == 0 + -0 I
testing csin(-0 + -0 I) == -0 + -0 I
testing csin(-0 + 0 I) == -0 + 0 I
testing csinf(-0 + -0 I) == -0 + -0 I
testing csinf(-0 + 0 I) == -0 + 0 I
testing ccosh(0 + 0 I) == 1 + 0 I
testing ccosh(0 + -0 I) == 1 + -0 I
testing ccoshf(0 + 0 I) == 1 + 0 I
testing ccoshf(0 + -0 I) == 1 + -0 I
testing ccosh(-0 + -0 I) == 1 + 0 I
testing ccosh(-0 + 0 I) == 1 + -0 I
testing ccoshf(-0 + -0 I) == 1 + 0 I
testing ccoshf(-0 + 0 I) == 1 + -0 I
testing ccos(0 + 0 I) == 1 + -0 I
testing ccos(0 + -0 I) == 1 + 0 I
testing ccosf(0 + 0 I) == 1 + -0 I
testing ccosf(0 + -0 I) == 1 + 0 I
testing ccos(-0 + -0 I) == 1 + -0 I
testing ccos(-0 + 0 I) == 1 + 0 I
testing ccosf(-0 + -0 I) == 1 + -0 I
testing ccosf(-0 + 0 I) == 1 + 0 I
testing ctanh(0 + 0 I) == 0 + 0 I
testing ctanh(0 + -0 I) == 0 + -0 I
testing ctanhf(0 + 0 I) == 0 + 0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:147: ctanhf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctanhf(0 + -0 I) == 0 + -0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:147: ctanhf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctanh(-0 + -0 I) == -0 + -0 I
testing ctanh(-0 + 0 I) == -0 + 0 I
testing ctanhf(-0 + -0 I) == -0 + -0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:147: ctanhf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctanhf(-0 + 0 I) == -0 + 0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:147: ctanhf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctan(0 + 0 I) == 0 + 0 I
testing ctan(0 + -0 I) == 0 + -0 I
testing ctanf(0 + 0 I) == 0 + 0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:148: ctanf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctanf(0 + -0 I) == 0 + -0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:148: ctanf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctan(-0 + -0 I) == -0 + -0 I
testing ctan(-0 + 0 I) == -0 + 0 I
testing ctanf(-0 + -0 I) == -0 + -0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:148: ctanf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
testing ctanf(-0 + 0 I) == -0 + 0 I
*** Check failed: /usr/src/lib/msun/tests/ctrig_test.c:148: ctanf
fetestexcept((0x04 | 0x20 | 0x01 | 0x08 | 0x10)) (0x1) != 0
failed: 8 checks failed; see output for more details
So it's the exception masks that don't match. IIRC Alexander recently adjusted
most of these tests to print the "bad" values if they were failing, but it
doesn't really print the actual exception bits.
Probably there's some code in ctan and ctanh that takes a shortcut here and
precalculates the result, as we've seen before. Sprinkling some volatile or
compiling ctan/ctanh with -fno-builtin might help...
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list