machinst x64: implement bsr and lower Clz;

This commit is contained in:
Benjamin Bouvier
2020-07-03 17:11:03 +02:00
parent eda2d143ed
commit ec2209665a
5 changed files with 210 additions and 39 deletions

View File

@@ -1154,6 +1154,20 @@ fn test_x64_emit() {
"imull $76543210, %esi",
));
// ========================================================
// ReadOnly_Gpr_Rm_R
insns.push((
Inst::read_only_gpr_rm_r(4, ReadOnlyGprRmROpcode::Bsr, RegMem::reg(rsi), w_rdi),
"0FBDFE",
"bsrl %esi, %edi",
));
insns.push((
Inst::read_only_gpr_rm_r(8, ReadOnlyGprRmROpcode::Bsr, RegMem::reg(r15), w_rax),
"490FBDC7",
"bsrq %r15, %rax",
));
// ========================================================
// Div
insns.push((