Refactor calling convention settings. (#304)
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.
This commit is contained in:
@@ -3,7 +3,7 @@ test legalizer
|
||||
isa riscv
|
||||
|
||||
function %parse_encoding(i32 [%x5]) -> i32 [%x10] {
|
||||
; check: function %parse_encoding(i32 [%x5], i32 link [%x1]) -> i32 [%x10], i32 link [%x1] system_v {
|
||||
; check: function %parse_encoding(i32 [%x5], i32 link [%x1]) -> i32 [%x10], i32 link [%x1] fast {
|
||||
|
||||
sig0 = (i32 [%x10]) -> i32 [%x10] system_v
|
||||
; check: sig0 = (i32 [%x10]) -> i32 [%x10] system_v
|
||||
|
||||
@@ -19,8 +19,8 @@ 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) spiderwasm {
|
||||
sig0 = (i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 vmctx) spiderwasm
|
||||
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):
|
||||
|
||||
@@ -10,7 +10,7 @@ ebb0(v0: f32):
|
||||
v1 = floor v0
|
||||
return v1
|
||||
}
|
||||
; check: function %floor(f32 [%xmm0]) -> f32 [%xmm0] system_v {
|
||||
; check: sig0 = (f32) -> f32 system_v
|
||||
; check: function %floor(f32 [%xmm0]) -> f32 [%xmm0] fast {
|
||||
; check: sig0 = (f32) -> f32 fast
|
||||
; check: fn0 = %FloorF32 sig0
|
||||
; check: v1 = call fn0(v0)
|
||||
|
||||
@@ -44,7 +44,7 @@ ebb1:
|
||||
|
||||
; SpiderMonkey VM-style static 4+2 GB heap.
|
||||
; This eliminates bounds checks completely for offsets < 2GB.
|
||||
function %staticheap_sm64(i32, i64 vmctx) -> f32 spiderwasm {
|
||||
function %staticheap_sm64(i32, i64 vmctx) -> f32 baldrdash {
|
||||
gv0 = vmctx+64
|
||||
heap0 = static gv0, min 0x1000, bound 0x1_0000_0000, guard 0x8000_0000
|
||||
|
||||
@@ -65,7 +65,7 @@ ebb0(v0: i32, v999: i64):
|
||||
return v4
|
||||
}
|
||||
|
||||
function %staticheap_static_oob_sm64(i32, i64 vmctx) -> f32 spiderwasm {
|
||||
function %staticheap_static_oob_sm64(i32, i64 vmctx) -> f32 baldrdash {
|
||||
gv0 = vmctx+64
|
||||
heap0 = static gv0, min 0x1000, bound 0x1000_0000, guard 0x8000_0000
|
||||
|
||||
@@ -88,7 +88,7 @@ ebb0(v0: i32, v999: i64):
|
||||
|
||||
; SpiderMonkey VM-style static 4+2 GB heap.
|
||||
; Offsets >= 2 GB do require a boundscheck.
|
||||
function %staticheap_sm64(i32, i64 vmctx) -> f32 spiderwasm {
|
||||
function %staticheap_sm64(i32, i64 vmctx) -> f32 baldrdash {
|
||||
gv0 = vmctx+64
|
||||
heap0 = static gv0, min 0x1000, bound 0x1_0000_0000, guard 0x8000_0000
|
||||
|
||||
@@ -112,7 +112,7 @@ ebb0(v0: i32, v999: i64):
|
||||
|
||||
; Stack overflow check.
|
||||
; The stack limit is stored in a pointer-sized global variable.
|
||||
function %stkchk(i64 vmctx) spiderwasm {
|
||||
function %stkchk(i64 vmctx) baldrdash {
|
||||
gv0 = vmctx+64
|
||||
|
||||
ebb0(v0: i64):
|
||||
|
||||
@@ -11,7 +11,7 @@ ebb0:
|
||||
return
|
||||
}
|
||||
|
||||
; check: function %empty(i64 fp [%rbp]) -> i64 fp [%rbp] system_v {
|
||||
; check: function %empty(i64 fp [%rbp]) -> i64 fp [%rbp] fast {
|
||||
; nextln: ss0 = incoming_arg 16, offset -16
|
||||
; nextln:
|
||||
; nextln: ebb0(v0: i64 [%rbp]):
|
||||
@@ -29,7 +29,7 @@ ebb0:
|
||||
return
|
||||
}
|
||||
|
||||
; check: function %one_stack_slot(i64 fp [%rbp]) -> i64 fp [%rbp] system_v {
|
||||
; check: function %one_stack_slot(i64 fp [%rbp]) -> i64 fp [%rbp] fast {
|
||||
; nextln: ss0 = explicit_slot 168, offset -184
|
||||
; nextln: ss1 = incoming_arg 16, offset -16
|
||||
; nextln:
|
||||
@@ -52,9 +52,9 @@ ebb0:
|
||||
return
|
||||
}
|
||||
|
||||
; check: function %call(i64 fp [%rbp]) -> i64 fp [%rbp] system_v {
|
||||
; check: function %call(i64 fp [%rbp]) -> i64 fp [%rbp] fast {
|
||||
; nextln: ss0 = incoming_arg 16, offset -16
|
||||
; nextln: sig0 = () system_v
|
||||
; nextln: sig0 = () fast
|
||||
; nextln: fn0 = %foo sig0
|
||||
; nextln:
|
||||
; nextln: ebb0(v0: i64 [%rbp]):
|
||||
@@ -98,7 +98,7 @@ ebb0(v0: i64, v1: i64):
|
||||
return
|
||||
}
|
||||
|
||||
; check: function %no_spill(i64 [%rdi], i64 [%rsi], i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15]) -> i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15] system_v {
|
||||
; check: function %no_spill(i64 [%rdi], i64 [%rsi], i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15]) -> i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15] fast {
|
||||
; nextln: ss0 = incoming_arg 56, offset -56
|
||||
; nextln:
|
||||
; nextln: ebb0(v0: i64 [%rdi], v1: i64 [%rsi], v15: i64 [%rbp], v16: i64 [%rbx], v17: i64 [%r12], v18: i64 [%r13], v19: i64 [%r14], v20: i64 [%r15]):
|
||||
@@ -181,7 +181,7 @@ ebb0(v0: i64, v1: i64):
|
||||
return
|
||||
}
|
||||
|
||||
; check: function %yes_spill(i64 [%rdi], i64 [%rsi], i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15]) -> i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15] system_v {
|
||||
; check: function %yes_spill(i64 [%rdi], i64 [%rsi], i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15]) -> i64 fp [%rbp], i64 csr [%rbx], i64 csr [%r12], i64 csr [%r13], i64 csr [%r14], i64 csr [%r15] fast {
|
||||
; check: ss0 = spill_slot
|
||||
|
||||
; check: ebb0(v16: i64 [%rdi], v17: i64 [%rsi], v48: i64 [%rbp], v49: i64 [%rbx], v50: i64 [%r12], v51: i64 [%r13], v52: i64 [%r14], v53: i64 [%r15]):
|
||||
|
||||
Reference in New Issue
Block a user