Disabling SSE for debugging

Started by
0 comments, last by lawnjelly 7 years, 7 months ago

Just a quick one, I usually painstakingly go through SSE instructions I've written to find out the minimum requirements for a SIMD optimized routine, so I can switch to the reference implementation if the CPU doesn't support (and call __cpuid at startup).

Of course, there is always the chance I will make a mistake and the program will try and execute a non-existent instruction on a user's machine and crash. Does anyone know a way of disabling SSE etc on a development machine so as to check I'm not calling any naughty instructions? I know sometimes there is a BIOS switch but I'd prefer not to do that in case my windows install has a spaz out... :lol:

Advertisement

Why don't you just disable the SSE versions that you don't want to support via compiler flags?

For example, if I tell GCC -mno-sse, then even an innocent _mm_setzero_si128() will fail to compile.

Why don't you just disable the SSE versions that you don't want to support via compiler flags?

For example, if I tell GCC -mno-sse, then even an innocent _mm_setzero_si128() will fail to compile.

Hmm.. yeah I'm probably being dumb.

I am hot swapping the routines used, rather than compiling different versions of the executable, so the higher version SSE stuff needs to compile, I just need to make sure it doesn't run.

But I might be able to do some #ifdef jiggery pokery to use the compiler errors to show where I'm using a higher version when I didn't intend to, as you say.

This topic is closed to new replies.

Advertisement