Skip to content

Incorrect encoding of vmovddup xmm16, [rax+64] #185

@herumi

Description

@herumi

When assembling vmovddup xmm16, [rax+64] with NASM version 3.01 (and version 3.01rc9), the output encoding is 62E1FF08124004.
However, when this byte sequence is disassembled with Intel XED, it is decoded as vmovddup xmm16, qword ptr [rax+0x20].

The correct encoding should be 62E1FF08124008.
This instruction was encoded correctly with nasm2.

Reproduction

; test.asm
vmovddup xmm16, [rax+64]

Assembling with nasm3:

% nasm3 -l test.lst -f elf64 test.asm
% cat test.lst
     1 00000000 62E1FF08124004          vmovddup xmm16, [rax+64]

Disassembling with Intel XED:

% xed -64 -d 62E1FF08124004
62E1FF08124004
ICLASS:     VMOVDDUP
CATEGORY:   DATAXFER
EXTENSION:  AVX512EVEX
IFORM:      VMOVDDUP_XMMf64_MASKmskw_MEMf64_AVX512
ISA_SET:    AVX512F_128
ATTRIBUTES: DISP8_MOVDDUP MASKOP_EVEX
SHORT:      vmovddup xmm16, qword ptr [rax+0x20]

This suggests that the displacement (disp8) is incorrectly encoded in NASM 3.01 for this instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions