This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: PATCH: PR gas/5109: Extra REX byte generated in Intel mode


On Mon, Oct 08, 2007 at 01:32:49PM +0100, Jan Beulich wrote:
> >--- gas/config/tc-i386.c.intel	2007-10-01 15:12:57.000000000 -0700
> >+++ gas/config/tc-i386.c	2007-10-04 11:15:34.000000000 -0700
> >@@ -3384,7 +3384,11 @@ process_suffix (void)
> > 	}
> >       else if (i.suffix == QWORD_MNEM_SUFFIX)
> > 	{
> >-	  if (!check_qword_reg ())
> >+	  if (intel_syntax
> >+	      && i.tm.opcode_modifier.ignoresize
> >+	      && i.tm.opcode_modifier.no_qsuf)
> >+	    i.suffix = 0;
> >+	  else if (!check_qword_reg ())
> > 	    return 0;
> > 	}
> >       else if (i.suffix == WORD_MNEM_SUFFIX)
> 
> Wouldn't this change allow nonsense like
> 
> 	mov	es, qword ptr [rax]

There are many instances where a wong XXXWORD are allowed

bash-3.2$ cat x.s
.intel_syntax noprefix
movdqu WORD PTR ds:0x12345678,xmm1
bash-3.2$ /usr/bin/as --32 -o x.o x.s  
bash-3.2$ objdump -dw -Mintel x.o

x.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   f3 0f 7f 0d 78 56 34 12         movdqu XMMWORD PTR
ds:0x12345678,xmm1
bash-3.2$ 

and there is also

http://sourceware.org/bugzilla/show_bug.cgi?id=3993

> 
> ? And wouldn't (if correct) a similar change be needed to prevent operand size
> overrides to be emitted for dword operations in 16-bit mode?
> 

Feel free to fix them.

Thanks.


H.J.


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