machinst x64: add support for umulhi/smulhi;

This commit is contained in:
Benjamin Bouvier
2020-07-03 16:15:27 +02:00
parent 571061fe4c
commit eda2d143ed
4 changed files with 98 additions and 0 deletions

View File

@@ -1197,6 +1197,29 @@ fn test_x64_emit() {
"div %rdi",
));
// ========================================================
// MulHi
insns.push((
Inst::mul_hi(4, true /*signed*/, RegMem::reg(regs::rsi())),
"F7EE",
"imul %esi",
));
insns.push((
Inst::mul_hi(8, true /*signed*/, RegMem::reg(regs::r15())),
"49F7EF",
"imul %r15",
));
insns.push((
Inst::mul_hi(4, false /*signed*/, RegMem::reg(regs::r14())),
"41F7E6",
"mul %r14d",
));
insns.push((
Inst::mul_hi(8, false /*signed*/, RegMem::reg(regs::rdi())),
"48F7E7",
"mul %rdi",
));
// ========================================================
// cdq family: SignExtendRaxRdx
insns.push((Inst::sign_extend_rax_to_rdx(2), "6699", "cwd"));