Bug 295974 - vex-x86 omits some SSE4.1 opcodes such as PEXTRD
Summary: vex-x86 omits some SSE4.1 opcodes such as PEXTRD
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.7 SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
: 306360 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-14 03:39 UTC by John Reiser
Modified: 2017-05-07 19:34 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Reiser 2012-03-14 03:39:43 UTC
> vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x16
> ==18426==    at 0x804BE18: manhattan(unsigned char const*, unsigned char const*) (emmintrin.h:208)

That's "PEXTRD r/m32, xmm2, Ib"  which extracts a 32-bit wide, 32-bit aligned,
known-in-advance slice from xmm2, then places the slice into a general register
or memory location.  The opcode is from the SSE4.1 extensions.

vex-amd64 handles this case, but vex-x86 omits it (and should not).  In general x86 lacks the REX prefix byte (and there are no 64-bit general registers), but otherwise has mostly the same SSEx.y opcodes as amd64.
Comment 1 RJVB 2012-06-06 10:14:37 UTC
Same goes for the SSE4 instruction 0x66 0xF 0x3A 0x9 (_mm_ceil_pd), both in x86 and x86_64 (amd64). System is a MBP 13" with an i7 running OS X 10.6.8 , app is compiled with gcc-4.2 with the -msse4 flag.
I haven't tried, but I'm guessing more SSE4 instructions are concerned, why not just add them all? SSE4 isn't exactly the latest and hottest addition...
Comment 2 Julian Seward 2012-07-04 19:48:14 UTC
SSSE3 is the most recent insn set extension support in 32 bit mode.  There
are no plans to support anything more recent for 32 bit.

For 64 bit we support everything up to and including AVX.  There has been
a lot of work recently on this.  Can you re-check the trunk and see if it is still
broken for you?  IIUC we have full coverage in 64 bit mode, or very close to it.
Comment 3 RJVB 2012-07-04 20:52:19 UTC
Indeed, I haven't found any more SSE-related issues with svn-trunk. However, it tells me


valgrind: the 'impossible' happened:
   thread_create() unimplemented
[...]
sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable
==56560==    at 0x100129D7A: mach_msg_trap (in /usr/lib/libSystem.B.dylib)
==56560==    by 0x1001FB786: thread_create (in /usr/lib/libSystem.B.dylib)
==56560==    by 0x1002054E8: pthread_create_suspended_np (in /usr/lib/libSystem.B.dylib)
==56560==    by 0x100002263: CreateThread (msemul.h:407)
==56560==    by 0x100011595: Thread::Start(void*) (Thread.h:35)
==56560==    by 0x10000FFFB: main (threadTest.cpp:130)


Is it supposed to do that?
Comment 4 Julian Seward 2012-09-17 13:42:31 UTC
*** Bug 306360 has been marked as a duplicate of this bug. ***
Comment 5 Jeffrey Walton 2017-05-07 18:48:00 UTC
We've got a user reporting a similar issue for unhandled instructions "0x66 0xF 0x3A 0x22". Only the last byte differs, and I'm guessing its the same or nearly the same issue. I don't know the compiler. Also see https://groups.google.com/d/msg/cryptopp-users/rwRSMrxJVcw/68BESEbCAQAJ.

Others have reported the same unhandled instructions "0x66 0xF 0x3A 0x22". It looks like the compiler is Clang. Also see https://github.com/miloyip/rapidjson/issues/266.
Comment 6 Ivo Raisr 2017-05-07 19:31:51 UTC
Please do not revive old bugs. Leave them R.I.P. :-)

If this is a new problem for you, please report a new bug as per
http://valgrind.org/support/bug_reports.html
including all the required details.
Comment 7 Jeffrey Walton 2017-05-07 19:34:19 UTC
(In reply to Ivo Raisr from comment #6)
> Please do not revive old bugs. Leave them R.I.P. :-)
> 
> If this is a new problem for you, please report a new bug as per
> http://valgrind.org/support/bug_reports.html
> including all the required details.

Thanks Iva.

The bug is still open. How do we know when to add to an existing bug report, and open a new one?