Barebit / x86reference

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

SQRTSD use wrong operand types #38

Closed Kashio closed 7 months ago

Kashio commented 1 year ago

Right now SQRTSD encoded with opcode F2 0F 51 use operand type sd for its operand of addressing W which is defined as:

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

According to the intel docs:

Computes the square root of the low double-precision floating-point value in the second source operand and stores the double-precision floating-point result in the destination operand. The second source operand can be an XMM register or a 64-bit memory location. The first source and destination operands are XMM registers.

Since it's only operate on the lower 64 bits of the register and the memory variant is also referencing 64 bit memory the operand type should be of type q which is defined as:

Quadword, regardless of operand-size attribute (for example, CALL (FF /2)).

BarebitOpenSource commented 9 months ago

This one looks right. Refer to #22.

BarebitOpenSource commented 7 months ago

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