cranelift: Fix icmp.i128 eq for aarch64 (#4706)

* cranelift: Fix `icmp.i128 eq` for aarch64

* cranelift: Use ccmp in `icmp.i128 eq` for aarch64
This commit is contained in:
Afonso Bordado
2022-08-15 19:11:22 +01:00
committed by GitHub
parent e577a76c0d
commit 863cbc345c
7 changed files with 86 additions and 28 deletions

View File

@@ -674,6 +674,10 @@ fn aarch64_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, collector: &mut Operan
&Inst::CSet { rd, .. } | &Inst::CSetm { rd, .. } => {
collector.reg_def(rd);
}
&Inst::CCmp { rn, rm, .. } => {
collector.reg_use(rn);
collector.reg_use(rm);
}
&Inst::CCmpImm { rn, .. } => {
collector.reg_use(rn);
}
@@ -1531,6 +1535,19 @@ impl Inst {
let cond = cond.pretty_print(0, allocs);
format!("csetm {}, {}", rd, cond)
}
&Inst::CCmp {
size,
rn,
rm,
nzcv,
cond,
} => {
let rn = pretty_print_ireg(rn, size, allocs);
let rm = pretty_print_ireg(rm, size, allocs);
let nzcv = nzcv.pretty_print(0, allocs);
let cond = cond.pretty_print(0, allocs);
format!("ccmp {}, {}, {}, {}", rn, rm, nzcv, cond)
}
&Inst::CCmpImm {
size,
rn,