Skip to content

Commit

Permalink
encode: Add standard names for CMPXCHG8B/16B
Browse files Browse the repository at this point in the history
  • Loading branch information
aengelke committed Jul 2, 2023
1 parent b94f1a1 commit 4ac9b8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions encode-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ TEST("\x99", C_SEP32, 0);
TEST("\x99", CDQ, 0);
TEST("\x48\x99", C_SEP64, 0);
TEST("\x48\x99", CQO, 0);
TEST("\x0f\xc7\x0f", CMPXCHGD32m, 0, FE_MEM(FE_DI, 0, FE_NOREG, 0));
TEST("\x0f\xc7\x0f", CMPXCHG8Bm, 0, FE_MEM(FE_DI, 0, FE_NOREG, 0));
TEST("\x48\x0f\xc7\x0f", CMPXCHGD64m, 0, FE_MEM(FE_DI, 0, FE_NOREG, 0));
TEST("\x48\x0f\xc7\x0f", CMPXCHG16Bm, 0, FE_MEM(FE_DI, 0, FE_NOREG, 0));

// Test FD/TD encodings
TEST("\xa0\x00\x00\x00\x00\x00\x00\x00\x00", MOV8ra, 0, FE_AX, 0);
Expand Down
1 change: 1 addition & 0 deletions parseinstrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ def encode_mnems(entries):
altname = {
"C_EX16": "CBW", "C_EX32": "CWDE", "C_EX64": "CDQE",
"C_SEP16": "CWD", "C_SEP32": "CDQ", "C_SEP64": "CQO",
"CMPXCHGD32m": "CMPXCHG8Bm", "CMPXCHGD64m": "CMPXCHG16Bm",
}.get(name)
if altname:
mnemonics[altname, opsize, ots].append((spec_opcode, desc))
Expand Down

0 comments on commit 4ac9b8e

Please sign in to comment.