This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in operands to IA32 cvtps2dq instruction in gnu as


On Sat, May 12, 2001 at 07:22:48PM +0930, amodra@one.net.au wrote:
> On Fri, May 11, 2001 at 05:55:02PM -0700, Phil Karn wrote:
> > The operand table for this instruction probably needs fixing.
> 
> Indeed.  Looks to me that movdq2q and movq2dq are wrong too.
> 

Thanks. I don't have to fix gas :-). But the dissambler is totally
screwed up.

# cat m.s
	cvtps2dq %xmm0,%xmm0
	cvtps2dq (%eax),%xmm0
# gcc -c m.s
# objdump -d m.o

m.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:	66 0f 5b c0          	cvtps2dq (%eax),%xmm0
   4:	66 0f 5b 00          	cvtps2dq (%eax),%xmm0


Here is a patch to start fixing the dissambler. You have to double
check each field in `twobyte_has_modrm'. Some of them are wrong.


H.J.
---
Index: opcodes/i386-dis.c
===================================================================
RCS file: /work/cvs/gnu/binutils/opcodes/i386-dis.c,v
retrieving revision 1.15
diff -u -p -r1.15 i386-dis.c
--- opcodes/i386-dis.c	2001/05/12 07:58:12	1.15
+++ opcodes/i386-dis.c	2001/05/12 09:54:37
@@ -2996,6 +2996,12 @@ print_insn_i386 (pc, info)
 
   struct dis_private priv;
   bfd_byte *inbuf = priv.the_buffer;
+
+  /* They are controlled by the local variable `need_modrm'. We have
+     to reset them first.  */
+  mod = 0;
+  rm = 0;
+  reg = 0;
 
   mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax
 		|| info->mach == bfd_mach_x86_64);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]