Bug 13571 - objdump incorrectly disassembles 'movnti' as using 'QWORD PTR'
Summary: objdump incorrectly disassembles 'movnti' as using 'QWORD PTR'
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-06 19:19 UTC by Mark Seaborn
Modified: 2015-07-30 11:20 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Seaborn 2012-01-06 19:19:48 UTC
"objdump -M intel -d" produces the following disassembly for x86-32:

   0:	0f c3 00             	movnti QWORD PTR [eax],eax

This should be "DWORD PTR" rather than "QWORD PTR".

For comparison, the assembler gets this right and accepts "DWORD PTR" but not "QWORD PTR":

$ cat binutils_bug.S
.intel_syntax noprefix
movnti DWORD PTR [eax], eax
movnti QWORD PTR [eax], eax
$ as --32 binutils_bug.S -o binutils_bug.o
binutils_bug.S: Assembler messages:
binutils_bug.S:3: Error: ambiguous operand size or operands invalid for `movnti'

The AMD manual specifies the instruction as follows:

MOVNTI mem32, reg32  0F C3 /r 
MOVNTI mem64, reg64  0F C3 /r 

This happens with binutils 2.20.1 and with HEAD (as of today).
Comment 1 Michael Rolle 2015-07-30 07:23:05 UTC
Still not fixed as of 2.24.
Comment 2 H.J. Lu 2015-07-30 10:25:05 UTC
*** Bug 18739 has been marked as a duplicate of this bug. ***
Comment 3 cvs-commit@gcc.gnu.org 2015-07-30 11:19:08 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a8484f9612fc5b7d2b762b6fec950faa0fcd1483

commit a8484f9612fc5b7d2b762b6fec950faa0fcd1483
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 30 04:17:02 2015 -0700

    Properly disassemble movnti in Intel mode
    
    gas/testsuite/
    
    	PR binutils/13571
    	* gas/i386/i386.exp: Run i386-intel and x86_64-intel.
    	* gas/i386/i386-intel.d: New file.
    	* gas/i386/x86_64-intel.d: Likewise.
    
    opcodes/
    
    	PR binutils/13571
    	* i386-dis.c (MOD_0FC3): New.
    	(PREFIX_0FC3): Renamed to ...
    	(PREFIX_MOD_0_0FC3): This.
    	(dis386_twobyte): Replace PREFIX_0FC3 with MOD_0FC3.
    	(prefix_table): Replace Ma with Ev on movntiS.
    	(mod_table): Add MOD_0FC3.
Comment 4 H.J. Lu 2015-07-30 11:20:25 UTC
Fixed.