summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-08-09 17:07:24 +0000
committermarcel <marcel@FreeBSD.org>2003-08-09 17:07:24 +0000
commit32aa925e1158e18c577347cd6a7596b26c565c8a (patch)
tree6768c09814b69365a9e53efa2f35199751b557bd
parent52d72144a6e767aea721c7a3f0cedae038aae7be (diff)
downloadFreeBSD-src-32aa925e1158e18c577347cd6a7596b26c565c8a.zip
FreeBSD-src-32aa925e1158e18c577347cd6a7596b26c565c8a.tar.gz
o There are 6 trap disable bits in ar.fpsr, not five. Even though we
didn't provide a constant for one of them (non-IEEE denormal trap), in an attempt to not support it probably, it's not we are left with the lower 5 bits. o Properly mask the passed or returned fp_except_t. Not doing so causes instant core dumps by trying to write an invalid value to ar.fpsr. Now that we're masking, stop using exclusive-or to invert bits. This fixes the illegal instruction fault encountered when building mozilla.
-rw-r--r--lib/libc/ia64/gen/fpgetmask.c2
-rw-r--r--lib/libc/ia64/gen/fpsetmask.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/ia64/gen/fpgetmask.c b/lib/libc/ia64/gen/fpgetmask.c
index f3beea8..2c4cadf 100644
--- a/lib/libc/ia64/gen/fpgetmask.c
+++ b/lib/libc/ia64/gen/fpgetmask.c
@@ -36,5 +36,5 @@ fpgetmask(void)
u_int64_t fpsr;
__asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
- return (fpsr & 0x1f) ^ 0x1f;
+ return (~fpsr & 0x3f);
}
diff --git a/lib/libc/ia64/gen/fpsetmask.c b/lib/libc/ia64/gen/fpsetmask.c
index c69dccb..be4d8b4 100644
--- a/lib/libc/ia64/gen/fpsetmask.c
+++ b/lib/libc/ia64/gen/fpsetmask.c
@@ -37,8 +37,8 @@ fpsetmask(fp_except_t mask)
u_int64_t oldmask;
__asm __volatile("mov %0=ar.fpsr" : "=r" (fpsr));
- oldmask = (fpsr & 0x1f) ^ 0x1f;
- fpsr = (fpsr & ~0x1f) | (mask ^ 0x1f);
+ oldmask = ~fpsr & 0x3f;
+ fpsr = (fpsr & ~0x3f) | (~mask & 0x3f);
__asm __volatile("mov ar.fpsr=%0" :: "r" (fpsr));
- return oldmask;
+ return (oldmask);
}
OpenPOWER on IntegriCloud