Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fixing `pshufb` insn #726
And if we compare a previous implementation with a new one, a difference
Also, the previous implementation didn't check a memory boundary in case of 128-bit operands.
It is hard for me to prove to myself, that your pseudocode adequately represents the instruction semantics. Mostly since the instruction itself is very complex. Since I've already found without going very deep a few bugs in your implementation, I would expect that there should be more.
So, we need a test that will check that our implementation is fine. Please, write a unit test (in lib_test) that uses
Stmt.eval to evaluate the expressions and check that the results matches the expected output. Use rappel to find out what output is expected. In the comments to the tests, please provide the rappel session, so that it can be reproduced.
The tests are excellent (now I started to understand myself how this instruction works). The pseudocode is fine (I don't think it is really possible to make it more readable, given the complexity of the instruction).
There is only one issue, we can't add the tests to the bap-std suite, as x86 is not a part of the bap-std. So, please move it to a separate test suite. You can use
oasis/dwarf along with the
lib_test/bap_dwarf for the inspiration.