On Fri, Jun 21, 2019 at 11:00:58AM -0600, Jeremie Courreges-Anglas wrote: > CVSROOT: /cvs > Module name: src > Changes by: j...@cvs.openbsd.org 2019/06/21 11:00:58 > > Modified files: > lib/libc/arch/sparc64/fpu: fpu_explode.c fpu_qp.c > > Log message: > Fix conversions to long double on sparc64 > > Bug exposed by erratic sqlite3 behavior used in ports/devel/proj, > as pointed out by landry@. Richard Hipps (SQLite) pointed at the > culprit (_Qp_div), many thanks. > > Adapted from FreeBSD revision 146673 by Stephen Paskaluk and > stefanf@FreeBSD. FreeBSD commit message: > > """ > Fix long (and long long) to long double, unsigned to long double and > unsigned long (and unsigned long long) to long double conversions. > - Add a parameter that specifies the position of the sign bit to the _QP_TTOQ > macro, previously it always looked at bit 31. Pass a negative number to > disable sign inspection for unsigned types. This fixes _Qp_xtoq(), > _Qp_uitoq() and _Qp_uxtoq(). > - In the functions __fpu_itof() and __fpu_xtof(), look at the sign > bit to decide whether we're doing a conversion from an unsigned type. If so, > don't > negate the mantissa if the integer exceeds the biggest signed number. > """ > > ok deraadt@ >
There's also sys/arch/sparc64/fpu/fpu_explode.c Don't know if it is relevant though, -Otto