Version: 3.7 SVN OS: Linux Our project team has been optimizing MJPEG encoding using SIMD instructions. However, Valgrind doesn't seem to support all the SSE 4.x instructions. We've experienced two error cases: -> Unhandled instruction 0x66 0x0F 0x38 0x21 This is the opcode for the pmovsxbd. Operating on XMM registers, it unpacks four signed bytes to four signed integers. We could not find a bug report for this instruction. -> Unhandled instruction 0x66 0x0F 0x3A 0x22 This opcode references pinsrd, moving data from GPRs to XMM registers. This error has been referenced in another bug ticket in the system. Reproducible: Always Steps to Reproduce: In order to reproduce this problem, it is sufficient to create some assembly function with pinsrd and movsxbd: pmovsxbd %XMM0, %XMM0 pmovsxbd %XMM1, %XMM1 pinsrd $0, %ecx, %XMM5 Expected Results: Valgrind should emulate the troubled instructions correctly instead of crashing on encounter with them.
In 32-bit mode (which is what you appear to be using), Valgrind only supports up to SSSE3 instructions. Your software should query its capabilities using CPUID before trying to issue instructions that its CPUID does not claim are supported. In 64-bit mode though there is almost complete support for SSE4.2, including the two instructions you mention. If you can use 64 bit mode you should be able to run your code.
Thank you for your quick response. This was valuable information for us! Do you still consider this a bug, or more of a feature request? (True, we are working on SIMD in 32 bit code, but it's still running perfectly outside of Valgrind..)
Well, making SSE4.1 and 4.2 work for 64-bit was quite a lot of work. I (personally) regard 32-bit x86 as more or less "legacy" and did not really want to spend the effort to make 4.1/4.2 work there. Really the next round of SIMD support hacking will be to make AVX work on 64-bit, so realistically the prospect of anything beyond SSSE3 working for 32-bit is pretty small. IOW .. just use 64-bit. If you find any bugs in the 64-bit SSE4.1/4.2 support please let me know. I think it's pretty reliable, but one never really knows.
Closed then.