Skip to content

Commit

Permalink
Add tests for neg_m instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
khagankhan committed Jul 9, 2024
1 parent 3b80988 commit 3c29adb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/asm/x86-64/X86_64AssemblerTestGen.v3
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ def main(a: Array<string>) -> int {

do_cmpxchng();
do_xchng();
do_xadd();
do_xaddn();
do_xorn();
do_orn();
do_andn();
do_negn();

do_r_dq("xchg", do_r_r, asm.d.xchg_r_r, asm.q.xchg_r_r);
do_m_dq("xchg", do_m_r, asm.d.xchg_m_r, asm.q.xchg_m_r);
Expand Down Expand Up @@ -354,7 +355,7 @@ def do_xchng() {
do_m_r("xchg qword", asm.xchgq_m_r);
}

def do_xadd() {
def do_xaddn() {
regSize = 8;
do_m_r("xadd byte", asm.xaddb_m_r);
regSize = 16;
Expand Down Expand Up @@ -394,6 +395,17 @@ def do_andn() {
do_m_r("and qword", asm.andq_m_r);
}

def do_negn() {
regSize = 8;
do_m("and byte", asm.negb_m);
regSize = 16;
do_m("and word", asm.negw_m);
regSize = 32;
do_m("and dword", asm.negd_m);
regSize = 64;
do_m("and qword", asm.negq_m);
}

def do_set() {
var buf = StringBuilder.new();
for (cond in X86_64Conds.all) {
Expand Down

0 comments on commit 3c29adb

Please sign in to comment.