xed icon indicating copy to clipboard operation
xed copied to clipboard

Wrong operand typre returned by xed_decoded_inst_operand_element_type()

Open jeffli678 opened this issue 4 years ago • 1 comments

For instruction pminub xmm0, xmm (hex 660fdac1), the two operands should both be XED_OPERAND_ELEMENT_TYPE_UINT. However, XED_OPERAND_ELEMENT_TYPE_INT is returned by xed_decoded_inst_operand_element_type().

This can be confirmed by running the xed example 1 (see column ELEMTYPE):

$ ./xed-ex1 660fdac1
Attempting to decode: 66 0f da c1 
iclass PMINUB	category SSE	ISA-extension SSE2	ISA-set SSE2
instruction-length 4
operand-width 32
effective-operand-width 32
effective-address-width 32
stack-address-width 32
iform-enum-name PMINUB_XMMdq_XMMdq
iform-enum-name-dispatch (zero based) 3
iclass-max-iform-dispatch 4
Operands
#   TYPE               DETAILS        VIS  RW       OC2 BITS BYTES NELEM ELEMSZ   ELEMTYPE   REGCLASS
#   ====               =======        ===  ==       === ==== ===== ===== ======   ========   ========
0   REG0             REG0=XMM0   EXPLICIT  RW        DQ  128    16     4     32        INT        XMM
1   REG1             REG1=XMM1   EXPLICIT   R        DQ  128    16     4     32        INT        XMM
Memory Operands
  MemopBytes = 0
ATTRIBUTES: REQUIRES_ALIGNMENT 
ANY 66 PREFIX
EXCEPTION TYPE: SSE_TYPE_4
SSE
Vector length: 128 
Number of legacy prefixes: 1 
ISA SET: [SSE2]
0	CPUID BIT NAME: [SSE2]
	Leaf 0x00000001, subleaf 0x00000000, EDX[26]

jeffli678 avatar Jun 01 '20 06:06 jeffli678

The element types are missing from the older stuff (before AVX); XED generally attempts to infer type information from the oc2 thing (dq, etc) when not present. I can fix this one instruction but would have to allocate some time to add types to the all the older stuff. Thanks for reminding me.

markcharney avatar Jun 01 '20 11:06 markcharney