Bug 18736 - x86 vcvtsi2sd has {er} decorator in wrong place
Summary: x86 vcvtsi2sd has {er} decorator in wrong place
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-29 19:22 UTC by Michael Rolle
Modified: 2015-07-29 22:53 UTC (History)
1 user (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 Michael Rolle 2015-07-29 19:22:33 UTC
The vcvtsi2sd instruction has the {er} decorator associated with the last operand.  See Intel doc:

EVEX.NDS.LIG.F2.0F.W1 2A /r
VCVTSI2SD xmm1, xmm2, r/m64{er}

However, objdump produces, as an example,

    5290:	62 61 97 10 2a f0    	vcvtsi2sd xmm30,xmm29,{rn-sae},rax

Also, as requires the form

vcvtsi2sd xmm30,xmm29,{rn-sae},rax

and it will not accept the (proper) form

vcvtsi2sd xmm30,xmm29,rax,{rn-sae}        #  Error: operand type mismatch for `vcvtsi2sd'

as does not produce incorrect code, but it is a serious problem because it will not assemble code that follows the Intel spec.

I suspect that in both as and objdump, there is logic that associates the {er} decorator with the last _vector_ source operand, rather than the last vector or GPR source.  They correctly ignore immediate operands.
Comment 1 Michael Rolle 2015-07-29 20:15:54 UTC
Note the objdump problem should be forwarded to the binutils component.
Comment 2 H.J. Lu 2015-07-29 22:53:11 UTC
(In reply to Michael Rolle from comment #0)
> The vcvtsi2sd instruction has the {er} decorator associated with the last
> operand.  See Intel doc:
> 
> EVEX.NDS.LIG.F2.0F.W1 2A /r
> VCVTSI2SD xmm1, xmm2, r/m64{er}

This is a notation in ISA spec, not the assembly manual.

> However, objdump produces, as an example,
> 
>     5290:	62 61 97 10 2a f0    	vcvtsi2sd xmm30,xmm29,{rn-sae},rax
> 
> Also, as requires the form
> 
> vcvtsi2sd xmm30,xmm29,{rn-sae},rax
> 

This is the form for GNU assembler.