diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2008-10-07 22:06:30 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2008-10-07 22:06:30 +0000 |
commit | 13e274e30a2f3dce36a95d6cc01a2265a620eb19 (patch) | |
tree | 0eb7c8b8911c16c7d7ea19554846a1838def0749 /sys/lib/libkern/softfloat.h | |
parent | 42029dea90615aabb34095ab75e07c870aed697e (diff) |
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 ); |