IA-32 compatibility patch: FP denormal handling

From: Arun Sharma <adsharma_at_unix-os.sc.intel.com>
Date: 2003-08-21 06:39:51
The following patch makes ia64 compatible with i386 with respect to siginfo.si_code on FP denormal operands. This is necessary for the correct emulation of many IA-32 apps.

Please apply to both 2.4 and 2.5.

	-Arun



--- linux/arch/ia64/kernel/traps.c.orig	Fri Apr 20 19:08:01 2001
+++ linux/arch/ia64/kernel/traps.c	Thu Jul  5 13:36:53 2001
@@ -325,6 +325,10 @@
 			siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
 			if (isr & 0x11) {
 				siginfo.si_code = FPE_FLTINV;
+			} else if (isr & 0x22) {
+				/* denormal operand gets the same si_code as underflow 
+				* see arch/i386/kernel/traps.c:math_error()  */
+				siginfo.si_code = FPE_FLTUND;
 			} else if (isr & 0x44) {
 				siginfo.si_code = FPE_FLTDIV;
 			}

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Aug 20 16:40:51 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:16 EST