Implement a Windows Baldrdash calling convention;

This commit is contained in:
Benjamin Bouvier
2019-08-14 10:39:18 +02:00
parent d8d3602257
commit 2ee35b7ea1
21 changed files with 92 additions and 55 deletions

View File

@@ -18,8 +18,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) 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
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_system_v {
sig0 = (i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 vmctx) baldrdash_system_v
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):

View File

@@ -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 baldrdash {
function %staticheap_sm64(i32, i64 vmctx) -> f32 baldrdash_system_v {
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 64
heap0 = static gv1, min 0x1000, bound 0x1_0000_0000, offset_guard 0x8000_0000
@@ -65,7 +65,7 @@ ebb0(v0: i32, v999: i64):
return v4
}
function %staticheap_static_oob_sm64(i32, i64 vmctx) -> f32 baldrdash {
function %staticheap_static_oob_sm64(i32, i64 vmctx) -> f32 baldrdash_system_v {
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 64
heap0 = static gv1, min 0x1000, bound 0x1000_0000, offset_guard 0x8000_0000
@@ -89,7 +89,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 baldrdash {
function %staticheap_sm64(i32, i64 vmctx) -> f32 baldrdash_system_v {
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 64
heap0 = static gv1, min 0x1000, bound 0x1_0000_0000, offset_guard 0x8000_0000

View File

@@ -3,15 +3,15 @@ set enable_simd=true
set probestack_enabled=false
target x86_64 haswell
; use baldrdash calling convention here for simplicity (avoids prologue, epilogue)
function %test_splat_i32() -> i32x4 baldrdash {
; use baldrdash_system_v calling convention here for simplicity (avoids prologue, epilogue)
function %test_splat_i32() -> i32x4 baldrdash_system_v {
ebb0:
v0 = iconst.i32 42
v1 = splat.i32x4 v0
return v1
}
; sameln: function %test_splat_i32() -> i32x4 [%xmm0] baldrdash {
; sameln: function %test_splat_i32() -> i32x4 [%xmm0] baldrdash_system_v {
; nextln: ss0 = incoming_arg 0, offset 0
; nextln:
; nextln: ebb0:
@@ -23,7 +23,7 @@ ebb0:
function %test_splat_i64() -> i64x2 baldrdash {
function %test_splat_i64() -> i64x2 baldrdash_system_v {
ebb0:
v0 = iconst.i64 42
v1 = splat.i64x2 v0
@@ -38,7 +38,7 @@ ebb0:
function %test_splat_b16() -> b16x8 baldrdash {
function %test_splat_b16() -> b16x8 baldrdash_system_v {
ebb0:
v0 = bconst.b16 true
v1 = splat.b16x8 v0
@@ -56,7 +56,7 @@ ebb0:
function %test_splat_i8() -> i8x16 baldrdash {
function %test_splat_i8() -> i8x16 baldrdash_system_v {
ebb0:
v0 = iconst.i8 42
v1 = splat.i8x16 v0

View File

@@ -10,7 +10,7 @@ target x86_64 haswell
; particular, the first block has to be non-empty but its encoding size must be
; zero (i.e. not generate any code). See also issue #666 for more details.
function u0:2691(i32 [%rdi], i32 [%rsi], i64 vmctx [%r14]) -> i64 uext [%rax] baldrdash {
function u0:2691(i32 [%rdi], i32 [%rsi], i64 vmctx [%r14]) -> i64 uext [%rax] baldrdash_system_v {
ss0 = incoming_arg 24, offset -24
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 48

View File

@@ -7,7 +7,7 @@ target x86_64
; regex: V=v\d+
; regex: EBB=ebb\d+
function u0:0(i64 vmctx) baldrdash {
function u0:0(i64 vmctx) baldrdash_system_v {
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 48
jt0 = jump_table [ebb2, ebb2, ebb7]

View File

@@ -10,13 +10,13 @@ ebb1:
; nextln: return
; nextln: }
function %r1() -> i32, f32 baldrdash {
function %r1() -> i32, f32 baldrdash_system_v {
ebb1:
v1 = iconst.i32 3
v2 = f32const 0.0
return v1, v2
}
; sameln: function %r1() -> i32, f32 baldrdash {
; sameln: function %r1() -> i32, f32 baldrdash_system_v {
; nextln: ebb1:
; nextln: v1 = iconst.i32 3
; nextln: v2 = f32const 0.0
@@ -25,13 +25,13 @@ ebb1:
function %signatures() {
sig10 = ()
sig11 = (i32, f64) -> i32, b1 baldrdash
sig11 = (i32, f64) -> i32, b1 baldrdash_system_v
fn5 = %foo sig11
fn8 = %bar(i32) -> b1
}
; sameln: function %signatures() fast {
; check: sig10 = () fast
; check: sig11 = (i32, f64) -> i32, b1 baldrdash
; check: sig11 = (i32, f64) -> i32, b1 baldrdash_system_v
; check: sig12 = (i32) -> b1 fast
; not: fn0
; check: fn5 = %foo sig11

View File

@@ -1,7 +1,7 @@
test regalloc
target x86_64 haswell
function %value_aliases(i32, f32, i64 vmctx) baldrdash {
function %value_aliases(i32, f32, i64 vmctx) baldrdash_system_v {
gv0 = vmctx
heap0 = static gv0, min 0x0001_0000, bound 0x0001_0000_0000, offset_guard 0x8000_0000

View File

@@ -1,7 +1,7 @@
test regalloc
target x86_64 haswell
function u0:9(i64 [%rdi], f32 [%xmm0], f64 [%xmm1], i32 [%rsi], i32 [%rdx], i64 vmctx [%r14]) -> i64 [%rax] baldrdash {
function u0:9(i64 [%rdi], f32 [%xmm0], f64 [%xmm1], i32 [%rsi], i32 [%rdx], i64 vmctx [%r14]) -> i64 [%rax] baldrdash_system_v {
ebb0(v0: i64, v1: f32, v2: f64, v3: i32, v4: i32, v5: i64):
v32 = iconst.i32 0
v6 = bitcast.f32 v32
@@ -121,10 +121,10 @@ ebb1(v31: i64):
return v31
}
function u0:26(i64 vmctx [%r14]) -> i64 [%rax] baldrdash {
function u0:26(i64 vmctx [%r14]) -> i64 [%rax] baldrdash_system_v {
gv1 = vmctx
gv0 = iadd_imm.i64 gv1, 48
sig0 = (i32 [%rdi], i64 [%rsi], i64 vmctx [%r14], i64 sigid [%rbx]) -> i64 [%rax] baldrdash
sig0 = (i32 [%rdi], i64 [%rsi], i64 vmctx [%r14], i64 sigid [%rbx]) -> i64 [%rax] baldrdash_system_v
ebb0(v0: i64):
v1 = iconst.i32 32

View File

@@ -6,7 +6,7 @@ target x86_64 haswell
; This function contains unreachable blocks which trip up the register
; allocator if they don't get cleared out.
function %unreachable_blocks(i64 vmctx) -> i32 baldrdash {
function %unreachable_blocks(i64 vmctx) -> i32 baldrdash_system_v {
ebb0(v0: i64):
v1 = iconst.i32 0
v2 = iconst.i32 0