summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-05-27 11:00:56 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-05-27 11:00:56 +0000
commita3ddeea37c04f7813096ae4650883fde1ccb3202 (patch)
tree92070cf1fc577572a2c4371a5914c54037082d4c /lib
parentc7a9609a2e894f07d52a0f197fa53b786a673086 (diff)
downloadFreeBSD-src-a3ddeea37c04f7813096ae4650883fde1ccb3202.zip
FreeBSD-src-a3ddeea37c04f7813096ae4650883fde1ccb3202.tar.gz
Pull in GNU2 fix for this from FreeBSD, allows ldexp.c to compile with
gcc2.x
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/amd64/gen/ldexp.c10
-rw-r--r--lib/libc/i386/gen/ldexp.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/amd64/gen/ldexp.c b/lib/libc/amd64/gen/ldexp.c
index 7046c4e..be533c5 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 7046c4e..be533c5 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);
}
OpenPOWER on IntegriCloud