Bug 142688 - (movsww (%ecx),%ax) vex x86->IR: unhandled instruction bytes: 0x66 0xF 0xBF 0x1
Summary: (movsww (%ecx),%ax) vex x86->IR: unhandled instruction bytes: 0x66 0xF 0xBF 0x1
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: 3.2.3
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
: 250799 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-08 16:11 UTC by Jan Schmidt
Modified: 2010-10-04 12:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Schmidt 2007-03-08 16:11:54 UTC
Seen in liboil 0.3.8.
Comment 1 Julian Seward 2007-03-08 20:23:52 UTC
>            Summary: movsww (%ecx),%ax x86->IR: unhandled instruction bytes:
>                     0x66 0xF 0xBF 0x1


Are you sure this is a valid instruction?

0F BF would be 'movswl r/m16, r32'.  So I can only imagine that
66 0F BF would mean 'movsww r/m16, r16'; which is a simple 16-bit
move.  In which case why not just use a normal move instruction.

Can you find the instruction in the liboil sources?  It would help
to know what the liboil authors intended to happen.
Comment 2 Jan Schmidt 2007-03-09 13:13:05 UTC
gdb says it is movsww (%ecx),%ax:

(gdb) x/4xb 0
0x0:    0x66    0x0f    0xbf    0x01
(gdb) x/i 0
0x0:    movsww (%ecx),%ax

Apparently version 0.3.8 of liboil used it, but then later it was replaced and doesn't seem to be the same in 0.3.10:

-      "1:  movsxw (%1), %%eax           \n"
+      "1:  movswl (%1), %%eax           \n"

Here's the commit:

revision 1.2
date: 2006-05-23 01:50:46 +0200;  author: ds;  state: Exp;  lines: +1 -1
* liboil/i386/abs_i386.c:
* liboil/i386/error8x8_i386.c:
Change movsx opcodes to something more AT&T-like.

We'd have to ask Dave Schleef for the exact history, but I suspect that the function in question (for performing ABS() on 16 bit ints) was autogenerated by the 'uberopt' code optimiser.

abs_u16_s16_i386asm3 is the function in liboil that had the instruction.
Comment 3 Julian Seward 2010-09-10 17:17:56 UTC
*** Bug 250799 has been marked as a duplicate of this bug. ***
Comment 4 Julian Seward 2010-10-04 12:57:29 UTC
Fixed, vex r2056.