Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc Add __floatunsidf __floatunsisf __floatunsitf routi...
details: https://anonhg.NetBSD.org/src/rev/5e0dc80d3918
branches: trunk
changeset: 766920:5e0dc80d3918
user: matt <matt%NetBSD.org@localhost>
date: Mon Jul 04 08:02:34 2011 +0000
description:
Add __floatunsidf __floatunsisf __floatunsitf routines.
XXX i think they are correct but not sure.
diffstat:
lib/libc/arch/arm/softfloat/softfloat.h | 14 +++++---
lib/libc/arch/m68k/softfloat/softfloat.h | 14 +++++---
lib/libc/arch/mips/softfloat/softfloat.h | 14 +++++---
lib/libc/arch/powerpc/softfloat/softfloat.h | 14 +++++---
lib/libc/arch/sh3/softfloat/softfloat.h | 14 +++++---
lib/libc/arch/sparc64/softfloat/softfloat.h | 14 +++++---
lib/libc/softfloat/bits64/softfloat.c | 46 +++++++++++++++++++++++++++-
7 files changed, 98 insertions(+), 32 deletions(-)
diffs (274 lines):
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/arm/softfloat/softfloat.h
--- a/lib/libc/arch/arm/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/arm/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.7 2006/05/16 20:55:51 mrg Exp $ */
+/* $NetBSD: softfloat.h,v 1.8 2011/07/04 08:02:34 matt Exp $ */
/* This is a derivative work. */
@@ -119,13 +119,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
float32 int64_to_float32( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/m68k/softfloat/softfloat.h
--- a/lib/libc/arch/m68k/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/m68k/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.2 2006/05/16 20:55:51 mrg Exp $ */
+/* $NetBSD: softfloat.h,v 1.3 2011/07/04 08:02:34 matt Exp $ */
/* This is a derivative work. */
@@ -119,13 +119,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
float32 int64_to_float32( long long );
float64 int64_to_float64( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/mips/softfloat/softfloat.h
--- a/lib/libc/arch/mips/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/mips/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.3 2011/01/17 23:53:04 matt Exp $ */
+/* $NetBSD: softfloat.h,v 1.4 2011/07/04 08:02:34 matt Exp $ */
/* This is a derivative work. */
@@ -121,13 +121,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
float32 int64_to_float32( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/powerpc/softfloat/softfloat.h
--- a/lib/libc/arch/powerpc/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/powerpc/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.5 2006/05/16 20:55:51 mrg Exp $ */
+/* $NetBSD: softfloat.h,v 1.6 2011/07/04 08:02:34 matt Exp $ */
/* This is a derivative work. */
@@ -119,13 +119,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
float32 int64_to_float32( long long );
float64 int64_to_float64( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/sh3/softfloat/softfloat.h
--- a/lib/libc/arch/sh3/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/sh3/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.9 2006/05/16 20:55:51 mrg Exp $ */
+/* $NetBSD: softfloat.h,v 1.10 2011/07/04 08:02:34 matt Exp $ */
/* This is a derivative work. */
@@ -119,13 +119,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
float32 int64_to_float32( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/arch/sparc64/softfloat/softfloat.h
--- a/lib/libc/arch/sparc64/softfloat/softfloat.h Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/arch/sparc64/softfloat/softfloat.h Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.6 2007/11/08 15:50:23 martin Exp $ */
+/* $NetBSD: softfloat.h,v 1.7 2011/07/04 08:02:35 matt Exp $ */
/* This is a derivative work. */
@@ -121,13 +121,17 @@
Software IEC/IEEE integer-to-floating-point conversion routines.
-------------------------------------------------------------------------------
*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
+float32 int32_to_float32( int32 );
+float32 uint32_to_float32( uint32 );
+float64 int32_to_float64( int32 );
+float64 uint32_to_float64( uint32 );
#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
+floatx80 int32_to_floatx80( int32 );
+floatx80 uint32_to_floatx80( uint32 );
#endif
#ifdef FLOAT128
-float128 int32_to_float128( int );
+float128 int32_to_float128( int32 );
+float128 uint32_to_float128( uint32 );
#endif
float32 int64_to_float32( long long );
float64 int64_to_float64( long long );
diff -r 5161bd72e79b -r 5e0dc80d3918 lib/libc/softfloat/bits64/softfloat.c
--- a/lib/libc/softfloat/bits64/softfloat.c Mon Jul 04 07:54:38 2011 +0000
+++ b/lib/libc/softfloat/bits64/softfloat.c Mon Jul 04 08:02:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.c,v 1.5 2007/11/08 21:31:04 martin Exp $ */
+/* $NetBSD: softfloat.c,v 1.6 2011/07/04 08:02:35 matt Exp $ */
/*
* This version hacked for use with gcc -msoft-float by bjh21.
@@ -46,7 +46,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: softfloat.c,v 1.5 2007/11/08 21:31:04 martin Exp $");
+__RCSID("$NetBSD: softfloat.c,v 1.6 2011/07/04 08:02:35 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef SOFTFLOAT_FOR_GCC
@@ -1128,6 +1128,15 @@
}
+float32 uint32_to_float32( uint32 a )
+{
+ if ( a == 0 ) return 0;
+ if ( a & (bits32) 0x80000000 )
+ return normalizeRoundAndPackFloat32( 0, 0x9D, a >> 1 );
+ return normalizeRoundAndPackFloat32( 0, 0x9C, a );
+}
+
+
/*
-------------------------------------------------------------------------------
Returns the result of converting the 32-bit two's complement integer `a'
@@ -1151,6 +1160,17 @@
}
+float64 uint32_to_float64( uint32 a )
+{
+ int8 shiftCount;
+ bits64 zSig = a;
+
+ if ( a == 0 ) return 0;
+ shiftCount = countLeadingZeros32( a ) + 21;
+ return packFloat64( 0, 0x432 - shiftCount, zSig<<shiftCount );
+
+}
+
#ifdef FLOATX80
/*
@@ -1177,6 +1197,17 @@
}
+floatx80 uint32_to_floatx80( uint32 a )
+{
+ int8 shiftCount;
+ bits64 zSig = a;
+
+ if ( a == 0 ) return packFloatx80( 0, 0, 0 );
+ shiftCount = countLeadingZeros32( a ) + 32;
+ return packFloatx80( 0, 0x403E - shiftCount, zSig<<shiftCount );
+
+}
+
#endif
#ifdef FLOAT128
@@ -1204,6 +1235,17 @@
}
+float128 uint32_to_float128( uint32 a )
+{
+ int8 shiftCount;
+ bits64 zSig0 = a;
+
+ if ( a == 0 ) return packFloat128( 0, 0, 0, 0 );
+ shiftCount = countLeadingZeros32( a ) + 17;
+ return packFloat128( 0, 0x402E - shiftCount, zSig0<<shiftCount, 0 );
+
+}
+
#endif
#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
Home |
Main Index |
Thread Index |
Old Index