Add a calling-convention setting to the `Flags` used as part of the `TargetIsa`. This allows Cretonne code that generates calls to use the correct convention, such as when emitting libcalls during legalization or when the wasm frontend is decoding functions. This setting can be overridden per-function. This also adds "fast", "cold", and "fastcall" conventions, with "fast" as the new default. Note that "fast" and "cold" are not intended to be ABI-compatible across Cretonne versions. This will also ensure Windows users will get an `unimplemented!` rather than silent calling-convention mismatches, which reflects the fact that Windows calling conventions are not yet implemented. This also renames SpiderWASM, which isn't camel-case, to Baldrdash, which is, and which is also a more relevant name.
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
; Test the legalization of function signatures.
|
|
test legalizer
|
|
set is_64bit
|
|
isa x86
|
|
|
|
; regex: V=v\d+
|
|
|
|
function %f() {
|
|
sig0 = (i32) -> i32 system_v
|
|
; check: sig0 = (i32 [%rdi]) -> i32 [%rax] system_v
|
|
|
|
sig1 = (i64) -> b1 system_v
|
|
; check: sig1 = (i64 [%rdi]) -> b1 [%rax] system_v
|
|
|
|
sig2 = (f32, i64) -> f64 system_v
|
|
; check: sig2 = (f32 [%xmm0], i64 [%rdi]) -> f64 [%xmm0] system_v
|
|
|
|
ebb0:
|
|
return
|
|
}
|
|
|
|
function %pass_stack_int64(i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 vmctx) baldrdash {
|
|
sig0 = (i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 vmctx) baldrdash
|
|
fn0 = u0:0 sig0
|
|
|
|
ebb0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i64, v8: i64, v9: i64, v10: i64, v11: i64, v12: i64, v13: i64, v14: i64, v15: i64, v16: i64, v17: i64, v18: i64, v19: i64, v20: i64):
|
|
call fn0(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20)
|
|
jump ebb1
|
|
|
|
ebb1:
|
|
return
|
|
}
|