-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compiler): Add ability to match on low level wasm types (#1588)
- Loading branch information
Showing
6 changed files
with
877 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 205 additions & 0 deletions
205
compiler/test/__snapshots__/pattern_matching.0fa61137.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
pattern matching › low_level_constant_match_2 | ||
(module | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $none_=>_none (func)) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32))) | ||
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$print\" (global $print_1134 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32))) | ||
(import \"GRAIN$MODULE$pervasives\" \"print\" (func $print_1134 (param i32 i32) (result i32))) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(local $6 i32) | ||
(local $7 i32) | ||
(local $8 i32) | ||
(local $9 i32) | ||
(return | ||
(block $cleanup_locals.26 (result i32) | ||
(local.set $0 | ||
(block $compile_block.25 (result i32) | ||
(block $compile_store.2 | ||
(local.set $6 | ||
(select | ||
(i32.const -2) | ||
(i32.const 2147483646) | ||
(i64.eq | ||
(i64.const 1) | ||
(i64.const 0) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.1 | ||
) | ||
) | ||
(block $compile_store.14 | ||
(local.set $7 | ||
(if (result i32) | ||
(i32.shr_u | ||
(local.get $6) | ||
(i32.const 31) | ||
) | ||
(block $compile_block.3 (result i32) | ||
(i32.const 1) | ||
) | ||
(block $compile_block.12 (result i32) | ||
(block $compile_store.5 | ||
(local.set $7 | ||
(select | ||
(i32.const -2) | ||
(i32.const 2147483646) | ||
(i64.eq | ||
(i64.const 1) | ||
(i64.const 1) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.4 | ||
) | ||
) | ||
(if (result i32) | ||
(i32.shr_u | ||
(local.get $7) | ||
(i32.const 31) | ||
) | ||
(block $compile_block.6 (result i32) | ||
(i32.const 3) | ||
) | ||
(block $compile_block.11 (result i32) | ||
(block $compile_store.8 | ||
(local.set $8 | ||
(select | ||
(i32.const -2) | ||
(i32.const 2147483646) | ||
(i64.eq | ||
(i64.const 1) | ||
(i64.const 2) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.7 | ||
) | ||
) | ||
(if (result i32) | ||
(i32.shr_u | ||
(local.get $8) | ||
(i32.const 31) | ||
) | ||
(block $compile_block.9 (result i32) | ||
(i32.const 5) | ||
) | ||
(block $compile_block.10 (result i32) | ||
(i32.const 7) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.13 | ||
) | ||
) | ||
(block $compile_store.22 | ||
(local.set $8 | ||
(block $switch.15_outer (result i32) | ||
(block $switch.15_branch_0 (result i32) | ||
(drop | ||
(block $switch.15_branch_1 (result i32) | ||
(drop | ||
(block $switch.15_branch_2 (result i32) | ||
(drop | ||
(block $switch.15_branch_3 (result i32) | ||
(drop | ||
(block $switch.15_branch_4 (result i32) | ||
(drop | ||
(block $switch.15_default (result i32) | ||
(br_table $switch.15_branch_1 $switch.15_branch_2 $switch.15_branch_3 $switch.15_branch_4 $switch.15_default $switch.15_default | ||
(i32.const 0) | ||
(i32.shr_s | ||
(local.get $7) | ||
(i32.const 1) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.15_outer | ||
(block $compile_block.20 (result i32) | ||
(unreachable) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.15_outer | ||
(block $compile_block.19 (result i32) | ||
(i32.const 2147483646) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.15_outer | ||
(block $compile_block.18 (result i32) | ||
(i32.const 2147483646) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.15_outer | ||
(block $compile_block.17 (result i32) | ||
(i32.const -2) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.15_outer | ||
(block $compile_block.16 (result i32) | ||
(i32.const 2147483646) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.21 | ||
) | ||
) | ||
(block $compile_store.24 | ||
(local.set $9 | ||
(call $print_1134 | ||
(call $incRef_0 | ||
(global.get $GRAIN$EXPORT$incRef_0) | ||
(global.get $print_1134) | ||
) | ||
(local.get $8) | ||
) | ||
) | ||
(block $do_backpatches.23 | ||
) | ||
) | ||
(i32.const 1) | ||
) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 258 | ||
) |
Oops, something went wrong.