public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* soft-fp
@ 1999-12-29 10:13 Ulrich Drepper
  2000-01-03  0:04 ` soft-fp Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 1999-12-29 10:13 UTC (permalink / raw)
  To: GNU libc hacker

Hi,

I've finally added the soft-fp stuff Jakub sent me quite some time
ago.  It not of use for x86 or m68k, but probably for all the others.
Especially SPARC64 where the 128bit FP format can be/is implement
using these functions.

I've never really tested this stuff since none of my machines is using
them.  So, send mail to Jakub and rth (or for PPC to Geoff who at
least look at this code and nodded at some point in time).

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: soft-fp
  1999-12-29 10:13 soft-fp Ulrich Drepper
@ 2000-01-03  0:04 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2000-01-03  0:04 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: GNU libc hacker

On Wed, Dec 29, 1999 at 10:10:43AM -0800, Ulrich Drepper wrote:
> Hi,
> 
> I've finally added the soft-fp stuff Jakub sent me quite some time
> ago.  It not of use for x86 or m68k, but probably for all the others.
> Especially SPARC64 where the 128bit FP format can be/is implement
> using these functions.
> 
> I've never really tested this stuff since none of my machines is using
> them.  So, send mail to Jakub and rth (or for PPC to Geoff who at
> least look at this code and nodded at some point in time).

Thanks.
Here are small fixes which came up during the meantime:

2000-01-03  Jakub Jelinek  <jakub@redhat.com>

	* op-1.h: Fix division for machines using not normalizing version of
	udiv_qrnnd in longlong.h.
	* sysdeps/mips/sfp-machine.h: Likewise.
	* sysdeps/mips/mips64/sfp-machine.h: Likewise.
	* sysdeps/sparc/sparc64/sfp-machine.h: Likewise.
	Patch by Eddie C. Dost <ecd@skynet.be>.

	* soft-fp.h (QItype, UQItype): New types used by longlong.h.

--- soft-fp/sysdeps/mips/mips64/sfp-machine.h.jj	Wed Dec 29 19:08:15 1999
+++ soft-fp/sysdeps/mips/mips64/sfp-machine.h	Mon Jan  3 08:47:30 2000
@@ -11,7 +11,7 @@
   _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_2_udiv(Q,R,X,Y)
 
 #define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
--- soft-fp/sysdeps/mips/sfp-machine.h.jj	Wed Dec 29 19:08:15 1999
+++ soft-fp/sysdeps/mips/sfp-machine.h	Mon Jan  3 08:47:10 2000
@@ -10,7 +10,7 @@
 #define _FP_MUL_MEAT_Q(R,X,Y)				\
   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
-#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
 
--- soft-fp/sysdeps/sparc/sparc64/sfp-machine.h.jj	Wed Dec 29 19:08:16 1999
+++ soft-fp/sysdeps/sparc/sparc64/sfp-machine.h	Mon Jan  3 08:45:38 2000
@@ -49,7 +49,7 @@ do {								\
 				_FP_MUL_MEAT_RESET_FE)
 
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_2_udiv(Q,R,X,Y)
 
 #define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
--- soft-fp/soft-fp.h.jj	Wed Dec 29 19:08:14 1999
+++ soft-fp/soft-fp.h	Mon Jan  3 08:43:28 2000
@@ -159,8 +159,10 @@ do {						\
 #define UWtype		_FP_W_TYPE
 #define W_TYPE_SIZE	_FP_W_TYPE_SIZE
 
+typedef int QItype __attribute__((mode(QI)));
 typedef int SItype __attribute__((mode(SI)));
 typedef int DItype __attribute__((mode(DI)));
+typedef unsigned int UQItype __attribute__((mode(QI)));
 typedef unsigned int USItype __attribute__((mode(SI)));
 typedef unsigned int UDItype __attribute__((mode(DI)));
 #if _FP_W_TYPE_SIZE == 32
--- soft-fp/op-1.h.jj	Wed Dec 29 19:08:14 1999
+++ soft-fp/op-1.h	Mon Dec 20 09:33:32 1999
@@ -199,25 +199,25 @@
 
 #define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y)				\
   do {									\
-    _FP_W_TYPE _nh, _nl, _q, _r;					\
+    _FP_W_TYPE _nh, _nl, _q, _r, _y;					\
 									\
     /* Normalize Y -- i.e. make the most significant bit set.  */	\
-    Y##_f <<= _FP_WFRACXBITS_##fs - 1;					\
+    _y = Y##_f << _FP_WFRACXBITS_##fs;					\
 									\
     /* Shift X op correspondingly high, that is, up one full word.  */	\
-    if (X##_f <= Y##_f)							\
+    if (X##_f < Y##_f)							\
       {									\
+	R##_e--;							\
 	_nl = 0;							\
 	_nh = X##_f;							\
       }									\
     else								\
       {									\
-	R##_e++;							\
-	_nl = X##_f << (_FP_W_TYPE_SIZE-1);				\
+	_nl = X##_f << (_FP_W_TYPE_SIZE - 1);				\
 	_nh = X##_f >> 1;						\
       }									\
     									\
-    udiv_qrnnd(_q, _r, _nh, _nl, Y##_f);				\
+    udiv_qrnnd(_q, _r, _nh, _nl, _y);					\
     R##_f = _q | (_r != 0);						\
   } while (0)
 


Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.35 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-01-03  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-29 10:13 soft-fp Ulrich Drepper
2000-01-03  0:04 ` soft-fp Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).