https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83964
--- Comment #18 from Steven Munroe <munroesj at gcc dot gnu.org> --- (In reply to jos...@codesourcery.com from comment #17) > And, when long is 64-bit, there is no corresponding standard function to > round to 32-bit integer with "invalid" raised for out-of-range results - > but there is (undocumented) __builtin_irint. So if you document > __builtin_irint, machine-specific built-in functions should only be needed > here if the functionality is desired in the presence of math-errno (cf. > the proposals to change the default there) - and even there, > machine-independent no-errno built-in functions might be better. A cross platform solution is acceptable if; it is generated in-line, fully optimized for the target, and is available soon. Looking at glibc for powerpc there are 29 cases in current code. God knows what boost is doing. Need both current rounding and truncate, signed and unsigned.