diff options
author | 2008-10-07 22:06:29 +0000 | |
---|---|---|
committer | 2008-10-07 22:06:29 +0000 | |
commit | a657e0a74dbd34bc3296ba63e7e4836cc1f62aef (patch) | |
tree | 388577df6b9745501b222f5617e91332275fc623 /sys/lib/libkern/softfloat.h | |
parent | Move dev->driver over to being a pointer to a const struct, instead of stupidly (diff) | |
download | wireguard-openbsd-a657e0a74dbd34bc3296ba63e7e4836cc1f62aef.tar.xz wireguard-openbsd-a657e0a74dbd34bc3296ba63e7e4836cc1f62aef.zip |
unbreak ieeefp emulation code wrt converting double to unsigned
long ints for alpha. we've got only one instruction (cvttq) to
convert double-t to quadword, and float64_to_int64 did not take
into account the unsigned conversions
therefore, overflow always occured, and half of the unsigned range
(LONG_MAX .. ULONG_MAX) was broken
introduce roundAndPackInt64NoOverflow and float64_to_int64_no_overflow
for softfloat, that works with unsigned integers as well. note
that this will return zero for nan/inf/oflow/uflow, raising exception
flag
perl is happy now
looked over by miod@
tested by naddy@, and by me on nick@'s alpha
Diffstat (limited to 'sys/lib/libkern/softfloat.h')
-rw-r--r-- | sys/lib/libkern/softfloat.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/lib/libkern/softfloat.h b/sys/lib/libkern/softfloat.h index cc2bd1fbad9..cc5ed44172e 100644 --- a/sys/lib/libkern/softfloat.h +++ b/sys/lib/libkern/softfloat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softfloat.h,v 1.3 2008/06/26 05:42:20 ray Exp $ */ +/* $OpenBSD: softfloat.h,v 1.4 2008/10/07 22:06:29 martynas Exp $ */ /* $NetBSD: softfloat.h,v 1.1 2001/04/26 03:10:48 ross Exp $ */ /* This is a derivative work. */ @@ -232,6 +232,9 @@ int float64_to_int32( float64 ); int float64_to_int32_round_to_zero( float64 ); #ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */ int64_t float64_to_int64( float64 ); +#ifdef __alpha__ +int64_t float64_to_int64_no_overflow( float64 ); +#endif /* __alpha__ */ int64_t float64_to_int64_round_to_zero( float64 ); #endif float32 float64_to_float32( float64 ); |