Closed Bug 538339 Opened 10 years ago Closed 10 years ago
In fpehandler() mask cw and back to the faulting x87 instruction on Solaris
See "Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 1": 8.7.3 Handling x87 FPU Exceptions in Software If the faulting floating-point instruction is followed by one or more non-floating-point instructions, it may not be useful to re-execute the faulting instruction. See Section 8.6, “x87 FPU Exception Synchronization,” for more information on synchronizing floating-point exceptions. In cases where the handler needs to restart program execution with the faulting instruction, the IRET instruction cannot be used directly. The reason for this is that because the exception is not generated until the next floating-point or WAIT/FWAIT instruction following the faulting floating-point instruction, the return instruction pointer on the stack may not point to the faulting instruction. To restart program execution at the faulting instruction, the exception handler must obtain a pointer to the instruction from the saved x87 FPU state information, load it into the return instruction pointer location on the stack, and then execute the IRET instruction. -------- We need to go back the faulting instruction, otherwise the instruction is not executed. e.g. 0.0 * HUGE_VAL will return 0.0 if FPE is on, it will return NAN if FPE is off. HUGE_VAL * 0.0 will return Inf is FPE is on, it will return NAN if FPE is off. It is important for Solaris because Solaris math libraries uses 0.0 * HUGE_VAL to get IEEE compliant values.
Assignee: nobody → ginn.chen
Status: NEW → ASSIGNED
Attachment #420508 - Flags: review?(gal)
Comment on attachment 420508 [details] [diff] [review] patch There is a typo in the last hunk (dfined).
fix the typo BTW: the patch contains the fix for Bug 538338, because fpchip_state.state is nothing if it is an integer exception.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.