Capture SIGFPE from SIMD instruction
I'm trying to clear the floating point divide by zero flag to ignore that exception. I'm expecting that with the flag set (no change from default behavior I believe, and commented out below), my error handler will fire. However, _mm_div_ss doesn't seem to be raising SIGFPE. Any ideas? #include <stdio.h> #include <signal.h> #include <string.h> #include <xmmintrin.h> static void sigaction_sfpe(int signal, siginfo_t *si, void *arg) { printf("inside SIGFPE handler\nexit now."); exit(1); } int main() { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sigemptyset(&sa.sa_mask); sa.sa_sigaction =