x64: Implement ineg and bnot

This commit is contained in:
bjorn3
2020-08-22 10:41:29 +02:00
committed by Benjamin Bouvier
parent f1fdd5764a
commit 74642b166f
5 changed files with 166 additions and 25 deletions

View File

@@ -1242,6 +1242,52 @@ fn test_x64_emit() {
"bsrq %r15, %rax",
));
// ========================================================
// Not
insns.push((
Inst::not(4, Writable::from_reg(regs::rsi())),
"F7D6",
"notl %esi",
));
insns.push((
Inst::not(8, Writable::from_reg(regs::r15())),
"49F7D7",
"notq %r15",
));
insns.push((
Inst::not(4, Writable::from_reg(regs::r14())),
"41F7D6",
"notl %r14d",
));
insns.push((
Inst::not(2, Writable::from_reg(regs::rdi())),
"66F7D7",
"notw %di",
));
// ========================================================
// Neg
insns.push((
Inst::neg(4, Writable::from_reg(regs::rsi())),
"F7DE",
"negl %esi",
));
insns.push((
Inst::neg(8, Writable::from_reg(regs::r15())),
"49F7DF",
"negq %r15",
));
insns.push((
Inst::neg(4, Writable::from_reg(regs::r14())),
"41F7DE",
"negl %r14d",
));
insns.push((
Inst::neg(2, Writable::from_reg(regs::rdi())),
"66F7DF",
"negw %di",
));
// ========================================================
// Div
insns.push((