Module: wine Branch: master Commit: 4a831ec7162b76f342072a52e2a6c0c5f522a4c2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4a831ec7162b76f342072a52e2...
Author: Peter Beutner p.beutner@gmx.net Date: Thu Mar 8 22:48:14 2007 +0100
ntdll: Handle SIMD exceptions.
---
dlls/ntdll/signal_i386.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 46bf9c2..75385c2 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -324,7 +324,8 @@ enum i386_trap_code TRAP_x86_ARITHTRAP = 16, /* Floating point exception */ TRAP_x86_ALIGNFLT = 17, /* Alignment check exception */ TRAP_x86_MCHK = 18, /* Machine check exception */ - TRAP_x86_CACHEFLT = 19 /* Cache flush exception */ + TRAP_x86_CACHEFLT = 19 /* SIMD exception (via SIGFPE) if CPU is SSE capable + otherwise Cache flush exception (via SIGSEV) */ #endif };
@@ -1210,6 +1211,19 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext ) case TRAP_x86_UNKNOWN: /* Unknown fault code */ rec->ExceptionCode = get_fpu_code( win_context ); break; + case TRAP_x86_CACHEFLT: /* SIMD exception */ + /* TODO: + * Behaviour only tested for divide-by-zero exceptions + * Check for other SIMD exceptions as well */ + if(siginfo->si_code != FPE_FLTDIV) + FIXME("untested SIMD exception: %#x. Might not work correctly\n", + siginfo->si_code); + + rec->ExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS; + rec->NumberParameters = 1; + /* no idea what meaning is actually behind this but thats what native does */ + rec->ExceptionInformation[0] = 0; + break; default: ERR( "Got unexpected trap %d\n", get_trap_code(context) ); rec->ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION;