Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/engine/Type.v3
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ component ValueTypes {
def ONE_STRUCTREF_TYPE: Array<ValueType> = [STRUCTREF];
def ONE_ARRAYREF_TYPE: Array<ValueType> = [ARRAYREF];
def ONE_CONTREF_TYPE: Array<ValueType> = [CONTREF];
def ONE_FUNCREF_TYPE: Array<ValueType> = [FUNCREF_NONNULL];

// Helper utility for a final signature type with no supertypes.
def newSig = SigDecl.new(true, NO_HEAPTYPES, _, _);
Expand Down
28 changes: 28 additions & 0 deletions src/engine/compiler/SinglePassCompiler.v3
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,9 @@ class SinglePassCompiler(xenv: SpcExecEnv, masm: MacroAssembler, regAlloc: RegAl
def visit_MEMORY_FILL(mindex: u31) {
emit_call_runtime_op1(Opcode.MEMORY_FILL, mindex, true);
}
def visit_FUNC_NEW(mem_index: u31, sig_index: u31, env_index: u31) {
emit_call_runtime_op3n(Opcode.FUNC_NEW, mem_index, sig_index, env_index, 2, ValueTypes.ONE_FUNCREF_TYPE, true);
}
def visit_TABLE_INIT(eindex: u31, tindex: u31) {
emit_call_runtime_op2(Opcode.TABLE_INIT, eindex, tindex, true);
}
Expand Down Expand Up @@ -2034,6 +2037,31 @@ class SinglePassCompiler(xenv: SpcExecEnv, masm: MacroAssembler, regAlloc: RegAl
emit_reload_regs();
if (!runtimeSpillMode.free_regs) state.emitRestoreAll(resolver);
}
def emit_call_runtime_op3n(op: Opcode, arg1: u31, arg2: u31, arg3: u31, args: u32, results: Array<ValueType>, canTrap: bool) {
state.emitSaveAll(resolver, runtimeSpillMode);
emit_compute_vsp(regs.vsp, state.sp);
emit_spill_vsp(regs.vsp);
masm.emit_store_curstack_vsp(regs.vsp);

def emit = fun {
masm.emit_get_curstack(regs.runtime_arg0);
masm.emit_v3_set_NativeStack_rsp_r_r(regs.runtime_arg0, regs.sp);
masm.emit_push_NativeStack_rsp_r_r(regs.runtime_arg0);
emit_load_instance(regs.runtime_arg1);
masm.emit_mov_r_i(regs.runtime_arg2, arg1);
masm.emit_mov_r_i(regs.runtime_arg3, arg2);
masm.emit_mov_r_i(regs.runtime_arg4, arg3);
masm.emit_call_runtime_op(op);
};
// Reconstruct stack frames across runtime calls that might (Wasm-level) trap.
if (canTrap) withReconstructedInlinedFrames(emit); else emit();
masm.emit_get_curstack(regs.scratch);
masm.emit_pop_NativeStack_rsp_r_r(regs.scratch);
dropN(args);
for (t in results) state.push(typeToKindFlags(t) | TAG_STORED | IS_STORED, NO_REG, 0);
emit_reload_regs();
if (!runtimeSpillMode.free_regs) state.emitRestoreAll(resolver);
}
def emitBrIf(sv: SpcVal, cond: MasmBrCond, label: MasmLabel, target: SpcControl, emptyTransfer: bool, repush: BrRepush) {
if (sv.isConst()) {
var taken = (sv.const == 0) == cond.zero;
Expand Down
1 change: 1 addition & 0 deletions src/engine/x86-64/X86_64MacroAssembler.v3
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ class X86_64MacroAssembler extends MacroAssembler {
MEMORY_COPY => emit_call_runtime(RT.MEMORY_COPY);
MEMORY_FILL => emit_call_runtime(RT.MEMORY_FILL);
TABLE_INIT => emit_call_runtime(RT.TABLE_INIT);
FUNC_NEW => emit_call_runtime(RT.FUNC_NEW);
TABLE_COPY => emit_call_runtime(RT.TABLE_COPY);
TABLE_GROW => emit_call_runtime(RT.TABLE_GROW);
TABLE_FILL => emit_call_runtime(RT.TABLE_FILL);
Expand Down
23 changes: 11 additions & 12 deletions src/engine/x86-64/X86_64Target.v3
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,7 @@ class X86_64SpcStrategy extends X86_64ExecutionStrategy {
if (!applyJitFilter(wf.instance.module, wf.decl, how)) return SpcResultForStub(wf, X86_64Spc.setInterpreterFallback(wf.decl), null);

var module = wf.instance.module;
// A module that was never prepared for this target has no code region yet. This
// happens for the inner module of an environment, whose functions are created at
// runtime by {func.new}; allocate a region for it on demand.
if (module.target_module.spc_code == null) {
allocateCodeForModule(module, MINIMUM_CODE_SIZE + X86_64Spc.estimateCodeSizeFor(wf.decl));
}
var code = module.target_module.spc_code;
var code = ensureCodeForModule(module, wf.decl);
var compiler = newCompiler(module.filename); // XXX: cache per-thread
var masm = X86_64MacroAssembler.!(compiler.masm), w = masm.asm.w;

Expand Down Expand Up @@ -420,7 +414,7 @@ class X86_64DynamicStrategy extends X86_64SpcStrategy {
return TargetOsrInfo(Pointer.NULL, null);
}
var label = compiler.genOsr(module, wf.decl, pc, null);
var code = module.target_module.spc_code;
var code = ensureCodeForModule(module, wf.decl);
var masm = X86_64MacroAssembler.!(compiler.masm);
var codeSize = masm.w.end();
if (label == null || !code.hasSpaceFor(codeSize)) {
Expand Down Expand Up @@ -462,19 +456,24 @@ def allocateCodeForModule(module: Module, codeSize: int) {
module.filename, (mapping.range.start - Pointer.NULL), (mapping.range.end - Pointer.NULL)).ln();
}

// Returns the code region for {module}, allocating one if necessary.
def ensureCodeForModule(module: Module, func: FuncDecl) -> X86_64SpcModuleCode {
if (module.target_module.spc_code == null) {
allocateCodeForModule(module, MINIMUM_CODE_SIZE + X86_64Spc.estimateCodeSizeFor(func));
}
return module.target_module.spc_code;
}
def applyJitFilter(module: Module, func: FuncDecl, how: string) -> bool {
var filter = CompilerOptions.JIT_FILTER.get();
if (filter == null || filter.matches(module, func)) return true;
if (Trace.compiler) Trace.OUT.put2("func[%d] %s compile suppressed by filter", func.func_index, how).ln();
return false;
}

def RDTSC_FUNC = X86_64PreGenFunc<void, u64>.new("rdtsc", null, genRdtsc);

def genRdtsc(ic: X86_64InterpreterCode, w: DataWriter) {
def RDTSC_FUNC = X86_64PreGenFunc<void, u64>.new("rdtsc", null, fun (ic: X86_64InterpreterCode, w: DataWriter) {
def asm = X86_64Assemblers.create64(w);
asm.rdtsc();
asm.q.shl_r_i(X86_64Regs.RDX, 32);
asm.q.or_r_r(X86_64Regs.RAX, X86_64Regs.RDX); // XXX: use V3 return register symbolic constant
asm.ret();
}
});
9 changes: 0 additions & 9 deletions test/regress.failures.x86-64-linux.spc
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,3 @@ test/regress/ext:legacy-eh/try_delegate1.bin.wast
test/regress/ext:legacy-eh/try_delegate3.bin.wast
test/regress/ext:legacy-eh/try_delegate4.bin.wast
test/regress/ext:legacy-eh/try_delegate5.bin.wast

test/regress/ext:jit-interface/func_new0.bin.wast
test/regress/ext:jit-interface/func_new_args.bin.wast
test/regress/ext:jit-interface/func_new_invalid_env.bin.wast
test/regress/ext:jit-interface/func_new_scope_func.bin.wast
test/regress/ext:jit-interface/func_new_scope_global.bin.wast
test/regress/ext:jit-interface/func_new_scope_memory.bin.wast
test/regress/ext:jit-interface/func_new_trap_invalid.bin.wast
test/regress/ext:jit-interface/func_new_trap_oob.bin.wast
14 changes: 14 additions & 0 deletions test/regress/ext:jit-interface/func_new_loop.bin.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(module binary
"\00\61\73\6d\01\00\00\00\01\8b\80\80\80\00\02\60"
"\01\7f\01\7f\60\01\7f\01\7f\03\82\80\80\80\00\01"
"\00\05\83\80\80\80\00\01\00\01\07\88\80\80\80\00"
"\01\04\6d\61\69\6e\00\00\0e\83\80\80\80\00\01\00"
"\00\0a\92\80\80\80\00\01\10\00\20\00\41\10\41\21"
"\fb\27\00\00\01\00\14\01\0b\0b\a7\80\80\80\00\01"
"\00\41\10\0b\21\01\01\7f\02\40\03\40\20\00\45\0d"
"\01\20\01\20\00\6a\21\01\20\00\41\01\6b\21\00\0c"
"\00\0b\0b\20\01\0b"
)
(assert_return (invoke "main" (i32.const 0)) (i32.const 0))
(assert_return (invoke "main" (i32.const 100)) (i32.const 5050))
(assert_return (invoke "main" (i32.const 100000)) (i32.const 705082704))
20 changes: 20 additions & 0 deletions test/regress/ext:jit-interface/func_new_loop.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(module
(type $ft (func (param i32) (result i32)))
(memory 1)
(data (i32.const 16) "\01\01\7f\02\40\03\40\20\00\45\0d\01\20\01\20\00\6a\21\01\20\00\41\01\6b\21\00\0c\00\0b\0b\20\01\0b")
;; (func (param $n i32) (result i32) (local $sum i32)
;; (block (loop
;; (br_if 1 (i32.eqz (local.get $n)))
;; (local.set $sum (i32.add (local.get $sum) (local.get $n)))
;; (local.set $n (i32.sub (local.get $n) (i32.const 1)))
;; (br 0)))
;; (local.get $sum))
(scope $s)
(func (export "main") (param i32) (result i32)
(call_ref $ft (local.get 0)
(func.new 0 $ft $s (i32.const 16) (i32.const 33)))
)
)
(assert_return (invoke "main" (i32.const 0)) (i32.const 0))
(assert_return (invoke "main" (i32.const 100)) (i32.const 5050))
(assert_return (invoke "main" (i32.const 100000)) (i32.const 705082704))
22 changes: 22 additions & 0 deletions test/regress/ext:jit-interface/func_new_many_args.bin.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(module binary
"\00\61\73\6d\01\00\00\00\01\a9\80\80\80\00\02\60"
"\10\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f"
"\7f\01\7f\60\10\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f\7f"
"\7f\7f\7f\7f\7f\01\7f\03\82\80\80\80\00\01\00\05"
"\83\80\80\80\00\01\00\01\07\88\80\80\80\00\01\04"
"\6d\61\69\6e\00\00\0e\83\80\80\80\00\01\00\00\0a"
"\b1\80\80\80\00\01\2f\00\20\00\20\01\20\02\20\03"
"\20\04\20\05\20\06\20\07\20\08\20\09\20\0a\20\0b"
"\20\0c\20\0d\20\0e\20\0f\41\10\41\de\00\fb\27\00"
"\00\01\00\14\01\0b\0b\e4\80\80\80\00\01\00\41\10"
"\0b\5e\00\20\00\41\1f\6c\20\01\6a\41\1f\6c\20\02"
"\6a\41\1f\6c\20\03\6a\41\1f\6c\20\04\6a\41\1f\6c"
"\20\05\6a\41\1f\6c\20\06\6a\41\1f\6c\20\07\6a\41"
"\1f\6c\20\08\6a\41\1f\6c\20\09\6a\41\1f\6c\20\0a"
"\6a\41\1f\6c\20\0b\6a\41\1f\6c\20\0c\6a\41\1f\6c"
"\20\0d\6a\41\1f\6c\20\0e\6a\41\1f\6c\20\0f\6a\0b"
)
(assert_return (invoke "main" (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0)) (i32.const 0))
(assert_return (invoke "main" (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 7)) (i32.const 7))
(assert_return (invoke "main" (i32.const 1) (i32.const 2) (i32.const 3) (i32.const 4) (i32.const 5) (i32.const 6) (i32.const 7) (i32.const 8) (i32.const 9) (i32.const 10) (i32.const 11) (i32.const 12) (i32.const 13) (i32.const 14) (i32.const 15) (i32.const 16)) (i32.const -1270509304))
(assert_return (invoke "main" (i32.const 16) (i32.const 15) (i32.const 14) (i32.const 13) (i32.const 12) (i32.const 11) (i32.const 10) (i32.const 9) (i32.const 8) (i32.const 7) (i32.const 6) (i32.const 5) (i32.const 4) (i32.const 3) (i32.const 2) (i32.const 1)) (i32.const 319397880))
17 changes: 17 additions & 0 deletions test/regress/ext:jit-interface/func_new_many_args.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(module
(type $ft (func (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result i32)))
(memory 1)
(data (i32.const 16) "\00\20\00\41\1f\6c\20\01\6a\41\1f\6c\20\02\6a\41\1f\6c\20\03\6a\41\1f\6c\20\04\6a\41\1f\6c\20\05\6a\41\1f\6c\20\06\6a\41\1f\6c\20\07\6a\41\1f\6c\20\08\6a\41\1f\6c\20\09\6a\41\1f\6c\20\0a\6a\41\1f\6c\20\0b\6a\41\1f\6c\20\0c\6a\41\1f\6c\20\0d\6a\41\1f\6c\20\0e\6a\41\1f\6c\20\0f\6a\0b")
;; (func (param $p0 i32) ... (param $p15 i32) (result i32)
;; acc = p0; acc = acc * 31 + p[i] for i in 1..15
;; ...)
(scope $s)
(func (export "main") (param i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) (result i32)
(call_ref $ft (local.get 0) (local.get 1) (local.get 2) (local.get 3) (local.get 4) (local.get 5) (local.get 6) (local.get 7) (local.get 8) (local.get 9) (local.get 10) (local.get 11) (local.get 12) (local.get 13) (local.get 14) (local.get 15)
(func.new 0 $ft $s (i32.const 16) (i32.const 94)))
)
)
(assert_return (invoke "main" (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0)) (i32.const 0))
(assert_return (invoke "main" (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i32.const 7)) (i32.const 7))
(assert_return (invoke "main" (i32.const 1) (i32.const 2) (i32.const 3) (i32.const 4) (i32.const 5) (i32.const 6) (i32.const 7) (i32.const 8) (i32.const 9) (i32.const 10) (i32.const 11) (i32.const 12) (i32.const 13) (i32.const 14) (i32.const 15) (i32.const 16)) (i32.const -1270509304))
(assert_return (invoke "main" (i32.const 16) (i32.const 15) (i32.const 14) (i32.const 13) (i32.const 12) (i32.const 11) (i32.const 10) (i32.const 9) (i32.const 8) (i32.const 7) (i32.const 6) (i32.const 5) (i32.const 4) (i32.const 3) (i32.const 2) (i32.const 1)) (i32.const 319397880))
22 changes: 22 additions & 0 deletions test/regress/ext:jit-interface/func_new_mixed_args.bin.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(module binary
"\00\61\73\6d\01\00\00\00\01\a9\80\80\80\00\02\60"
"\10\7f\7e\7d\7c\7f\7e\7d\7c\7f\7e\7d\7c\7f\7e\7d"
"\7c\01\7c\60\10\7f\7e\7d\7c\7f\7e\7d\7c\7f\7e\7d"
"\7c\7f\7e\7d\7c\01\7c\03\82\80\80\80\00\01\00\05"
"\83\80\80\80\00\01\00\01\07\88\80\80\80\00\01\04"
"\6d\61\69\6e\00\00\0e\83\80\80\80\00\01\00\00\0a"
"\b1\80\80\80\00\01\2f\00\20\00\20\01\20\02\20\03"
"\20\04\20\05\20\06\20\07\20\08\20\09\20\0a\20\0b"
"\20\0c\20\0d\20\0e\20\0f\41\10\41\fd\00\fb\27\00"
"\00\01\00\14\01\0b\0b\83\81\80\80\00\01\00\41\10"
"\0b\7d\00\20\00\b7\41\01\b7\a2\20\01\b9\41\02\b7"
"\a2\a0\20\02\bb\41\03\b7\a2\a0\20\03\41\04\b7\a2"
"\a0\20\04\b7\41\05\b7\a2\a0\20\05\b9\41\06\b7\a2"
"\a0\20\06\bb\41\07\b7\a2\a0\20\07\41\08\b7\a2\a0"
"\20\08\b7\41\09\b7\a2\a0\20\09\b9\41\0a\b7\a2\a0"
"\20\0a\bb\41\0b\b7\a2\a0\20\0b\41\0c\b7\a2\a0\20"
"\0c\b7\41\0d\b7\a2\a0\20\0d\b9\41\0e\b7\a2\a0\20"
"\0e\bb\41\0f\b7\a2\a0\20\0f\41\10\b7\a2\a0\0b"
)
(assert_return (invoke "main" (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1.1p+7))
(assert_return (invoke "main" (i32.const -1) (i64.const 1000000000000) (f32.const 0x1p-1) (f64.const -0x1p-2) (i32.const 2) (i64.const -3) (f32.const 0x1.8p+0) (f64.const 0x1.2a05f2p+33) (i32.const 0) (i64.const 0) (f32.const 0x0p+0) (f64.const 0x0p+0) (i32.const 0) (i64.const 0) (f32.const 0x0p+0) (f64.const 0x1p-3)) (f64.const 0x1.e449a94004p+40))
15 changes: 15 additions & 0 deletions test/regress/ext:jit-interface/func_new_mixed_args.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(module
(type $ft (func (param i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64) (result f64)))
(memory 1)
(data (i32.const 16) "\00\20\00\b7\41\01\b7\a2\20\01\b9\41\02\b7\a2\a0\20\02\bb\41\03\b7\a2\a0\20\03\41\04\b7\a2\a0\20\04\b7\41\05\b7\a2\a0\20\05\b9\41\06\b7\a2\a0\20\06\bb\41\07\b7\a2\a0\20\07\41\08\b7\a2\a0\20\08\b7\41\09\b7\a2\a0\20\09\b9\41\0a\b7\a2\a0\20\0a\bb\41\0b\b7\a2\a0\20\0b\41\0c\b7\a2\a0\20\0c\b7\41\0d\b7\a2\a0\20\0d\b9\41\0e\b7\a2\a0\20\0e\bb\41\0f\b7\a2\a0\20\0f\41\10\b7\a2\a0\0b")
;; (func (param i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64) (result f64)
;; sum of f64(p[i]) * (i + 1) for i in 0..15
;; ...)
(scope $s)
(func (export "main") (param i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64 i32 i64 f32 f64) (result f64)
(call_ref $ft (local.get 0) (local.get 1) (local.get 2) (local.get 3) (local.get 4) (local.get 5) (local.get 6) (local.get 7) (local.get 8) (local.get 9) (local.get 10) (local.get 11) (local.get 12) (local.get 13) (local.get 14) (local.get 15)
(func.new 0 $ft $s (i32.const 16) (i32.const 125)))
)
)
(assert_return (invoke "main" (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0) (i32.const 1) (i64.const 1) (f32.const 0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1.1p+7))
(assert_return (invoke "main" (i32.const -1) (i64.const 1000000000000) (f32.const 0x1p-1) (f64.const -0x1p-2) (i32.const 2) (i64.const -3) (f32.const 0x1.8p+0) (f64.const 0x1.2a05f2p+33) (i32.const 0) (i64.const 0) (f32.const 0x0p+0) (f64.const 0x0p+0) (i32.const 0) (i64.const 0) (f32.const 0x0p+0) (f64.const 0x1p-3)) (f64.const 0x1.e449a94004p+40))
14 changes: 14 additions & 0 deletions test/regress/ext:jit-interface/func_new_multi_result.bin.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(module binary
"\00\61\73\6d\01\00\00\00\01\97\80\80\80\00\02\60"
"\04\7f\7e\7d\7c\04\7c\7d\7e\7f\60\04\7f\7e\7d\7c"
"\04\7c\7d\7e\7f\03\82\80\80\80\00\01\00\05\83\80"
"\80\80\00\01\00\01\07\88\80\80\80\00\01\04\6d\61"
"\69\6e\00\00\0e\83\80\80\80\00\01\00\00\0a\98\80"
"\80\80\00\01\16\00\20\00\20\01\20\02\20\03\41\10"
"\41\11\fb\27\00\00\01\00\14\01\0b\0b\97\80\80\80"
"\00\01\00\41\10\0b\11\00\20\03\20\02\20\01\41\01"
"\ac\7c\20\00\41\03\6c\0b"
)
(assert_return (invoke "main" (i32.const 5) (i64.const 41) (f32.const 0x1.4p+1) (f64.const -0x1.fp+2)) (f64.const -0x1.fp+2) (f32.const 0x1.4p+1) (i64.const 42) (i32.const 15))
(assert_return (invoke "main" (i32.const -2) (i64.const -1) (f32.const -0x0p+0) (f64.const 0x1.7e43c8800759cp+996)) (f64.const 0x1.7e43c8800759cp+996) (f32.const -0x0p+0) (i64.const 0) (i32.const -6))
(assert_return (invoke "main" (i32.const 0x7fffffff) (i64.const 0x7fffffffffffffff) (f32.const 0x1p-149) (f64.const 0x1p-1074)) (f64.const 0x1p-1074) (f32.const 0x1p-149) (i64.const 0x8000000000000000) (i32.const 0x7ffffffd))
17 changes: 17 additions & 0 deletions test/regress/ext:jit-interface/func_new_multi_result.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(module
(type $ft (func (param i32 i64 f32 f64) (result f64 f32 i64 i32)))
(memory 1)
(data (i32.const 16) "\00\20\03\20\02\20\01\41\01\ac\7c\20\00\41\03\6c\0b")
;; (func (param $a i32) (param $b i64) (param $c f32) (param $d f64) (result f64 f32 i64 i32)
;; (local.get $d) (local.get $c)
;; (i64.add (local.get $b) (i64.extend_i32_s (i32.const 1)))
;; (i32.mul (local.get $a) (i32.const 3)))
(scope $s)
(func (export "main") (param i32 i64 f32 f64) (result f64 f32 i64 i32)
(call_ref $ft (local.get 0) (local.get 1) (local.get 2) (local.get 3)
(func.new 0 $ft $s (i32.const 16) (i32.const 17)))
)
)
(assert_return (invoke "main" (i32.const 5) (i64.const 41) (f32.const 0x1.4p+1) (f64.const -0x1.fp+2)) (f64.const -0x1.fp+2) (f32.const 0x1.4p+1) (i64.const 42) (i32.const 15))
(assert_return (invoke "main" (i32.const -2) (i64.const -1) (f32.const -0x0p+0) (f64.const 0x1.7e43c8800759cp+996)) (f64.const 0x1.7e43c8800759cp+996) (f32.const -0x0p+0) (i64.const 0) (i32.const -6))
(assert_return (invoke "main" (i32.const 0x7fffffff) (i64.const 0x7fffffffffffffff) (f32.const 0x1p-149) (f64.const 0x1p-1074)) (f64.const 0x1p-1074) (f32.const 0x1p-149) (i64.const 0x8000000000000000) (i32.const 0x7ffffffd))
Loading
Loading