Skip to content

Decoded SQRTSS xmm1, xmm2 appears to read from xmm1 #542

@McSinyx

Description

@McSinyx

Reproduced with this disasm-sqrtss.c:

#include <assert.h>
#include <stdio.h>
#include <Zydis/Zydis.h>

int main(void)
{
    const ZyanU8 data[] = {0xF3, 0x0F, 0x51, 0xCA};

    ZydisDisassembledInstruction instruction;
    assert(ZYAN_SUCCESS(ZydisDisassembleIntel(ZYDIS_MACHINE_MODE_LONG_64,
                                              0,
                                              data,
                                              sizeof(data),
                                              &instruction)));
    printf("%s\n", instruction.text);
    printf("first operand action read: %d\n",
           instruction.operands[0].actions & ZYDIS_OPERAND_ACTION_READ);

    return 0;
}
$ gcc -lZydis disasm-sqrtss.c 
$ ./a.out 
sqrtss xmm1, xmm2
first operand action read: 1

From the x86 manual, vol. 2B 4-665 (page 1891), xmm1 should be write-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions