I am cross-compiling a C++ application with Visual Studio 2012 Express on Windows 7 (target platform = Windows XP Embedded). The target CPU does not support SSE or SSE2 instructions. I therefore would like to be able to double-check that the DLLs and EXEs that I build do not use any SSE or SSE2 instructions. How can I do this?
Asked
Active
Viewed 1,891 times
5
-
2No point in double-checking when you can simply set the compile option correctly. – Hans Passant Jan 11 '16 at 15:30
-
https://msdn.microsoft.com/en-us/library/7t5yh4fd%28v=vs.110%29.aspx /arch compiler option. – Captain Giraffe Jan 11 '16 at 15:31
-
4@HansPassant I know about that compile option and I am using it. However, I noticed that our own build of QtCore4.dll crashed on the target platform due to an illegal instruction. After checking with OllyDbg it turned out that it still had SSE instructions inside, although I configured Qt 4.8.6 with the -no-sse and -no-sse2 options. I am now trying to understand why the DLL still has SSE instructions. I am trying to track down where in our Qt build we are forgetting the /arch:IA32 option. I plan to write some kind of script, hence this post. – Bart Vandewoestyne Jan 11 '16 at 16:03
-
4`objdump -d | grep xmm` might be a good first approximation. – Jester Jan 11 '16 at 16:20
-
It'll be hard to avoid false positives on code that does runtime CPU detection, and selects what version of things to run based on what the CPU supports. So there can be SSE and AVX code in the binary, but it still works fine on whatever the baseline is. – Peter Cordes Jan 12 '16 at 04:38
-
1Some compilers use SSE/SSE2 for scalar FP math, even in 32bit binaries. e.g. `float` uses SSE, `double` uses SSE2. `mulsd` = FP multiply scalar double-precision. (`mulpd` = packed double, i.e. SIMD vector instead of just the low element in the vector register.) – Peter Cordes Jan 12 '16 at 04:40
-
[How to check if a binary requires SSE4 or AVX on Linux](https://superuser.com/q/726395/241386), [How to check if compiled code uses sse and avx instructions?](https://stackoverflow.com/q/47878352/995714) – phuclv Jul 11 '18 at 17:57
1 Answers
4
This is how you can do it quick and dirty:
- Run Visual Studio command prompt
- Call
dumpbin /disasm required.dll > dll_disasm.asm
- Look for common SSE/SSE2 instructions, e.g.
movss
,xmm0
orxmm1
If no SSE instruction/registers found in DLL, you're good unless the DLL loads something else.

Anton K
- 4,658
- 2
- 47
- 60