-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cranelift: stack-switching support #11003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
2ab6356
0853a16
858b22a
43a3972
100d621
00c2b56
e9fa92d
866fbff
115e503
11c6b4a
fa8001e
51017f2
44c2b34
b8fb8b3
a693350
eeab1b1
3bd138f
49313bc
5ccd3f7
c86b06a
ab50f6c
6797ea2
a6a3ff8
71c1e6d
ba013f9
3a26125
8d06297
cae4878
2bdfb25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,7 @@ impl ABIMachineSpec for X64ABIMachineSpec { | |
mut args: ArgsAccumulator, | ||
) -> CodegenResult<(u32, Option<usize>)> { | ||
let is_fastcall = call_conv == CallConv::WindowsFastcall; | ||
let is_tail = call_conv == CallConv::Tail; | ||
|
||
let mut next_gpr = 0; | ||
let mut next_vreg = 0; | ||
|
@@ -181,6 +182,11 @@ impl ABIMachineSpec for X64ABIMachineSpec { | |
// This is consistent with LLVM's behavior, and is needed for | ||
// some uses of Cranelift (e.g., the rustc backend). | ||
// | ||
// - Otherwise, if the calling convention is Tail, we behave as in | ||
// the previous case, even if `enable_llvm_abi_extensions` is not | ||
// set in the flags: This is a custom calling convention defined | ||
// by Cranelift, LLVM doesn't know about it. | ||
// | ||
// - Otherwise, both SysV and Fastcall specify behavior (use of | ||
// vector register, a register pair, or passing by reference | ||
// depending on the case), but for simplicity, we will just panic if | ||
|
@@ -194,6 +200,7 @@ impl ABIMachineSpec for X64ABIMachineSpec { | |
if param.value_type.bits() > 64 | ||
&& !(param.value_type.is_vector() || param.value_type.is_float()) | ||
&& !flags.enable_llvm_abi_extensions() | ||
&& !is_tail | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? Wasm doesn't have 128bit integers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least in this iteration of the changes, the stack switching code is using an i128 for it's vmcontobj fat pointer (consisting of vmcontref pointer and revision). @fitzgen and I have discussed a bit about how we can get rid of this and just have two ir values through the transformation, but it will require some additional changes to how we model the relationship between wasm and clif values to support having one of the former map to two distinct ir values. |
||
{ | ||
panic!( | ||
"i128 args/return values not supported unless LLVM ABI extensions are enabled" | ||
|
Uh oh!
There was an error while loading. Please reload this page.