x64: Migrate the return and fallthrough_return lowerings to ISLE (#4518)

https://github.com/bytecodealliance/wasmtime/pull/4518
This commit is contained in:
Trevor Elliott
2022-07-25 14:28:52 -07:00
committed by GitHub
parent 89f9de7cc3
commit 9e9e043174
6 changed files with 85 additions and 21 deletions

View File

@@ -163,6 +163,11 @@ macro_rules! isle_prelude_methods {
regs.regs()[i]
}
#[inline]
fn value_regs_len(&mut self, regs: ValueRegs) -> usize {
regs.regs().len()
}
#[inline]
fn u8_as_u32(&mut self, x: u8) -> Option<u32> {
Some(x.into())
@@ -736,6 +741,14 @@ macro_rules! isle_prelude_methods {
}
}
fn range_singleton(&mut self, r: Range) -> Option<usize> {
if r.0 + 1 == r.1 {
Some(r.0)
} else {
None
}
}
fn range_unwrap(&mut self, r: Range) -> Option<(usize, Range)> {
if r.0 < r.1 {
Some((r.0, (r.0 + 1, r.1)))
@@ -752,6 +765,10 @@ macro_rules! isle_prelude_methods {
regs.only_reg()
}
fn writable_regs_get(&mut self, regs: WritableValueRegs, idx: usize) -> WritableReg {
regs.regs()[idx]
}
fn abi_copy_to_arg_order(&mut self, abi: &ABISig, idx: usize) -> usize {
abi.copy_to_arg_order(idx)
}