Skip to content

Commit

Permalink
Review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfallin committed Aug 1, 2022
1 parent 480515e commit 7573544
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
17 changes: 17 additions & 0 deletions cranelift/codegen/src/ir/extfunc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,21 @@ mod tests {
assert_eq!(Ok(cc), cc.to_string().parse())
}
}

#[test]
fn signatures() {
let mut sig = Signature::new(CallConv::WindowsFastcall);
assert_eq!(sig.to_string(), "() fastcall");
sig.params.push(AbiParam::new(I32));
assert_eq!(sig.to_string(), "(i32) fastcall");
sig.returns.push(AbiParam::new(F32));
assert_eq!(sig.to_string(), "(i32) -> f32 fastcall");
sig.params.push(AbiParam::new(I32.by(4).unwrap()));
assert_eq!(sig.to_string(), "(i32, i32x4) -> f32 fastcall");
sig.returns.push(AbiParam::new(B8));
assert_eq!(
sig.to_string(),
"(i32, i32x4) -> f32, b8 fastcall"
);
}
}
6 changes: 6 additions & 0 deletions cranelift/codegen/src/machinst/abi_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
//!
//! (low address)
//! ```
//!
//! # Multi-value Returns
//!
//! We support multi-value returns by using multiple return-value
//! registers. In some cases this is an extension of the base system
//! ABI. See each platform's `abi.rs` implementation for details.
use super::abi::*;
use crate::binemit::StackMap;
Expand Down
5 changes: 4 additions & 1 deletion cranelift/docs/ir.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ retlist : paramlist
param : type [paramext] [paramspecial]
paramext : "uext" | "sext"
paramspecial : "sret" | "link" | "fp" | "csr" | "vmctx" | "sigid" | "stack_limit"
callconv : "fast" | "cold" | "system_v" | "fastcall"
callconv : "fast" | "cold" | "system_v" | "windows_fastcall"
| "wasmtime_system_v" | "wasmtime_fastcall"
| "apple_aarch64" | "wasmtime_apple_aarch64"
| "probestack"
```
A function's calling convention determines exactly how arguments and return
Expand Down
10 changes: 0 additions & 10 deletions cranelift/wasm/wasmtests/use_fallthrough_return.wat

This file was deleted.

0 comments on commit 7573544

Please sign in to comment.