Created attachment 115345 [details] Small C program illustrating the problem SUMMARY Using Valgrind 3.13, Valgrind is failing with an illegal instruction error. The instruction is vcmptrueps, which can be manually created with the _mm_cmp_ps() intrinsic. (Documentation: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cmp_ps&expand=719,719&techs=AVX) I have attached a small program that reproduces the problem. We see the problem with Clang 5.0.1 and GCC 7.3. (It seems that different versions interpret this intrinsic differently, so YMMV.) If I have the compiler output the assembly (-s flag), the vcmptrueps instruction doesn't show up. If I attach to the vgdb server and look at the highlighted instruction when valgrind sends the SIGILL signal, then it shows up. I'm not sure why they are different. I'm not an expert, I'm afraid.
I should comment that for simplicity, I compiled the test program with '-mavx -g'. The -mavx is needed, as the intrinsic is part of the AVX instruction set.
Well, I can reproduce this, and I see why it fails. The thing is, I'm not sure why you'd want to generate this instruction in the first place. It ignores its operands and returns "true" in each lane (that is, 4 lanes of 0xFFFFFFFF). V handles these comparisons ok in the case where it really is actually a comparison. But for these always-true/always-false cases, I can't think of a quick fix. You might want to have a look at findSSECmpOp() in guest_amd64_toIR.c; VCMPTRUEPS is the missing case 0xF.
Fixed: ecc4e970936b8ab2057f0a899d220ac611e83c3e implementation ea09451baf13c13dfea3869b0df34b677e0557bb test cases
*** Bug 406669 has been marked as a duplicate of this bug. ***