objdump 2.46.1 prints {bad} for VCVTPS2PH encoding generated by NASM

Ammar Najafli <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <CABsEhrgbw6Hm_g3EJTYRGmtR8bBmGEx8E7M5QdiLxKC7WEYxrg@mail.gmail.com>
I am developing my own x86-64 assembler and recently implemented EVEX
`{sae}` handling.

I encountered a potentially incorrect disassembly of `VCVTPS2PH`.

The source I tested is:

```asm
section .text
global _start

_start:
vcvtps2ph [rax+rcx]{k2}, zmm2, {sae}, 10
```

NASM 3.02 accepts this instruction and produces the following bytes:

```text
62 f3 7d 1a 1d 14 08 0a
```

My assembler produces exactly the same bytes.

However, GNU objdump 2.46.1 disassembles them as:

```text
vcvtps2ph [rax+rcx*1]{bad}{k2},xmm2,0xa
```

I also tested this with an older objdump (2.40), which produces the same
`{bad}` result.

Could you please clarify whether:

1. this encoding is architecturally invalid,
2. NASM is accepting an invalid encoding, or
3. objdump's disassembler does not correctly decode this particular EVEX
form?

The relevant bytes are:

```text
62 f3 7d 1a 1d 14 08 0a
```

The Intel SDM description of `VCVTPS2PH` does not make the handling of
`{sae}` in this particular form sufficiently clear to me.

Versions:


NASM: 3.02
objdump: 2.46.1
OS: Debian 12 x86-64 (bookworm)


Thank you for any clarification.

Best regards,
Ammar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.