diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-07-24 22:04:56 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-07-24 22:04:56 +0000 |
commit | adc9dcf3e39318e7e04676df0f6a07b5dcca7aa0 (patch) | |
tree | a4938313bf6e389b4ea427dc25bebbf59c430fb9 /lib/libc/powerpcspe | |
parent | 6ae00e306f88b88e73093eda8b0996345ecc966b (diff) | |
download | src-adc9dcf3e39318e7e04676df0f6a07b5dcca7aa0.tar.gz src-adc9dcf3e39318e7e04676df0f6a07b5dcca7aa0.zip |
Fix floating point exception definitions for powerpcspe
These were incorrectly implemented in the original port.
Notes
Notes:
svn path=/head/; revision=336688
Diffstat (limited to 'lib/libc/powerpcspe')
-rw-r--r-- | lib/libc/powerpcspe/gen/fpgetmask.c | 2 | ||||
-rw-r--r-- | lib/libc/powerpcspe/gen/fpsetmask.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/powerpcspe/gen/fpgetmask.c b/lib/libc/powerpcspe/gen/fpgetmask.c index 3103e05ba41d..d2314c652588 100644 --- a/lib/libc/powerpcspe/gen/fpgetmask.c +++ b/lib/libc/powerpcspe/gen/fpgetmask.c @@ -44,6 +44,6 @@ fpgetmask() uint32_t fpscr; __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); - return ((fp_except_t)((fpscr >> 3) & 0x1f)); + return ((fp_except_t)((fpscr >> 2) & 0x1f)); } #endif diff --git a/lib/libc/powerpcspe/gen/fpsetmask.c b/lib/libc/powerpcspe/gen/fpsetmask.c index 24c0b3828b7f..9763b78a0919 100644 --- a/lib/libc/powerpcspe/gen/fpsetmask.c +++ b/lib/libc/powerpcspe/gen/fpsetmask.c @@ -45,8 +45,8 @@ fpsetmask(fp_except_t mask) fp_rnd_t old; __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); - old = (fp_rnd_t)((fpscr >> 3) & 0x1f); - fpscr = (fpscr & 0xffffff07) | (mask << 3); + old = (fp_rnd_t)((fpscr >> 2) & 0x1f); + fpscr = (fpscr & 0xffffff83) | (mask << 2); __asm__ __volatile("mtspr %1,%0" :: "r"(fpscr), "K"(SPR_SPEFSCR)); return (old); } |