|
From: Jeremy F. <je...@go...> - 2003-04-02 08:39:55
|
I tried out Mesa software rendering; it failed because V was missing movd reg, r/m. The fix is simple: (http://www.goop.org/~jeremy/valgrind/88-mmxfix.patch) Implement movd mm, r/m coregrind/vg_to_ucode.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff -puN coregrind/vg_to_ucode.c~88-mmxfix coregrind/vg_to_ucode.c --- valgrind/coregrind/vg_to_ucode.c~88-mmxfix Tue Apr 1 18:47:14 2003 +++ valgrind-jeremy/coregrind/vg_to_ucode.c Tue Apr 1 19:08:04 2003 @@ -4867,6 +4867,7 @@ static Addr disInstr ( UCodeBlock* cb, A } break; + case 0x7E: /* MOVD (src)mmxreg, (dst)mmxreg-or-mem */ case 0x7F: /* MOVQ (src)mmxreg, (dst)mmxreg-or-mem */ vg_assert(sz == 4); modrm = getUChar(eip); @@ -4882,7 +4883,8 @@ static Addr disInstr ( UCodeBlock* cb, A (((UShort)(opc)) << 8) | ((UShort)modrm), TempReg, tmpa); if (dis) - VG_(printf)("movq %s, %s\n", + VG_(printf)("mov%c %s, %s\n", + opc == 0x7e ? 'd' : 'q', nameMMXReg(gregOfRM(modrm)), dis_buf); } @@ -5022,9 +5024,9 @@ static Addr disInstr ( UCodeBlock* cb, A unimp2: VG_(printf)("disInstr: unhandled 2-byte opcode: " "0x%x 0x%x 0x%x\n", + (Int)getUChar(eip-2), (Int)getUChar(eip-1), - (Int)getUChar(eip+0), - (Int)getUChar(eip+1) ); + (Int)getUChar(eip-0) ); VG_(printf)("This _might_ be the result of executing a " "SSE, SSE2 or 3DNow!\n" ); _ |
|
From: Julian S. <js...@ac...> - 2003-04-02 19:34:12
|
Um, that don't look right. [well, actually it might work if the
dest is memory, but not if it's an ireg.]
MOVD can't be done the same way as MOVQ.
Compare the code for 0x6E ( mmxreg := ireg-or-mem )
against that for 0x6F ( mmxreg := mmxreg-or-mem ).
0x6E generates MMX2_RegRd or MMX2_MemRd.
0x6F generates MMX2 or MMX2_MemRd.
where MMX2_RegRd is for ireg->mmxreg moves
MMX2_MemRd is for mem ->mmxreg moves
MMX2 is for purely internal MMX activity
Now, I notice that in fact my 0x6E is wrong, because the else { } bit
generates MMX2_RegRd when it should generate MMX2_MemRd.
Modulo that correction, I think 0x7F should be done same as 0x6F,
except with the direction of data flow reversed, and generating
MMX2_RegWr or MMX2_MemWr. MMX2_RegWr is problematic since I
haven't written any handlers for it, although the code for it should
be a straight rip of all the MMX2_RegRd cases.
J
On Wednesday 02 April 2003 8:39 am, Jeremy Fitzhardinge wrote:
> I tried out Mesa software rendering; it failed because V was missing
> movd reg, r/m. The fix is simple:
> (http://www.goop.org/~jeremy/valgrind/88-mmxfix.patch)
>
>
> Implement movd mm, r/m
>
>
> coregrind/vg_to_ucode.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff -puN coregrind/vg_to_ucode.c~88-mmxfix coregrind/vg_to_ucode.c
> --- valgrind/coregrind/vg_to_ucode.c~88-mmxfix Tue Apr 1 18:47:14 2003
> +++ valgrind-jeremy/coregrind/vg_to_ucode.c Tue Apr 1 19:08:04 2003
> @@ -4867,6 +4867,7 @@ static Addr disInstr ( UCodeBlock* cb, A
> }
> break;
>
> + case 0x7E: /* MOVD (src)mmxreg, (dst)mmxreg-or-mem */
> case 0x7F: /* MOVQ (src)mmxreg, (dst)mmxreg-or-mem */
> vg_assert(sz == 4);
> modrm = getUChar(eip);
> @@ -4882,7 +4883,8 @@ static Addr disInstr ( UCodeBlock* cb, A
> (((UShort)(opc)) << 8) | ((UShort)modrm),
> TempReg, tmpa);
> if (dis)
> - VG_(printf)("movq %s, %s\n",
> + VG_(printf)("mov%c %s, %s\n",
> + opc == 0x7e ? 'd' : 'q',
> nameMMXReg(gregOfRM(modrm)),
> dis_buf);
> }
> @@ -5022,9 +5024,9 @@ static Addr disInstr ( UCodeBlock* cb, A
> unimp2:
> VG_(printf)("disInstr: unhandled 2-byte opcode: "
> "0x%x 0x%x 0x%x\n",
> + (Int)getUChar(eip-2),
> (Int)getUChar(eip-1),
> - (Int)getUChar(eip+0),
> - (Int)getUChar(eip+1) );
> + (Int)getUChar(eip-0) );
>
> VG_(printf)("This _might_ be the result of executing a "
> "SSE, SSE2 or 3DNow!\n" );
>
> _
|
|
From: Jeremy F. <je...@go...> - 2003-04-02 19:46:23
|
On Wed, 2003-04-02 at 11:42, Julian Seward wrote:
> Um, that don't look right. [well, actually it might work if the
> dest is memory, but not if it's an ireg.]
> MOVD can't be done the same way as MOVQ.
> Compare the code for 0x6E ( mmxreg := ireg-or-mem )
> against that for 0x6F ( mmxreg := mmxreg-or-mem ).
Right you are. I misread the spec on what the instruction does. I'll
give it another go.
J
|