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.38k stars 146 forks source link

xed_enc_vfmadd231ps_y_y_y_256 encodes as xed_enc_vfmadd231pd_y_y_y_256 #309

Closed eric-lemurian closed 5 months ago

eric-lemurian commented 7 months ago

when disassembling generated code using xed_enc_vfmadd231ps_y_y_y_256 in gdb, shows vfmadd231pd, and the results are consistent with a double operation.

if I cut and paste the body of xed_enc_vfmadd231ps_y_y_y_256 and set r->s.rexw to zero before calling emit_vex_cr4, it both generates the correct opcode from gdb's perspective and produces the expected result

found a similar issue with xed_enc_vpbroadcastd_y_r32_256_e, it gets encoded as vpbroadcastq

kkhalail commented 6 months ago

Hi Eric, I just tested it out and it doesn't seem to be a problem. Did you make sure that the enc2 structure was properly initialized? Because rexw isn't explicitly set in xed_enc_vfmadd231ps_y_y_y_256 and neither in any of the sub-enc functions (e.g. enc_modrm_rm_ymm). Feel free to provide more information.

kkhalail commented 5 months ago

Couldn't duplicate the issue