Reproducer
section .text
global _start
_start:
vcvtps2ph [rax+rcx]{k2}, zmm2, {sae}, 10
Assembling with:
nasm -felf64 input.asm -o a.o
succeeds without an error.
NASM version:
The resulting bytes are:
GNU objdump 2.46.1 disassembles them as:
vcvtps2ph [rax+rcx*1]{bad}{k2},xmm2,0xa
The {bad} output makes me suspect that this is not a valid instruction encoding for the requested operand/decorator combination.
Relevant Intel documentation:
Intel SDM section 2.7.9 "SAE Support in EVEX" states that SAE support for arithmetic floating-point instructions applies to scalar and 512-bit vector lengths register-to-register only, by setting EVEX.b.
Therefore, a form containing a memory operand should not accept {sae} when SAE is restricted to register-to-register forms.
For comparison, my assembler rejects the same source with:
AmmAsm:5: SAE is only valid for register-to-register form
I would expect NASM to reject the source with an error indicating that {sae} is not valid for this operand combination, rather than emitting an encoding that objdump reports as {bad}.
NASM - 3.02
GNU binutils/objdump - 2.46.1
Target - ELF64 / x86-64
I may be misunderstanding some detail of the EVEX encoding, so please correct me if this particular encoding is actually architecturally valid.
Reproducer
Assembling with:
succeeds without an error.
NASM version:
The resulting bytes are:
GNU objdump 2.46.1 disassembles them as:
The
{bad}output makes me suspect that this is not a valid instruction encoding for the requested operand/decorator combination.Relevant Intel documentation:
Intel SDM section 2.7.9 "SAE Support in EVEX" states that SAE support for arithmetic floating-point instructions applies to scalar and 512-bit vector lengths register-to-register only, by setting
EVEX.b.Therefore, a form containing a memory operand should not accept
{sae}when SAE is restricted to register-to-register forms.For comparison, my assembler rejects the same source with:
I would expect NASM to reject the source with an error indicating that
{sae}is not valid for this operand combination, rather than emitting an encoding thatobjdumpreports as{bad}.NASM - 3.02
GNU binutils/objdump - 2.46.1
Target - ELF64 / x86-64
I may be misunderstanding some detail of the EVEX encoding, so please correct me if this particular encoding is actually architecturally valid.