Barebit / x86reference

X86 Opcode and Instruction Reference
http://ref.x86asm.net
GNU Lesser General Public License v3.0
234 stars 52 forks source link

MOVSS use wrong operand types #23

Closed Kashio closed 7 months ago

Kashio commented 1 year ago

Right now MOVSS encoded with opcode F3 0F 10 or F3 0F 11 use operand type ss for its operand of addressing W which is defined as:

Scalar element of a 128-bit packed single-precision floating data.

According to the intel docs:

Moves a scalar single-precision floating-point value from the source operand (second operand) to the destination operand (first operand). The source and destination operands can be XMM registers or 32-bit memory locations. This instruction can be used to move a single-precision floating-point value to and from the low doubleword of an XMM register and a 32-bit memory location, or to move a single-precision floating-point value between the low doublewords of two XMM registers. The instruction cannot be used to transfer data between memory locations.

Since it's only copying the lower 32 bits of the register and the memory variant is also referencing 32 bit memory the operand type should be of type d which is defined as:

Doubleword, regardless of operand-size attribute.

BarebitOpenSource commented 9 months ago

Thanks for your review. However, this is similar to #22.

The type d means 32-bit integer while MOVSS operates on scalar (32-bit) element of a 128-bit packed single-precision floating data. In both cases the size is always 32 bits but the data type differs. Also the Intel manual indicates ss in this case all the time.

BarebitOpenSource commented 7 months ago

Feel free to reopen this issue if you still think the operand type is wrong.