Set the new floating point exception mask correctly

Submitted by:	Keith White <kwhite@site.uottawa.ca>
This commit is contained in:
Andrew Turner 2014-04-28 18:54:12 +00:00
parent 67e1705297
commit 8258fd68ef

View File

@ -45,7 +45,7 @@ fpsetmask(fp_except_t mask)
__asm __volatile("vmrs %0, fpscr" : "=&r"(old));
mask = (mask & FP_X_MASK) << 8;
new = (old & ~(FP_X_MASK << 8)) | mask;
__asm __volatile("vmsr fpscr, %0" : : "r"(old));
__asm __volatile("vmsr fpscr, %0" : : "r"(new));
return ((old >> 8) & FP_X_MASK);
}