www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16857] New: inline assembler reverses operands of VPEXTRW

https://issues.dlang.org/show_bug.cgi?id=16857

          Issue ID: 16857
           Summary: inline assembler reverses operands of VPEXTRW
                    instruction
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following code:

  void foo() {
    asm {
        vpextrw EBX, XMM2, 0xF;
    }
  }

Compiles to:

        C5 F9 C5 DA 0F          vpextrw EDX,XMM3,0Fh

But the 'modregrm' DA should be D3, i.e. the 'reg' and 'rm' fields are swapped.
This reversal doesn't happen with the vpextrb instruction.

--
Nov 29 2016