From 8e101982f307d9198a4d1f063e8c307ab65ebe20 Mon Sep 17 00:00:00 2001 From: "Rodney W. Grimes" Date: Fri, 27 May 1994 11:00:56 +0000 Subject: [PATCH] Pull in GNU2 fix for this from FreeBSD, allows ldexp.c to compile with gcc2.x --- lib/libc/amd64/gen/ldexp.c | 10 ++++++++++ lib/libc/i386/gen/ldexp.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/libc/amd64/gen/ldexp.c b/lib/libc/amd64/gen/ldexp.c index 7046c4e17e6c..be533c5c7c9e 100644 --- a/lib/libc/amd64/gen/ldexp.c +++ b/lib/libc/amd64/gen/ldexp.c @@ -55,8 +55,18 @@ ldexp (double value, int exp) { double temp, texp, temp2; texp = exp; +#ifdef __GNUC__ +#if __GNUC__ >= 2 + asm ("fscale " + : "=u" (temp2), "=t" (temp) + : "0" (texp), "1" (value)); +#else asm ("fscale ; fxch %%st(1) ; fstp%L1 %1 " : "=f" (temp), "=0" (temp2) : "0" (texp), "f" (value)); +#endif +#else +error unknown asm +#endif return (temp); } diff --git a/lib/libc/i386/gen/ldexp.c b/lib/libc/i386/gen/ldexp.c index 7046c4e17e6c..be533c5c7c9e 100644 --- a/lib/libc/i386/gen/ldexp.c +++ b/lib/libc/i386/gen/ldexp.c @@ -55,8 +55,18 @@ ldexp (double value, int exp) { double temp, texp, temp2; texp = exp; +#ifdef __GNUC__ +#if __GNUC__ >= 2 + asm ("fscale " + : "=u" (temp2), "=t" (temp) + : "0" (texp), "1" (value)); +#else asm ("fscale ; fxch %%st(1) ; fstp%L1 %1 " : "=f" (temp), "=0" (temp2) : "0" (texp), "f" (value)); +#endif +#else +error unknown asm +#endif return (temp); }