diff --git a/lib/libc/ia64/gen/fpgetmask.c b/lib/libc/ia64/gen/fpgetmask.c index f3beea81081d..2c4cadf6d0dd 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 c69dccbf1b19..be4d8b4f67a8 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); }