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.
This commit is contained in:
parent
52d72144a6
commit
32aa925e11
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user