public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/30993] New: feenableexcept, fedisableexcept are incomplete on m68k
@ 2023-10-23 22:52 bruno at clisp dot org
2023-10-23 22:52 ` [Bug math/30993] " bruno at clisp dot org
2023-10-23 22:56 ` bruno at clisp dot org
0 siblings, 2 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-10-23 22:52 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30993
Bug ID: 30993
Summary: feenableexcept, fedisableexcept are incomplete on m68k
Product: glibc
Version: 2.37
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: bruno at clisp dot org
Target Milestone: ---
When, on m68k, feenableexcept or fedisableexcept is called with an argument
that contained FE_INVALID, it changes only bit 13 of the floating-point control
register (fpcr).
However, the m68k fpcr has three bit positions for various types of invalid
operation:
- bit 15 for branch/set on unordered
- bit 14 for signaling not-a-number
- bit 13 for operand error
Reference: https://www.nxp.com/docs/en/reference-manual/M68000PM.pdf section
1.2.2, page 1-5, figure 1-3.
But when an unordered comparison is executed, this counts as an IEEE 754
"Invalid Operation" as well.
Reference:
https://www.gnu.org/software/libc/manual/html_node/FP-Exceptions.html
And when a signalling NaN is used in a floating-point operation, this counts as
an IEEE 754 "Invalid Operation" as well.
Reference: https://en.wikipedia.org/wiki/NaN#Signaling_NaN
So, instead of setting/clearing only bit 13, these two functions should
set/clear all of bit 15, bit 14, bit 13 all together.
Disclaimer: I can't test this on real hardware; I'm looking only at the
specifications.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug math/30993] feenableexcept, fedisableexcept are incomplete on m68k
2023-10-23 22:52 [Bug math/30993] New: feenableexcept, fedisableexcept are incomplete on m68k bruno at clisp dot org
@ 2023-10-23 22:52 ` bruno at clisp dot org
2023-10-23 22:56 ` bruno at clisp dot org
1 sibling, 0 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-10-23 22:52 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30993
Bruno Haible <bruno at clisp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Host| |m68k-linux-gnu
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug math/30993] feenableexcept, fedisableexcept are incomplete on m68k
2023-10-23 22:52 [Bug math/30993] New: feenableexcept, fedisableexcept are incomplete on m68k bruno at clisp dot org
2023-10-23 22:52 ` [Bug math/30993] " bruno at clisp dot org
@ 2023-10-23 22:56 ` bruno at clisp dot org
1 sibling, 0 replies; 3+ messages in thread
From: bruno at clisp dot org @ 2023-10-23 22:56 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=30993
--- Comment #1 from Bruno Haible <bruno at clisp dot org> ---
Created attachment 15192
--> https://sourceware.org/bugzilla/attachment.cgi?id=15192&action=edit
proposed fix
Find attached a proposed fix (untested).
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-23 22:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23 22:52 [Bug math/30993] New: feenableexcept, fedisableexcept are incomplete on m68k bruno at clisp dot org
2023-10-23 22:52 ` [Bug math/30993] " bruno at clisp dot org
2023-10-23 22:56 ` bruno at clisp dot org
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).