On Mon, 14 Oct 2024, Matthew Malcomson wrote:

>   4. __atomic_feraiseexcept should be a builtin to avoid previously 
> unnecessary requirement to link libatomic.

libatomic should be linked by default (with --as-needed); see bug 81358.  
But if your concern is e.g. libstdc++.so having DT_NEEDED for libatomic, 
that might not suffice.

__atomic_feraiseexcept is a bit long to expand inline all the time (it's 
supposed to ensure that exceptions are raised including taking any enabled 
traps, so it's not just manipulating bits in the floating-point status 
register).  On the other hand, if you're only concerned with one 
operation, only a subset of the checks in __atomic_feraiseexcept are 
relevant (for example, addition and subtraction can't raise FE_DIVBYZERO; 
and except for the exact underflow case which __atomic_feraiseexcept 
doesn't handle anyway, they can't raise FE_UNDERFLOW).

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to