intelxed / xed

The X86 Encoder Decoder (XED), is a software library for encoding and decoding X86 (IA32 and Intel64) instructions
https://intelxed.github.io/
Apache License 2.0
1.39k stars 145 forks source link

SENDUIPI operand should be GPR64 #292

Closed taylor-santos closed 1 year ago

taylor-santos commented 1 year ago

XED decodes SENDUIPI as having a 32-bit register:

$ xed -64 -d f3 0f c7 f0
F30FC7F0
ICLASS:     SENDUIPI
CATEGORY:   UINTR
EXTENSION:  UINTR
IFORM:      SENDUIPI_GPR32u32
ISA_SET:    UINTR
ATTRIBUTES:
SHORT:      senduipi eax

And it rejects encoding it with a 64-bit register:

$ xed -64 -e senduipi rax
Request: SENDUIPI EOSZ:3, MODE:2, REG0:RAX, SMODE:2
OPERAND ORDER: REG0
Could not encode: senduipi rax
Error code was: GENERAL_ERROR
[XED CLIENT ERROR] Dying

According to the Intel 64 and IA-32 Architectures Software Developer’s Manual, The operand always has 64 bits; operand-size overrides such as the prefix 66 are ignored.

Binutils agrees with the 64-bit operand size:

$ echo ".intel_syntax noprefix; senduipi rax" | as -o senduipi.o
$ objdump -d senduipi.o

senduipi.o:     file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <.text>:
   0:   f3 0f c7 f0             senduipi %rax
marjevan commented 1 year ago

Thanks for the report. A fix will be available on the next external release.