Hi,
During BB instrumentation, I am looking for patterns like the following:
ADDSS XMM1, MEM
MOVSS MEM, XMM1
And I basically want to make sure that:
- The XMM register being used as the destination of the first instruction is the same as the source of the second
- The MEM address being used as the second source of the first instruction is also the same as the destination of the second instruction
- If other instructions come in between these two, that they don't read from XMM1. or write to MEM.
Checking that the XMM register is the same is easy enough to do using opnd_get_reg. But making sure MEM is the same involves reserving two registers for use with drutil_insert_get_mem_addr. For my purposes, and the fact that I will be checking multiple instructions, this could potentially cause a significant performance drop.
My questions is very simple. Will simply checking the equality of opnd_t work? Instead of comparing the registers or memory addresses?
Thanks