X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-linux-os.c;h=f4fe13cb31cf892137a9ee3652efb477c5531683;hb=1b650be8b800cf96e2c268ae317fb26d0bf36827;hp=9b806d3784d162f52f4e2e9dd8a32979706bb558;hpb=b7192afcef9bbfd3fe1a4e2bfe3c73f853d164d1;p=sbcl.git diff --git a/src/runtime/ppc-linux-os.c b/src/runtime/ppc-linux-os.c index 9b806d3..f4fe13c 100644 --- a/src/runtime/ppc-linux-os.c +++ b/src/runtime/ppc-linux-os.c @@ -87,36 +87,28 @@ void os_restore_fp_control(os_context_t *context) { unsigned long control; + double d; control = os_context_fp_control(context) & - /* FIXME: Should we preserve the user's requested rounding mode? + /* FIXME: Should we preserve the user's requested rounding mode? - Note that doing + Note that doing + + ~(FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK) + + here leads to infinite SIGFPE for invalid operations, as + there are bits in the control register that need to be + cleared that are let through by that mask. -- CSR, 2002-07-16 */ - ~(FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK) - - here leads to infinite SIGFPE for invalid operations, as - there are bits in the control register that need to be - cleared that are let through by that mask. -- CSR, 2002-07-16 */ - FLOAT_TRAPS_BYTE_MASK; + FLOAT_TRAPS_BYTE_MASK; - /* FIXME: Shoot me now. + d = *((double *) &control); + /* Hmp. Apparently the following doesn't work either: - Hardcoded nastiness: the "0"s below refer to the first floating - point registers -- we should let gcc deal with that. The 8(31) - refers to the position on the stack, less one, of control (we - need for control to be the high word of the double loaded by - lfd; how do I know that r31 contains the stack? I don't, I'm - just guessing. The 255, on the other hand, is a valid constant - -- it says "move everything in the upper word into the floating - point control register. -- CSR, 2002-07-16 */ - - /* FIXME: it appears that the above text is quite accurate, in the - sense that this - - asm ("stw %0, 12(31); lfd 0, 8(31); mtfsf 255, 0" : : "r" (control) : "r31"); + asm volatile ("mtfsf 0xff,%0" : : "f" (d)); - no longer works. */ + causing segfaults at the first GC. + */ } void