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.
25 lines
668 B
Plaintext
25 lines
668 B
Plaintext
test cat
|
|
|
|
isa riscv
|
|
|
|
; regex: WS=[ \t]*
|
|
|
|
function %foo(i32, i32) {
|
|
ebb1(v0: i32 [%x8], v1: i32):
|
|
[-,-] v2 = iadd v0, v1
|
|
[-] trap heap_oob
|
|
[R#1234, %x5, %x11] v6, v7 = iadd_cout v2, v0
|
|
[Rshamt#beef, %x25] v8 = ishl_imm v6, 2
|
|
@55 v9 = iadd v8, v7
|
|
@a5 [Iret#5] return v0, v8
|
|
}
|
|
; sameln: function %foo(i32, i32) fast {
|
|
; nextln: ebb1(v0: i32 [%x8], v1: i32):
|
|
; nextln: [-,-]$WS v2 = iadd v0, v1
|
|
; nextln: [-]$WS trap heap_oob
|
|
; nextln: [R#1234,%x5,%x11]$WS v6, v7 = iadd_cout v2, v0
|
|
; nextln: [Rshamt#beef,%x25]$WS v8 = ishl_imm v6, 2
|
|
; nextln: @0055 [-,-]$WS v9 = iadd v8, v7
|
|
; nextln: @00a5 [Iret#05]$WS return v0, v8
|
|
; nextln: }
|