diff --git a/src/builtins.ts b/src/builtins.ts index a31fed61b9..3aaf8da430 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -143,6 +143,8 @@ export namespace BuiltinNames { export const isManaged = "~lib/builtins/isManaged"; export const isVoid = "~lib/builtins/isVoid"; + export const bswap = "~lib/builtins/bswap"; + export const add = "~lib/builtins/add"; export const sub = "~lib/builtins/sub"; export const mul = "~lib/builtins/mul"; @@ -1144,6 +1146,187 @@ function builtin_idof(ctx: BuiltinContext): ExpressionRef { } builtins.set(BuiltinNames.idof, builtin_idof); +// bswap(value: T) -> T +function builtin_bswap(ctx: BuiltinContext): ExpressionRef { + var compiler = ctx.compiler; + var module = compiler.module; + if ( + checkTypeOptional(ctx, true) | + checkArgsRequired(ctx, 1) + ) return module.unreachable(); + + var typeArguments = ctx.typeArguments; + var arg0 = typeArguments + ? compiler.compileExpression( + ctx.operands[0], + typeArguments[0].toUnsigned(), + Constraints.CONV_IMPLICIT | Constraints.MUST_WRAP + ) + : compiler.compileExpression( + ctx.operands[0], + Type.u32, + Constraints.MUST_WRAP + ); + + var type = compiler.currentType; + if (type.isValue) { + switch (type.kind) { + case TypeKind.BOOL: + case TypeKind.I8: + case TypeKind.U8: return arg0; + case TypeKind.I16: + case TypeKind.U16: { + // (x << 8 | x >> 8) + let flow = compiler.currentFlow; + let temp = flow.getTempLocal(type); + flow.setLocalFlag(temp.index, LocalFlags.WRAPPED); + + let res = module.binary( + BinaryOp.OrI32, + module.binary( + BinaryOp.ShlI32, + module.local_tee(temp.index, arg0, false), + module.i32(8) + ), + module.binary( + BinaryOp.ShrU32, + module.local_get(temp.index, TypeRef.I32), + module.i32(8) + ) + ); + // avoid wrapping for u16 due to it's already done for input arg + if (type.kind == TypeKind.I16) { + res = compiler.ensureSmallIntegerWrap(res, Type.i16); + } + flow.freeTempLocal(temp); + return res; + } + case TypeKind.I32: + case TypeKind.U32: + case TypeKind.ISIZE: + case TypeKind.USIZE: { + if (type.size == 32) { + // rotl(x & 0xFF00FF00, 8) | rotr(x & 0x00FF00FF, 8) + let flow = compiler.currentFlow; + let temp = flow.getTempLocal(type); + flow.setLocalFlag(temp.index, LocalFlags.WRAPPED); + + let res = module.binary( + BinaryOp.OrI32, + module.binary( + BinaryOp.RotlI32, + module.binary( + BinaryOp.AndI32, + module.local_tee(temp.index, arg0, false), + module.i32(0xFF00FF00) + ), + module.i32(8) + ), + module.binary( + BinaryOp.RotrI32, + module.binary( + BinaryOp.AndI32, + module.local_get(temp.index, TypeRef.I32), + module.i32(0x00FF00FF) + ), + module.i32(8) + ), + ); + flow.freeTempLocal(temp); + return res; + } + // fall-through + } + case TypeKind.I64: + case TypeKind.U64: { + // let t = + // ((x >>> 8) & 0x00FF00FF00FF00FF) | + // ((x & 0x00FF00FF00FF00FF) << 8) + // + // let res = + // ((t >>> 16) & 0x0000FFFF0000FFFF) | + // ((t & 0x0000FFFF0000FFFF) << 16) + // + // rotr(res, 32) + + let flow = compiler.currentFlow; + let temp1 = flow.getTempLocal(type); + flow.setLocalFlag(temp1.index, LocalFlags.WRAPPED); + let temp2 = flow.getTempLocal(type); + flow.setLocalFlag(temp2.index, LocalFlags.WRAPPED); + + // t = ((x >>> 8) & 0x00FF00FF00FF00FF) | ((x & 0x00FF00FF00FF00FF) << 8) + let expr = module.local_tee( + temp2.index, + module.binary( + BinaryOp.OrI64, + module.binary( + BinaryOp.AndI64, + module.binary( + BinaryOp.ShrU64, + module.local_tee(temp1.index, arg0, false), + module.i64(8) + ), + module.i64(0x00FF00FF, 0x00FF00FF) + ), + module.binary( + BinaryOp.ShlI64, + module.binary( + BinaryOp.AndI64, + module.local_get(temp1.index, TypeRef.I64), + module.i64(0x00FF00FF, 0x00FF00FF) + ), + module.i64(8) + ), + ), + false + ); + + // ((t >>> 16) & 0x0000FFFF0000FFFF) | ((t & 0x0000FFFF0000FFFF) << 16) + let res = module.binary( + BinaryOp.OrI64, + module.binary( + BinaryOp.AndI64, + module.binary( + BinaryOp.ShrU64, + expr, + module.i64(16) + ), + module.i64(0x0000FFFF, 0x0000FFFF) + ), + module.binary( + BinaryOp.ShlI64, + module.binary( + BinaryOp.AndI64, + module.local_get(temp2.index, TypeRef.I64), + module.i64(0x0000FFFF, 0x0000FFFF) + ), + module.i64(16) + ), + ); + + // rotr(res, 32) + res = module.binary( + BinaryOp.RotrI64, + res, + module.i64(32) + ); + + flow.freeTempLocal(temp2); + flow.freeTempLocal(temp1); + + return res; + } + } + } + compiler.error( + DiagnosticCode.Operation_0_cannot_be_applied_to_type_1, + ctx.reportNode.typeArgumentsRange, "bswap", type.toString() + ); + return module.unreachable(); +} +builtins.set(BuiltinNames.bswap, builtin_bswap); + // === Math =================================================================================== // clz(value: T) -> T diff --git a/src/types.ts b/src/types.ts index 2d683ff38f..0b91214bec 100644 --- a/src/types.ts +++ b/src/types.ts @@ -367,6 +367,18 @@ export class Type { return nullableType; } + /** Use unsigned type for according size if possible. */ + toUnsigned(): Type { + switch (this.kind) { + case TypeKind.I8: return Type.u8; + case TypeKind.I16: return Type.u16; + case TypeKind.I32: return Type.u32; + case TypeKind.I64: return Type.u64; + case TypeKind.ISIZE: return this.size == 64 ? Type.usize64 : Type.usize32; + } + return this; + } + /** Tests if this type equals the specified. */ equals(other: Type): bool { if (this.kind != other.kind) return false; diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts index 6f27011722..3dcb4d1bd3 100644 --- a/std/assembly/builtins.ts +++ b/std/assembly/builtins.ts @@ -64,6 +64,10 @@ export declare function isVoid(): bool; @builtin export declare function lengthof(func?: T): i32; +// @ts-ignore +@builtin +export declare function bswap(value: T): T; + // @ts-ignore: decorator @builtin export declare function clz(value: T): T; diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 69996d0cdf..243e6c8229 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -107,6 +107,8 @@ declare const ASC_VERSION_PATCH: i32; // Builtins +/** Performs the sign-agnostic reverse bytes **/ +declare function bswap(value: T): T; /** Performs the sign-agnostic count leading zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered leading if the value is zero. */ declare function clz(value: T): T; /** Performs the sign-agnostic count tailing zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered trailing if the value is zero. */ @@ -1470,13 +1472,6 @@ declare function WARNING(message?: any): void; /** Emits a user-defined diagnostic info when encountered. */ declare function INFO(message?: any): void; -// Polyfills - -/** Performs the sign-agnostic reverse bytes **/ -declare function bswap(value: T): T; -/** Performs the sign-agnostic reverse bytes only for last 16-bit **/ -declare function bswap16(value: T): T; - // Standard library /** Memory operations. */ diff --git a/std/assembly/polyfills.ts b/std/assembly/polyfills.ts deleted file mode 100644 index 3a4295caa2..0000000000 --- a/std/assembly/polyfills.ts +++ /dev/null @@ -1,46 +0,0 @@ -export function bswap(value: T): T { - if (isInteger()) { - if (sizeof() == 1) { - return value; - } - if (sizeof() == 2) { - return (value << 8 | (value >> 8)); - } - if (sizeof() == 4) { - return ( - rotl(value & 0xFF00FF00, 8) | - rotr(value & 0x00FF00FF, 8) - ); - } - if (sizeof() == 8) { - let a = (value >> 8) & 0x00FF00FF00FF00FF; - let b = (value & 0x00FF00FF00FF00FF) << 8; - let v = a | b; - - a = (v >>> 16) & 0x0000FFFF0000FFFF; - b = (v & 0x0000FFFF0000FFFF) << 16; - - return rotr(a | b, 32); - } - } - ERROR("Unsupported generic type"); -} - -export function bswap16(value: T): T { - if (isInteger()) { - if (sizeof() == 1) { - return value; - } - if (sizeof() == 2) { - return (value << 8 | (value >> 8)); - } - if (sizeof() == 4) { - return ( - (((value & 0xFF) << 8)) | - ((value >> 8) & 0xFF) | - (value & 0xFFFF0000) - ); - } - } - ERROR("Unsupported generic type"); -} diff --git a/std/portable/index.d.ts b/std/portable/index.d.ts index fb21ba21b3..ca6701baa4 100644 --- a/std/portable/index.d.ts +++ b/std/portable/index.d.ts @@ -52,6 +52,8 @@ declare const ASC_FEATURE_SIGN_EXTENSION: bool; // Builtins +/** Performs the sign-agnostic reverse bytes **/ +declare function bswap(value: T): T; /** Performs the sign-agnostic count leading zero bits operation on a 32-bit integer. All zero bits are considered leading if the value is zero. */ declare function clz(value: T): T; /** Performs the sign-agnostic count tailing zero bits operation on a 32-bit integer. All zero bits are considered trailing if the value is zero. */ @@ -295,13 +297,6 @@ declare namespace f64 { export function parseInt(string: string, radix?: i32): f64; } -// Polyfills - -/** [Polyfill] Performs the sign-agnostic reverse bytes **/ -declare function bswap(value: T): T; -/** [Polyfill] Performs the sign-agnostic reverse bytes only for last 16-bit **/ -declare function bswap16(value: T): T; - // Standard library declare const Mathf: typeof Math; diff --git a/std/portable/index.js b/std/portable/index.js index 347b8331c8..e156f7b0dd 100644 --- a/std/portable/index.js +++ b/std/portable/index.js @@ -165,10 +165,6 @@ if (typeof globalScope.ASC_TARGET === "undefined") { return a | b; }; - globalScope["bswap16"] = function bswap16(value) { - return ((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF) | (value & 0xFFFF0000); - }; - function UnreachableError() { if (Error.captureStackTrace) { Error.captureStackTrace(this, UnreachableError); diff --git a/tests/compiler/builtins.debug.wat b/tests/compiler/builtins.debug.wat index cce4522155..5db3749938 100644 --- a/tests/compiler/builtins.debug.wat +++ b/tests/compiler/builtins.debug.wat @@ -3788,6 +3788,162 @@ call $~lib/builtins/abort unreachable end + i32.const 170 + i32.const 170 + i32.eq + drop + i32.const 170 + i32.extend8_s + i32.const 255 + i32.and + i32.const 170 + i32.eq + drop + i32.const 43707 + local.tee $8 + i32.const 8 + i32.shl + local.get $8 + i32.const 8 + i32.shr_u + i32.or + i32.const 65535 + i32.and + i32.const 48042 + i32.eq + drop + i32.const 43707 + i32.extend16_s + i32.const 65535 + i32.and + local.tee $8 + i32.const 8 + i32.shl + local.get $8 + i32.const 8 + i32.shr_u + i32.or + i32.const 65535 + i32.and + i32.const 48042 + i32.eq + drop + i32.const -1430532899 + local.tee $8 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $8 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + i32.const -573785174 + i32.eq + drop + i32.const -1430532899 + local.tee $8 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $8 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + i32.const -573785174 + i32.eq + drop + i64.const 4822679907192029 + local.tee $2 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $2 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $3 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $3 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr + i64.const -2464388556401798912 + i64.eq + drop + i64.const 4822679907192029 + local.tee $2 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $2 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $3 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $3 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr + i64.const -2464388556401798912 + i64.eq + drop + i32.const -1430532899 + local.tee $8 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $8 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + i32.const -573785174 + i32.eq + drop + i32.const -1430532899 + local.tee $8 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $8 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + i32.const -573785174 + i32.eq + drop global.get $~lib/memory/__stack_pointer i32.const 12 i32.add diff --git a/tests/compiler/builtins.ts b/tests/compiler/builtins.ts index b6411a427a..cec9c45f64 100644 --- a/tests/compiler/builtins.ts +++ b/tests/compiler/builtins.ts @@ -677,3 +677,25 @@ function rotr3(a: i8, b: i8, c: i8): i32 { return rotr(a, rotr(b, c)); } assert(rotr3(48, 8, 1) == 3); + +// bswap tests + +// check bswap for i8/u8 +assert(bswap(0xaa) == 0xaa); +assert(bswap(0xaa) == 0xaa); + +// check bswap for i16/u16 +assert(bswap(0xaabb) == 0xbbaa); +assert(bswap(0xaabb) == 0xbbaa); + +// check bswap for i32/u32 +assert(bswap(0xaabbccdd) == 0xddccbbaa); +assert(bswap(0xaabbccdd) == 0xddccbbaa); + +// check bswap for i64/u64 +assert(bswap(0x00112233aabbccdd) == 0xddccbbaa33221100); +assert(bswap(0x00112233aabbccdd) == 0xddccbbaa33221100); + +// check bswap for isize/usize +assert(bswap(0xaabbccdd) == 0xddccbbaa); +assert(bswap(0xaabbccdd) == 0xddccbbaa); diff --git a/tests/compiler/std/array.debug.wat b/tests/compiler/std/array.debug.wat index 7ad6c5c890..b42761973a 100644 --- a/tests/compiler/std/array.debug.wat +++ b/tests/compiler/std/array.debug.wat @@ -14,7 +14,6 @@ (type $none_=>_f64 (func (result f64))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) @@ -26,6 +25,7 @@ (type $i32_i32_f32_i32_i32_=>_none (func (param i32 i32 f32 i32 i32))) (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i64_=>_i64 (func (param i64) (result i64))) (type $i64_=>_none (func (param i64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) @@ -3953,63 +3953,6 @@ call $~lib/util/bytes/REVERSE local.get $0 ) - (func $~lib/polyfills/bswap (param $0 i64) (result i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - i32.const 1 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.const 8 - i64.shr_u - i64.const 71777214294589695 - i64.and - local.set $1 - local.get $0 - i64.const 71777214294589695 - i64.and - i64.const 8 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - local.set $3 - local.get $3 - i64.const 16 - i64.shr_u - i64.const 281470681808895 - i64.and - local.set $1 - local.get $3 - i64.const 281470681808895 - i64.and - i64.const 16 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - i64.const 32 - i64.rotr - return - ) (func $~lib/util/bytes/REVERSE (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -4018,9 +3961,11 @@ (local $6 i32) (local $7 i32) (local $8 i64) - (local $9 i32) - (local $10 i32) + (local $9 i64) + (local $10 i64) (local $11 i32) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.gt_u @@ -4064,12 +4009,58 @@ local.set $7 local.get $6 i64.load - call $~lib/polyfills/bswap + local.tee $8 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $8 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $9 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $9 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr local.set $8 local.get $6 local.get $7 i64.load - call $~lib/polyfills/bswap + local.tee $9 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $9 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $10 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $10 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr i64.store local.get $7 local.get $8 @@ -4101,7 +4092,7 @@ i32.const 0 i32.shl i32.add - local.set $9 + local.set $11 local.get $0 local.get $3 local.get $2 @@ -4109,16 +4100,16 @@ i32.const 0 i32.shl i32.add - local.set $10 - local.get $9 + local.set $12 + local.get $11 i32.load8_u - local.set $11 - local.get $9 - local.get $10 + local.set $13 + local.get $11 + local.get $12 i32.load8_u i32.store8 - local.get $10 - local.get $11 + local.get $12 + local.get $13 i32.store8 local.get $2 i32.const 1 diff --git a/tests/compiler/std/array.release.wat b/tests/compiler/std/array.release.wat index 161da1ab52..329733f97c 100644 --- a/tests/compiler/std/array.release.wat +++ b/tests/compiler/std/array.release.wat @@ -2966,36 +2966,43 @@ local.get $2 i32.store offset=12 ) - (func $~lib/util/bytes/REVERSE (param $0 i32) (param $1 i32) + (func $~lib/array/Array#reverse (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i64) - local.get $1 + (local $7 i32) + (local $8 i64) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $0 + i32.load offset=12 + local.tee $5 i32.const 1 i32.gt_u if - local.get $1 + local.get $5 i32.const 1 i32.shr_u local.set $4 - local.get $1 + local.get $5 i32.const 8 i32.sub - local.set $5 + local.set $6 loop $while-continue|0 - local.get $2 + local.get $1 i32.const 7 i32.add local.get $4 i32.lt_u if - local.get $0 + local.get $1 local.get $2 i32.add - local.tee $6 + local.tee $7 i64.load local.tee $3 i64.const 8 @@ -3009,31 +3016,31 @@ i64.shl i64.or local.set $3 + local.get $7 + local.get $2 local.get $6 - local.get $0 - local.get $5 i32.add - local.get $2 + local.get $1 i32.sub - local.tee $6 - i64.load local.tee $7 + i64.load + local.tee $8 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - local.get $7 + local.get $8 i64.const 71777214294589695 i64.and i64.const 8 i64.shl i64.or - local.tee $7 + local.tee $8 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - local.get $7 + local.get $8 i64.const 281470681808895 i64.and i64.const 16 @@ -3042,7 +3049,7 @@ i64.const 32 i64.rotr i64.store - local.get $6 + local.get $7 local.get $3 i64.const 16 i64.shr_u @@ -3057,48 +3064,49 @@ i64.const 32 i64.rotr i64.store - local.get $2 + local.get $1 i32.const 8 i32.add - local.set $2 + local.set $1 br $while-continue|0 end end - local.get $1 + local.get $5 i32.const 1 i32.sub - local.set $1 + local.set $5 loop $while-continue|1 - local.get $2 + local.get $1 local.get $4 i32.lt_u if - local.get $0 + local.get $1 local.get $2 i32.add - local.tee $5 + local.tee $6 i32.load8_u - local.set $6 + local.set $7 + local.get $6 + local.get $2 local.get $5 - local.get $0 local.get $1 - local.get $2 i32.sub i32.add - local.tee $5 + local.tee $6 i32.load8_u i32.store8 - local.get $5 local.get $6 + local.get $7 i32.store8 - local.get $2 + local.get $1 i32.const 1 i32.add - local.set $2 + local.set $1 br $while-continue|1 end end end + local.get $0 ) (func $~lib/array/Array#reverse (param $0 i32) (result i32) (local $1 i32) @@ -16000,24 +16008,21 @@ local.get $8 i32.store local.get $8 - i32.load offset=4 - local.get $8 - i32.load offset=12 - call $~lib/util/bytes/REVERSE - local.get $8 + call $~lib/array/Array#reverse + local.tee $0 i32.store offset=16 - local.get $8 + local.get $0 i32.load offset=12 - local.set $0 + local.set $8 loop $for-loop|0 - local.get $0 local.get $1 - i32.gt_s + local.get $8 + i32.lt_s if - local.get $8 + local.get $0 local.get $1 call $~lib/array/Array#__get - local.get $8 + local.get $0 i32.load offset=12 local.get $1 i32.sub @@ -16050,11 +16055,8 @@ local.get $1 i32.store local.get $1 - i32.load offset=4 - local.get $1 - i32.load offset=12 - call $~lib/util/bytes/REVERSE - local.get $1 + call $~lib/array/Array#reverse + local.tee $1 i32.store offset=12 i32.const 0 local.set $0 @@ -16102,24 +16104,21 @@ local.get $1 i32.store local.get $1 - i32.load offset=4 - local.get $1 - i32.load offset=12 - call $~lib/util/bytes/REVERSE - local.get $1 + call $~lib/array/Array#reverse + local.tee $0 i32.store offset=4 - local.get $1 + local.get $0 i32.load offset=12 - local.set $0 + local.set $1 loop $for-loop|2 - local.get $0 + local.get $1 local.get $3 i32.gt_s if - local.get $1 + local.get $0 local.get $3 call $~lib/array/Array#__get - local.get $1 + local.get $0 i32.load offset=12 local.get $3 i32.sub @@ -16353,7 +16352,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf38 + block $__inlined_func$~lib/array/Array#indexOf36 local.get $3 i32.load offset=12 local.tee $8 @@ -16362,11 +16361,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf38 + br_if $__inlined_func$~lib/array/Array#indexOf36 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|040 + loop $while-continue|038 local.get $0 local.get $8 i32.lt_s @@ -16380,12 +16379,12 @@ i32.load i32.const 42 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf38 + br_if $__inlined_func$~lib/array/Array#indexOf36 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|040 + br $while-continue|038 end end i32.const -1 @@ -16412,7 +16411,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf41 + block $__inlined_func$~lib/array/Array#indexOf39 local.get $3 i32.load offset=12 local.tee $8 @@ -16421,11 +16420,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf41 + br_if $__inlined_func$~lib/array/Array#indexOf39 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|043 + loop $while-continue|041 local.get $0 local.get $8 i32.lt_s @@ -16439,12 +16438,12 @@ i32.load i32.const 45 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf41 + br_if $__inlined_func$~lib/array/Array#indexOf39 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|043 + br $while-continue|041 end end i32.const -1 @@ -16471,7 +16470,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf44 + block $__inlined_func$~lib/array/Array#indexOf42 local.get $3 i32.load offset=12 local.tee $8 @@ -16480,11 +16479,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf44 + br_if $__inlined_func$~lib/array/Array#indexOf42 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|046 + loop $while-continue|044 local.get $0 local.get $8 i32.lt_s @@ -16498,12 +16497,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf44 + br_if $__inlined_func$~lib/array/Array#indexOf42 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|046 + br $while-continue|044 end end i32.const -1 @@ -16528,7 +16527,7 @@ i32.store i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#indexOf47 + block $__inlined_func$~lib/array/Array#indexOf45 local.get $1 i32.load offset=12 local.tee $3 @@ -16537,7 +16536,7 @@ i32.const 1 local.get $3 select - br_if $__inlined_func$~lib/array/Array#indexOf47 + br_if $__inlined_func$~lib/array/Array#indexOf45 local.get $3 i32.const 100 i32.sub @@ -16551,7 +16550,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|049 + loop $while-continue|047 local.get $0 local.get $3 i32.lt_s @@ -16564,12 +16563,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf47 + br_if $__inlined_func$~lib/array/Array#indexOf45 local.get $0 i32.const 1 i32.add local.set $0 - br $while-continue|049 + br $while-continue|047 end end i32.const -1 @@ -16594,7 +16593,7 @@ i32.store i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#indexOf50 + block $__inlined_func$~lib/array/Array#indexOf48 local.get $1 i32.load offset=12 local.tee $3 @@ -16603,7 +16602,7 @@ i32.const 1 local.get $3 select - br_if $__inlined_func$~lib/array/Array#indexOf50 + br_if $__inlined_func$~lib/array/Array#indexOf48 local.get $3 i32.const 2 i32.sub @@ -16617,7 +16616,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|052 + loop $while-continue|050 local.get $0 local.get $3 i32.lt_s @@ -16630,12 +16629,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf50 + br_if $__inlined_func$~lib/array/Array#indexOf48 local.get $0 i32.const 1 i32.add local.set $0 - br $while-continue|052 + br $while-continue|050 end end i32.const -1 @@ -16660,7 +16659,7 @@ i32.store i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#indexOf53 + block $__inlined_func$~lib/array/Array#indexOf51 local.get $1 i32.load offset=12 local.tee $3 @@ -16669,7 +16668,7 @@ i32.const 1 local.get $3 select - br_if $__inlined_func$~lib/array/Array#indexOf53 + br_if $__inlined_func$~lib/array/Array#indexOf51 local.get $3 i32.const 4 i32.sub @@ -16683,7 +16682,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|055 + loop $while-continue|053 local.get $0 local.get $3 i32.lt_s @@ -16696,12 +16695,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf53 + br_if $__inlined_func$~lib/array/Array#indexOf51 local.get $0 i32.const 1 i32.add local.set $0 - br $while-continue|055 + br $while-continue|053 end end i32.const -1 @@ -16728,7 +16727,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf56 + block $__inlined_func$~lib/array/Array#indexOf54 local.get $3 i32.load offset=12 local.tee $8 @@ -16737,11 +16736,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf56 + br_if $__inlined_func$~lib/array/Array#indexOf54 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|058 + loop $while-continue|056 local.get $0 local.get $8 i32.lt_s @@ -16755,12 +16754,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf56 + br_if $__inlined_func$~lib/array/Array#indexOf54 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|058 + br $while-continue|056 end end i32.const -1 @@ -16787,7 +16786,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf59 + block $__inlined_func$~lib/array/Array#indexOf57 local.get $3 i32.load offset=12 local.tee $8 @@ -16796,11 +16795,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf59 + br_if $__inlined_func$~lib/array/Array#indexOf57 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|061 + loop $while-continue|059 local.get $0 local.get $8 i32.lt_s @@ -16814,12 +16813,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf59 + br_if $__inlined_func$~lib/array/Array#indexOf57 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|061 + br $while-continue|059 end end i32.const -1 @@ -16846,7 +16845,7 @@ local.set $0 i32.const -1 local.set $1 - block $__inlined_func$~lib/array/Array#indexOf62 + block $__inlined_func$~lib/array/Array#indexOf60 local.get $3 i32.load offset=12 local.tee $8 @@ -16855,11 +16854,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf62 + br_if $__inlined_func$~lib/array/Array#indexOf60 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|064 + loop $while-continue|062 local.get $0 local.get $8 i32.lt_s @@ -16873,12 +16872,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf62 + br_if $__inlined_func$~lib/array/Array#indexOf60 local.get $1 i32.const 1 i32.add local.set $0 - br $while-continue|064 + br $while-continue|062 end end i32.const -1 @@ -16923,7 +16922,7 @@ local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|066 + loop $while-continue|064 local.get $0 local.get $8 i32.lt_s @@ -16942,7 +16941,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|066 + br $while-continue|064 end end i32.const -1 @@ -16985,7 +16984,7 @@ local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|068 + loop $while-continue|066 local.get $0 local.get $8 i32.lt_s @@ -17004,7 +17003,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|068 + br $while-continue|066 end end i32.const -1 @@ -17169,7 +17168,7 @@ local.get $1 i32.load offset=4 local.set $3 - loop $while-continue|070 + loop $while-continue|068 local.get $0 i32.const 0 i32.ge_s @@ -17187,7 +17186,7 @@ i32.const 1 i32.sub local.set $0 - br $while-continue|070 + br $while-continue|068 end end i32.const -1 @@ -17206,12 +17205,12 @@ end i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#lastIndexOf71 + block $__inlined_func$~lib/array/Array#lastIndexOf69 local.get $1 i32.load offset=12 local.tee $3 i32.eqz - br_if $__inlined_func$~lib/array/Array#lastIndexOf71 + br_if $__inlined_func$~lib/array/Array#lastIndexOf69 local.get $3 i32.const 1 i32.sub @@ -17224,7 +17223,7 @@ local.get $1 i32.load offset=4 local.set $3 - loop $while-continue|073 + loop $while-continue|071 local.get $0 i32.const 0 i32.ge_s @@ -17237,12 +17236,12 @@ i32.load i32.const 2 i32.eq - br_if $__inlined_func$~lib/array/Array#lastIndexOf71 + br_if $__inlined_func$~lib/array/Array#lastIndexOf69 local.get $0 i32.const 1 i32.sub local.set $0 - br $while-continue|073 + br $while-continue|071 end end i32.const -1 @@ -17259,12 +17258,12 @@ end i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#lastIndexOf74 + block $__inlined_func$~lib/array/Array#lastIndexOf72 local.get $1 i32.load offset=12 local.tee $3 i32.eqz - br_if $__inlined_func$~lib/array/Array#lastIndexOf74 + br_if $__inlined_func$~lib/array/Array#lastIndexOf72 local.get $3 i32.const 2 i32.sub @@ -17272,7 +17271,7 @@ local.get $1 i32.load offset=4 local.set $3 - loop $while-continue|076 + loop $while-continue|074 local.get $0 i32.const 0 i32.ge_s @@ -17285,12 +17284,12 @@ i32.load i32.const 2 i32.eq - br_if $__inlined_func$~lib/array/Array#lastIndexOf74 + br_if $__inlined_func$~lib/array/Array#lastIndexOf72 local.get $0 i32.const 1 i32.sub local.set $0 - br $while-continue|076 + br $while-continue|074 end end i32.const -1 @@ -17307,12 +17306,12 @@ end i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#lastIndexOf77 + block $__inlined_func$~lib/array/Array#lastIndexOf75 local.get $1 i32.load offset=12 local.tee $3 i32.eqz - br_if $__inlined_func$~lib/array/Array#lastIndexOf77 + br_if $__inlined_func$~lib/array/Array#lastIndexOf75 local.get $3 i32.const 1 i32.sub @@ -17320,7 +17319,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|079 + loop $while-continue|077 local.get $0 i32.const 0 i32.ge_s @@ -17333,12 +17332,12 @@ i32.load i32.const 2 i32.eq - br_if $__inlined_func$~lib/array/Array#lastIndexOf77 + br_if $__inlined_func$~lib/array/Array#lastIndexOf75 local.get $0 i32.const 1 i32.sub local.set $0 - br $while-continue|079 + br $while-continue|077 end end i32.const -1 @@ -17840,7 +17839,7 @@ local.set $1 i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#indexOf39 + block $__inlined_func$~lib/array/Array#indexOf38 local.get $3 i32.load offset=12 local.tee $8 @@ -17849,11 +17848,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf39 + br_if $__inlined_func$~lib/array/Array#indexOf38 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|041 + loop $while-continue|039 local.get $1 local.get $8 i32.lt_s @@ -17867,12 +17866,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf39 + br_if $__inlined_func$~lib/array/Array#indexOf38 local.get $0 i32.const 1 i32.add local.set $1 - br $while-continue|041 + br $while-continue|039 end end i32.const -1 @@ -17897,7 +17896,7 @@ local.set $1 i32.const -1 local.set $0 - block $__inlined_func$~lib/array/Array#indexOf43 + block $__inlined_func$~lib/array/Array#indexOf41 local.get $3 i32.load offset=12 local.tee $8 @@ -17906,11 +17905,11 @@ i32.const 1 local.get $8 select - br_if $__inlined_func$~lib/array/Array#indexOf43 + br_if $__inlined_func$~lib/array/Array#indexOf41 local.get $3 i32.load offset=4 local.set $3 - loop $while-continue|044 + loop $while-continue|042 local.get $1 local.get $8 i32.lt_s @@ -17924,12 +17923,12 @@ i32.load i32.const 43 i32.eq - br_if $__inlined_func$~lib/array/Array#indexOf43 + br_if $__inlined_func$~lib/array/Array#indexOf41 local.get $0 i32.const 1 i32.add local.set $1 - br $while-continue|044 + br $while-continue|042 end end i32.const -1 @@ -17972,7 +17971,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|081 + loop $while-continue|079 local.get $0 local.get $3 i32.lt_s @@ -17997,7 +17996,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|081 + br $while-continue|079 end end i32.const 0 @@ -18037,7 +18036,7 @@ local.get $1 i32.load offset=4 local.set $1 - loop $while-continue|083 + loop $while-continue|081 local.get $0 local.get $3 i32.lt_s @@ -18062,7 +18061,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|083 + br $while-continue|081 end end i32.const 0 @@ -19422,7 +19421,7 @@ i32.load offset=12 local.set $3 block $__inlined_func$~lib/array/Array#findIndex - loop $for-loop|092 + loop $for-loop|090 local.get $0 local.get $3 local.get $1 @@ -19453,7 +19452,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|092 + br $for-loop|090 end end i32.const -1 @@ -19483,8 +19482,8 @@ local.get $1 i32.load offset=12 local.set $3 - block $__inlined_func$~lib/array/Array#findIndex94 - loop $for-loop|096 + block $__inlined_func$~lib/array/Array#findIndex92 + loop $for-loop|094 local.get $0 local.get $3 local.get $1 @@ -19510,12 +19509,12 @@ i32.const 6640 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findIndex94 + br_if $__inlined_func$~lib/array/Array#findIndex92 local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|096 + br $for-loop|094 end end i32.const -1 @@ -19547,8 +19546,8 @@ local.get $1 i32.load offset=12 local.set $3 - block $__inlined_func$~lib/array/Array#findIndex98 - loop $for-loop|0100 + block $__inlined_func$~lib/array/Array#findIndex96 + loop $for-loop|098 local.get $0 local.get $3 local.get $1 @@ -19574,12 +19573,12 @@ i32.const 6672 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findIndex98 + br_if $__inlined_func$~lib/array/Array#findIndex96 local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0100 + br $for-loop|098 end end i32.const -1 @@ -19611,8 +19610,8 @@ local.get $1 i32.load offset=12 local.set $3 - block $__inlined_func$~lib/array/Array#findIndex102 - loop $for-loop|0104 + block $__inlined_func$~lib/array/Array#findIndex100 + loop $for-loop|0102 local.get $0 local.get $3 local.get $1 @@ -19638,12 +19637,12 @@ i32.const 6704 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findIndex102 + br_if $__inlined_func$~lib/array/Array#findIndex100 local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0104 + br $for-loop|0102 end end i32.const -1 @@ -19691,8 +19690,8 @@ local.get $1 i32.load offset=12 local.set $3 - block $__inlined_func$~lib/array/Array#findIndex107 - loop $for-loop|0109 + block $__inlined_func$~lib/array/Array#findIndex105 + loop $for-loop|0107 local.get $0 local.get $3 local.get $1 @@ -19718,12 +19717,12 @@ i32.const 6736 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findIndex107 + br_if $__inlined_func$~lib/array/Array#findIndex105 local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0109 + br $for-loop|0107 end end i32.const -1 @@ -19782,8 +19781,8 @@ local.get $1 i32.load offset=12 local.set $3 - block $__inlined_func$~lib/array/Array#findIndex111 - loop $for-loop|0113 + block $__inlined_func$~lib/array/Array#findIndex109 + loop $for-loop|0111 local.get $0 local.get $3 local.get $1 @@ -19809,12 +19808,12 @@ i32.const 6768 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findIndex111 + br_if $__inlined_func$~lib/array/Array#findIndex109 local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0113 + br $for-loop|0111 end end i32.const -1 @@ -19880,7 +19879,7 @@ i32.sub local.set $0 block $__inlined_func$~lib/array/Array#findLastIndex - loop $for-loop|0117 + loop $for-loop|0115 local.get $0 i32.const 0 i32.ge_s @@ -19904,7 +19903,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0117 + br $for-loop|0115 end end i32.const -1 @@ -19929,8 +19928,8 @@ i32.const 1 i32.sub local.set $0 - block $__inlined_func$~lib/array/Array#findLastIndex119 - loop $for-loop|0121 + block $__inlined_func$~lib/array/Array#findLastIndex117 + loop $for-loop|0119 local.get $0 i32.const 0 i32.ge_s @@ -19949,12 +19948,12 @@ i32.const 6880 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findLastIndex119 + br_if $__inlined_func$~lib/array/Array#findLastIndex117 local.get $0 i32.const 1 i32.sub local.set $0 - br $for-loop|0121 + br $for-loop|0119 end end i32.const -1 @@ -19981,8 +19980,8 @@ i32.const 1 i32.sub local.set $0 - block $__inlined_func$~lib/array/Array#findLastIndex123 - loop $for-loop|0125 + block $__inlined_func$~lib/array/Array#findLastIndex121 + loop $for-loop|0123 local.get $0 i32.const 0 i32.ge_s @@ -20001,12 +20000,12 @@ i32.const 6912 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findLastIndex123 + br_if $__inlined_func$~lib/array/Array#findLastIndex121 local.get $0 i32.const 1 i32.sub local.set $0 - br $for-loop|0125 + br $for-loop|0123 end end i32.const -1 @@ -20033,8 +20032,8 @@ i32.const 1 i32.sub local.set $0 - block $__inlined_func$~lib/array/Array#findLastIndex127 - loop $for-loop|0129 + block $__inlined_func$~lib/array/Array#findLastIndex125 + loop $for-loop|0127 local.get $0 i32.const 0 i32.ge_s @@ -20053,12 +20052,12 @@ i32.const 6944 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#findLastIndex127 + br_if $__inlined_func$~lib/array/Array#findLastIndex125 local.get $0 i32.const 1 i32.sub local.set $0 - br $for-loop|0129 + br $for-loop|0127 end end i32.const -1 @@ -20091,7 +20090,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0132 + loop $for-loop|0130 local.get $0 local.get $3 local.get $1 @@ -20127,7 +20126,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0132 + br $for-loop|0130 end end i32.const 1 @@ -20141,7 +20140,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#every134 (result i32) + block $__inlined_func$~lib/array/Array#every132 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20155,7 +20154,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0136 + loop $for-loop|0134 local.get $0 local.get $3 local.get $1 @@ -20185,13 +20184,13 @@ i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) i32.eqz - br_if $__inlined_func$~lib/array/Array#every134 + br_if $__inlined_func$~lib/array/Array#every132 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0136 + br $for-loop|0134 end end i32.const 1 @@ -20204,7 +20203,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#every138 (result i32) + block $__inlined_func$~lib/array/Array#every136 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20218,7 +20217,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0140 + loop $for-loop|0138 local.get $0 local.get $3 local.get $1 @@ -20248,13 +20247,13 @@ i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) i32.eqz - br_if $__inlined_func$~lib/array/Array#every138 + br_if $__inlined_func$~lib/array/Array#every136 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0140 + br $for-loop|0138 end end i32.const 1 @@ -20284,7 +20283,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#every143 (result i32) + block $__inlined_func$~lib/array/Array#every141 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20298,7 +20297,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0145 + loop $for-loop|0143 local.get $0 local.get $3 local.get $1 @@ -20328,13 +20327,13 @@ i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) i32.eqz - br_if $__inlined_func$~lib/array/Array#every143 + br_if $__inlined_func$~lib/array/Array#every141 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0145 + br $for-loop|0143 end end i32.const 1 @@ -20375,7 +20374,7 @@ local.get $0 call $~lib/array/Array#pop drop - block $__inlined_func$~lib/array/Array#every147 (result i32) + block $__inlined_func$~lib/array/Array#every145 (result i32) global.get $~lib/memory/__stack_pointer global.get $std/array/arr local.tee $1 @@ -20388,7 +20387,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0149 + loop $for-loop|0147 local.get $0 local.get $3 local.get $1 @@ -20418,13 +20417,13 @@ i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) i32.eqz - br_if $__inlined_func$~lib/array/Array#every147 + br_if $__inlined_func$~lib/array/Array#every145 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0149 + br $for-loop|0147 end end i32.const 1 @@ -20481,7 +20480,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0153 + loop $for-loop|0151 local.get $0 local.get $3 local.get $1 @@ -20516,7 +20515,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0153 + br $for-loop|0151 end end i32.const 0 @@ -20530,7 +20529,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#some155 (result i32) + block $__inlined_func$~lib/array/Array#some153 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20544,7 +20543,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0157 + loop $for-loop|0155 local.get $0 local.get $3 local.get $1 @@ -20573,13 +20572,13 @@ i32.const 7168 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#some155 + br_if $__inlined_func$~lib/array/Array#some153 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0157 + br $for-loop|0155 end end i32.const 0 @@ -20592,7 +20591,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#some159 (result i32) + block $__inlined_func$~lib/array/Array#some157 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20606,7 +20605,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0161 + loop $for-loop|0159 local.get $0 local.get $3 local.get $1 @@ -20635,13 +20634,13 @@ i32.const 7200 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#some159 + br_if $__inlined_func$~lib/array/Array#some157 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0161 + br $for-loop|0159 end end i32.const 0 @@ -20670,7 +20669,7 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/array/Array#some164 (result i32) + block $__inlined_func$~lib/array/Array#some162 (result i32) global.get $~lib/memory/__stack_pointer local.tee $0 global.get $std/array/arr @@ -20684,7 +20683,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0166 + loop $for-loop|0164 local.get $0 local.get $3 local.get $1 @@ -20713,13 +20712,13 @@ i32.const 7232 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#some164 + br_if $__inlined_func$~lib/array/Array#some162 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0166 + br $for-loop|0164 end end i32.const 0 @@ -20761,7 +20760,7 @@ local.get $0 call $~lib/array/Array#pop drop - block $__inlined_func$~lib/array/Array#some168 (result i32) + block $__inlined_func$~lib/array/Array#some166 (result i32) global.get $~lib/memory/__stack_pointer global.get $std/array/arr local.tee $1 @@ -20774,7 +20773,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0170 + loop $for-loop|0168 local.get $0 local.get $3 local.get $1 @@ -20803,13 +20802,13 @@ i32.const 7264 i32.load call_indirect $0 (type $i32_i32_i32_=>_i32) - br_if $__inlined_func$~lib/array/Array#some168 + br_if $__inlined_func$~lib/array/Array#some166 drop local.get $0 i32.const 1 i32.add local.set $0 - br $for-loop|0170 + br $for-loop|0168 end end i32.const 0 @@ -20866,7 +20865,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0174 + loop $for-loop|0172 local.get $0 local.get $3 local.get $1 @@ -20896,7 +20895,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0174 + br $for-loop|0172 end end global.get $std/array/i @@ -20925,7 +20924,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0178 + loop $for-loop|0176 local.get $0 local.get $3 local.get $1 @@ -20955,7 +20954,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0178 + br $for-loop|0176 end end global.get $std/array/i @@ -21000,7 +20999,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0183 + loop $for-loop|0181 local.get $0 local.get $3 local.get $1 @@ -21030,7 +21029,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0183 + br $for-loop|0181 end end global.get $std/array/i @@ -21086,7 +21085,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0187 + loop $for-loop|0185 local.get $0 local.get $3 local.get $1 @@ -21116,7 +21115,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0187 + br $for-loop|0185 end end global.get $std/array/i @@ -21172,7 +21171,7 @@ local.get $1 i32.load offset=12 local.set $3 - loop $for-loop|0192 + loop $for-loop|0190 local.get $0 local.get $3 local.get $1 @@ -21202,7 +21201,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0192 + br $for-loop|0190 end end global.get $~lib/memory/__stack_pointer @@ -21305,7 +21304,7 @@ local.set $10 i32.const 0 local.set $0 - loop $for-loop|0196 + loop $for-loop|0194 local.get $0 local.get $8 local.get $3 @@ -21342,7 +21341,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0196 + br $for-loop|0194 end end global.get $~lib/memory/__stack_pointer @@ -21715,7 +21714,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0205 + loop $for-loop|0203 local.get $0 local.get $8 local.get $3 @@ -21749,7 +21748,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0205 + br $for-loop|0203 end end local.get $1 @@ -21780,7 +21779,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0209 + loop $for-loop|0207 local.get $0 local.get $8 local.get $3 @@ -21814,7 +21813,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0209 + br $for-loop|0207 end end local.get $1 @@ -21845,7 +21844,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0213 + loop $for-loop|0211 local.get $0 local.get $8 local.get $3 @@ -21879,7 +21878,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0213 + br $for-loop|0211 end end local.get $1 @@ -21907,7 +21906,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0217 + loop $for-loop|0215 local.get $0 local.get $8 local.get $3 @@ -21941,7 +21940,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0217 + br $for-loop|0215 end end local.get $1 @@ -21968,7 +21967,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0221 + loop $for-loop|0219 local.get $0 local.get $8 local.get $3 @@ -22002,7 +22001,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0221 + br $for-loop|0219 end end local.get $1 @@ -22049,7 +22048,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0226 + loop $for-loop|0224 local.get $0 local.get $8 local.get $3 @@ -22083,7 +22082,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0226 + br $for-loop|0224 end end local.get $1 @@ -22141,7 +22140,7 @@ local.get $3 i32.load offset=12 local.set $8 - loop $for-loop|0230 + loop $for-loop|0228 local.get $0 local.get $8 local.get $3 @@ -22175,7 +22174,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0230 + br $for-loop|0228 end end local.get $1 @@ -22235,7 +22234,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0234 + loop $for-loop|0232 local.get $0 i32.const 0 i32.ge_s @@ -22262,7 +22261,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0234 + br $for-loop|0232 end end local.get $1 @@ -22293,7 +22292,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0238 + loop $for-loop|0236 local.get $0 i32.const 0 i32.ge_s @@ -22320,7 +22319,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0238 + br $for-loop|0236 end end local.get $1 @@ -22351,7 +22350,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0242 + loop $for-loop|0240 local.get $0 i32.const 0 i32.ge_s @@ -22378,7 +22377,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0242 + br $for-loop|0240 end end local.get $1 @@ -22406,7 +22405,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0246 + loop $for-loop|0244 local.get $0 i32.const 0 i32.ge_s @@ -22433,7 +22432,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0246 + br $for-loop|0244 end end local.get $1 @@ -22460,7 +22459,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0250 + loop $for-loop|0248 local.get $0 i32.const 0 i32.ge_s @@ -22487,7 +22486,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0250 + br $for-loop|0248 end end local.get $1 @@ -22534,7 +22533,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0255 + loop $for-loop|0253 local.get $0 i32.const 0 i32.ge_s @@ -22561,7 +22560,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0255 + br $for-loop|0253 end end local.get $1 @@ -22619,7 +22618,7 @@ i32.const 1 i32.sub local.set $0 - loop $for-loop|0259 + loop $for-loop|0257 local.get $0 i32.const 0 i32.ge_s @@ -22646,7 +22645,7 @@ i32.const 1 i32.sub local.set $0 - br $for-loop|0259 + br $for-loop|0257 end end local.get $1 @@ -23209,11 +23208,11 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of145 - block $0of146 - block $outOfRange47 + block $1of143 + block $0of144 + block $outOfRange45 global.get $~argumentsLength - br_table $0of146 $1of145 $outOfRange47 + br_table $0of144 $1of143 $outOfRange45 end unreachable end @@ -23260,7 +23259,7 @@ drop i32.const 0 local.set $0 - loop $for-loop|028 + loop $for-loop|038 local.get $0 local.get $8 i32.lt_s @@ -23316,7 +23315,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|028 + br $for-loop|038 end end i32.const 1 @@ -23353,11 +23352,11 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of1308 - block $0of1309 - block $outOfRange310 + block $1of1306 + block $0of1307 + block $outOfRange308 global.get $~argumentsLength - br_table $0of1309 $1of1308 $outOfRange310 + br_table $0of1307 $1of1306 $outOfRange308 end unreachable end @@ -23422,11 +23421,11 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of1311 - block $0of1312 - block $outOfRange313 + block $1of1309 + block $0of1310 + block $outOfRange311 global.get $~argumentsLength - br_table $0of1312 $1of1311 $outOfRange313 + br_table $0of1310 $1of1309 $outOfRange311 end unreachable end @@ -23960,7 +23959,7 @@ i32.store i32.const 0 local.set $0 - loop $for-loop|0315 + loop $for-loop|0313 local.get $0 i32.const 2 i32.lt_s @@ -23984,7 +23983,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0315 + br $for-loop|0313 end end global.get $~lib/memory/__stack_pointer @@ -24165,13 +24164,13 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of151 - block $0of152 - block $outOfRange53 + block $1of149 + block $0of150 + block $outOfRange51 global.get $~argumentsLength i32.const 1 i32.sub - br_table $0of152 $1of151 $outOfRange53 + br_table $0of150 $1of149 $outOfRange51 end unreachable end @@ -24218,7 +24217,7 @@ local.get $0 i32.load offset=12 local.set $8 - loop $for-loop|054 + loop $for-loop|052 local.get $1 local.get $8 i32.lt_s @@ -24260,7 +24259,7 @@ i32.const 1 i32.add local.set $1 - br $for-loop|054 + br $for-loop|052 end end global.get $~lib/memory/__stack_pointer @@ -24325,7 +24324,7 @@ end i32.const 0 local.set $3 - loop $for-loop|045 + loop $for-loop|055 local.get $1 local.get $3 i32.gt_s @@ -24360,7 +24359,7 @@ i32.const 1 i32.add local.set $3 - br $for-loop|045 + br $for-loop|055 end end global.get $~lib/memory/__stack_pointer @@ -24397,13 +24396,13 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of148 - block $0of149 - block $outOfRange50 + block $1of158 + block $0of159 + block $outOfRange60 global.get $~argumentsLength i32.const 1 i32.sub - br_table $0of149 $1of148 $outOfRange50 + br_table $0of159 $1of158 $outOfRange60 end unreachable end @@ -24501,7 +24500,7 @@ i32.store i32.const 0 local.set $0 - loop $for-loop|155 + loop $for-loop|153 local.get $2 local.get $4 i32.lt_s @@ -24553,7 +24552,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|155 + br $for-loop|153 end end local.get $3 @@ -25175,7 +25174,7 @@ i32.store i32.const 0 local.set $0 - loop $for-loop|056 + loop $for-loop|054 local.get $2 local.get $4 i32.lt_s @@ -25216,7 +25215,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|056 + br $for-loop|054 end end local.get $1 @@ -25370,7 +25369,7 @@ i32.store i32.const 0 local.set $0 - loop $for-loop|057 + loop $for-loop|056 local.get $2 local.get $4 i32.lt_s @@ -25411,7 +25410,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|057 + br $for-loop|056 end end local.get $1 @@ -25778,7 +25777,7 @@ i32.const 1 i32.shr_u local.set $4 - loop $for-loop|058 + loop $for-loop|057 local.get $1 local.get $2 i32.gt_s @@ -25820,7 +25819,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|058 + br $for-loop|057 end end global.get $~lib/memory/__stack_pointer @@ -25992,7 +25991,7 @@ i32.const 1 i32.shr_u local.set $4 - loop $for-loop|059 + loop $for-loop|058 local.get $1 local.get $2 i32.gt_s @@ -26034,7 +26033,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|059 + br $for-loop|058 end end global.get $~lib/memory/__stack_pointer @@ -26214,7 +26213,7 @@ i32.const 1 i32.shr_u local.set $4 - loop $for-loop|060 + loop $for-loop|059 local.get $1 local.get $2 i32.gt_s @@ -26256,7 +26255,7 @@ i32.const 1 i32.add local.set $2 - br $for-loop|060 + br $for-loop|059 end end global.get $~lib/memory/__stack_pointer @@ -26472,7 +26471,7 @@ local.set $3 i32.const 0 local.set $0 - loop $for-loop|0319 + loop $for-loop|0317 local.get $0 local.get $1 i32.lt_s @@ -26497,7 +26496,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|0319 + br $for-loop|0317 end end global.get $~lib/memory/__stack_pointer @@ -26538,7 +26537,7 @@ local.set $2 i32.const 0 local.set $0 - loop $for-loop|1322 + loop $for-loop|1320 local.get $0 local.get $1 i32.lt_s @@ -26571,12 +26570,12 @@ i32.const 1 i32.add local.set $0 - br $for-loop|1322 + br $for-loop|1320 end end i32.const 0 local.set $0 - loop $for-loop|2325 + loop $for-loop|2323 local.get $0 local.get $3 i32.lt_s @@ -26598,7 +26597,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|2325 + br $for-loop|2323 end end global.get $~lib/memory/__stack_pointer @@ -26782,7 +26781,7 @@ local.set $8 i32.const 0 local.set $0 - loop $for-loop|061 + loop $for-loop|071 local.get $0 local.get $3 local.get $1 @@ -26833,7 +26832,7 @@ i32.const 1 i32.add local.set $0 - br $for-loop|061 + br $for-loop|071 end end global.get $~lib/memory/__stack_pointer @@ -26923,12 +26922,12 @@ i32.const 0 i32.gt_s if - loop $while-continue|0332 + loop $while-continue|0330 global.get $~lib/rt/itcms/state if call $~lib/rt/itcms/step drop - br $while-continue|0332 + br $while-continue|0330 end end end diff --git a/tests/compiler/std/dataview.debug.wat b/tests/compiler/std/dataview.debug.wat index 28ef36db72..33cc41a8e5 100644 --- a/tests/compiler/std/dataview.debug.wat +++ b/tests/compiler/std/dataview.debug.wat @@ -12,7 +12,6 @@ (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_i32_i32_=>_f64 (func (param i32 i32 i32) (result f64))) (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) @@ -2267,35 +2266,8 @@ i32.load i32.sub ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - return - ) (func $~lib/dataview/DataView#getFloat32 (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (local $3 i32) local.get $1 i32.const 31 i32.shr_u @@ -2327,68 +2299,23 @@ local.get $1 i32.add i32.load - call $~lib/polyfills/bswap + local.tee $3 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $3 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or f32.reinterpret_i32 end ) - (func $~lib/polyfills/bswap (param $0 i64) (result i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - i32.const 1 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.const 8 - i64.shr_u - i64.const 71777214294589695 - i64.and - local.set $1 - local.get $0 - i64.const 71777214294589695 - i64.and - i64.const 8 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - local.set $3 - local.get $3 - i64.const 16 - i64.shr_u - i64.const 281470681808895 - i64.and - local.set $1 - local.get $3 - i64.const 281470681808895 - i64.and - i64.const 16 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - i64.const 32 - i64.rotr - return - ) (func $~lib/dataview/DataView#getFloat64 (param $0 i32) (param $1 i32) (param $2 i32) (result f64) + (local $3 i64) + (local $4 i64) local.get $1 i32.const 31 i32.shr_u @@ -2420,7 +2347,30 @@ local.get $1 i32.add i64.load - call $~lib/polyfills/bswap + local.tee $3 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $3 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $4 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $4 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr f64.reinterpret_i64 end ) @@ -2443,34 +2393,9 @@ i32.add i32.load8_s ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $0 - i32.const 8 - i32.const 15 - i32.and - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.const 15 - i32.and - i32.shr_u - i32.or - return - ) (func $~lib/dataview/DataView#getInt16 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2500,11 +2425,20 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + i32.const 65535 + i32.and + local.tee $4 + i32.const 8 + i32.shl + local.get $4 + i32.const 8 + i32.shr_u + i32.or end ) (func $~lib/dataview/DataView#getInt32 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2534,11 +2468,23 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + local.tee $4 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $4 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or end ) (func $~lib/dataview/DataView#getInt64 (param $0 i32) (param $1 i32) (param $2 i32) (result i64) (local $3 i64) + (local $4 i64) + (local $5 i64) local.get $1 i32.const 31 i32.shr_u @@ -2568,7 +2514,30 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + local.tee $4 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $4 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $5 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $5 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr end ) (func $~lib/dataview/DataView#getUint8 (param $0 i32) (param $1 i32) (result i32) @@ -2592,6 +2561,7 @@ ) (func $~lib/dataview/DataView#getUint16 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2621,11 +2591,18 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + local.tee $4 + i32.const 8 + i32.shl + local.get $4 + i32.const 8 + i32.shr_u + i32.or end ) (func $~lib/dataview/DataView#getUint32 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2655,11 +2632,23 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + local.tee $4 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $4 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or end ) (func $~lib/dataview/DataView#getUint64 (param $0 i32) (param $1 i32) (param $2 i32) (result i64) (local $3 i64) + (local $4 i64) + (local $5 i64) local.get $1 i32.const 31 i32.shr_u @@ -2689,10 +2678,34 @@ local.get $3 else local.get $3 - call $~lib/polyfills/bswap + local.tee $4 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $4 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $5 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $5 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr end ) (func $~lib/dataview/DataView#setFloat32 (param $0 i32) (param $1 i32) (param $2 f32) (param $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2726,11 +2739,23 @@ i32.add local.get $2 i32.reinterpret_f32 - call $~lib/polyfills/bswap + local.tee $4 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $4 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or i32.store end ) (func $~lib/dataview/DataView#setFloat64 (param $0 i32) (param $1 i32) (param $2 f64) (param $3 i32) + (local $4 i64) + (local $5 i64) local.get $1 i32.const 31 i32.shr_u @@ -2764,7 +2789,30 @@ i32.add local.get $2 i64.reinterpret_f64 - call $~lib/polyfills/bswap + local.tee $4 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $4 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $5 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $5 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr i64.store end ) @@ -2789,6 +2837,7 @@ i32.store8 ) (func $~lib/dataview/DataView#setInt16 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2816,11 +2865,20 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + i32.const 65535 + i32.and + local.tee $4 + i32.const 8 + i32.shl + local.get $4 + i32.const 8 + i32.shr_u + i32.or end i32.store16 ) (func $~lib/dataview/DataView#setInt32 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2848,11 +2906,23 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + local.tee $4 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $4 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or end i32.store ) (func $~lib/dataview/DataView#setInt64 (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) + (local $4 i64) + (local $5 i64) local.get $1 i32.const 31 i32.shr_u @@ -2880,7 +2950,30 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + local.tee $4 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $4 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $5 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $5 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr end i64.store ) @@ -2905,6 +2998,7 @@ i32.store8 ) (func $~lib/dataview/DataView#setUint16 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2932,11 +3026,20 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + i32.const 65535 + i32.and + local.tee $4 + i32.const 8 + i32.shl + local.get $4 + i32.const 8 + i32.shr_u + i32.or end i32.store16 ) (func $~lib/dataview/DataView#setUint32 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) local.get $1 i32.const 31 i32.shr_u @@ -2964,11 +3067,23 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + local.tee $4 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $4 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or end i32.store ) (func $~lib/dataview/DataView#setUint64 (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) + (local $4 i64) + (local $5 i64) local.get $1 i32.const 31 i32.shr_u @@ -2996,7 +3111,30 @@ local.get $2 else local.get $2 - call $~lib/polyfills/bswap + local.tee $4 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $4 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $5 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $5 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr end i64.store ) diff --git a/tests/compiler/std/dataview.release.wat b/tests/compiler/std/dataview.release.wat index 98f533fd5b..a690472e16 100644 --- a/tests/compiler/std/dataview.release.wat +++ b/tests/compiler/std/dataview.release.wat @@ -1675,18 +1675,22 @@ local.get $1 i32.add i32.load16_s - local.tee $0 - local.get $0 - i32.const 8 - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or + local.set $0 local.get $2 - select + if (result i32) + local.get $0 + else + local.get $0 + i32.const 65535 + i32.and + local.tee $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 8 + i32.shr_u + i32.or + end ) (func $~lib/dataview/DataView#getInt32 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 @@ -2027,18 +2031,21 @@ end local.get $0 i32.load offset=4 - local.get $1 - local.get $1 - i32.const 8 - i32.shl - local.get $1 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or local.get $2 - select + if (result i32) + local.get $1 + else + local.get $1 + i32.const 65535 + i32.and + local.tee $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 8 + i32.shr_u + i32.or + end i32.store16 ) (func $~lib/dataview/DataView#setInt32 (param $0 i32) (param $1 i32) (param $2 i32) @@ -2135,18 +2142,21 @@ end local.get $0 i32.load offset=4 - local.get $1 - local.get $1 - i32.const 8 - i32.shl - local.get $1 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or local.get $2 - select + if (result i32) + local.get $1 + else + local.get $1 + i32.const 65535 + i32.and + local.tee $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 8 + i32.shr_u + i32.or + end i32.store16 ) (func $~lib/dataview/DataView#setUint32 (param $0 i32) (param $1 i32) (param $2 i32) diff --git a/tests/compiler/std/polyfills.debug.wat b/tests/compiler/std/polyfills.debug.wat deleted file mode 100644 index 7b0499e6eb..0000000000 --- a/tests/compiler/std/polyfills.debug.wat +++ /dev/null @@ -1,679 +0,0 @@ -(module - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (global $~lib/memory/__data_end i32 (i32.const 76)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16460)) - (global $~lib/memory/__heap_base i32 (i32.const 16460)) - (memory $0 1) - (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") - (table $0 1 1 funcref) - (elem $0 (i32.const 1)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $0 - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $0 - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $0 - i32.const 8 - i32.const 15 - i32.and - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.const 15 - i32.and - i32.shr_u - i32.or - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $0 - i32.const 8 - i32.const 15 - i32.and - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.const 15 - i32.and - i32.shr_u - i32.or - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - return - ) - (func $~lib/polyfills/bswap (param $0 i64) (result i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - i32.const 1 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.const 8 - i64.shr_u - i64.const 71777214294589695 - i64.and - local.set $1 - local.get $0 - i64.const 71777214294589695 - i64.and - i64.const 8 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - local.set $3 - local.get $3 - i64.const 16 - i64.shr_u - i64.const 281470681808895 - i64.and - local.set $1 - local.get $3 - i64.const 281470681808895 - i64.and - i64.const 16 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - i64.const 32 - i64.rotr - return - ) - (func $~lib/polyfills/bswap (param $0 i64) (result i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - i32.const 1 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.const 8 - i64.shr_u - i64.const 71777214294589695 - i64.and - local.set $1 - local.get $0 - i64.const 71777214294589695 - i64.and - i64.const 8 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - local.set $3 - local.get $3 - i64.const 16 - i64.shr_u - i64.const 281470681808895 - i64.and - local.set $1 - local.get $3 - i64.const 281470681808895 - i64.and - i64.const 16 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - i64.const 32 - i64.rotr - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - return - ) - (func $~lib/polyfills/bswap (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $0 - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $0 - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $0 - i32.const 8 - i32.const 15 - i32.and - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.const 15 - i32.and - i32.shr_u - i32.or - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $0 - i32.const 8 - i32.const 15 - i32.and - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.const 15 - i32.and - i32.shr_u - i32.or - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const 255 - i32.and - i32.const 8 - i32.shl - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.or - local.get $0 - i32.const -65536 - i32.and - i32.or - return - ) - (func $~lib/polyfills/bswap16 (param $0 i32) (result i32) - i32.const 1 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.const 255 - i32.and - i32.const 8 - i32.shl - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.or - local.get $0 - i32.const -65536 - i32.and - i32.or - return - ) - (func $start:std/polyfills - i32.const 170 - call $~lib/polyfills/bswap - i32.const 255 - i32.and - i32.const 170 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 4 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 170 - call $~lib/polyfills/bswap - i32.extend8_s - i32.const 170 - i32.extend8_s - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 5 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 43707 - call $~lib/polyfills/bswap - i32.const 65535 - i32.and - i32.const 48042 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 8 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 43707 - call $~lib/polyfills/bswap - i32.extend16_s - i32.const 48042 - i32.extend16_s - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 9 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -1430532899 - call $~lib/polyfills/bswap - i32.const -573785174 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 12 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -1430532899 - call $~lib/polyfills/bswap - i32.const -573785174 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 13 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i64.const 4822679907192029 - call $~lib/polyfills/bswap - i64.const -2464388556401798912 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 16 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i64.const 4822679907192029 - call $~lib/polyfills/bswap - i64.const -2464388556401798912 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 17 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -1430532899 - call $~lib/polyfills/bswap - i32.const -573785174 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 20 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -1430532899 - call $~lib/polyfills/bswap - i32.const -573785174 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 21 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 170 - call $~lib/polyfills/bswap16 - i32.const 255 - i32.and - i32.const 170 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 24 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 170 - call $~lib/polyfills/bswap16 - i32.extend8_s - i32.const 170 - i32.extend8_s - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 25 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 43707 - call $~lib/polyfills/bswap16 - i32.const 65535 - i32.and - i32.const 48042 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 28 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 43707 - call $~lib/polyfills/bswap16 - i32.extend16_s - i32.const 48042 - i32.extend16_s - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 29 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -7820613 - call $~lib/polyfills/bswap16 - i32.const -7816278 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 32 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const -7820613 - call $~lib/polyfills/bswap16 - i32.const -7816278 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 33 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $~start - call $start:std/polyfills - ) -) diff --git a/tests/compiler/std/polyfills.json b/tests/compiler/std/polyfills.json deleted file mode 100644 index 1bdd02b1be..0000000000 --- a/tests/compiler/std/polyfills.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "asc_flags": [ - ] -} diff --git a/tests/compiler/std/polyfills.release.wat b/tests/compiler/std/polyfills.release.wat deleted file mode 100644 index 1053b15e80..0000000000 --- a/tests/compiler/std/polyfills.release.wat +++ /dev/null @@ -1,6 +0,0 @@ -(module - (memory $0 1) - (data (i32.const 1036) "<") - (data (i32.const 1048) "\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s") - (export "memory" (memory $0)) -) diff --git a/tests/compiler/std/polyfills.ts b/tests/compiler/std/polyfills.ts deleted file mode 100644 index c19a05bd0d..0000000000 --- a/tests/compiler/std/polyfills.ts +++ /dev/null @@ -1,33 +0,0 @@ -// bswap / bswap16 tests - -// check bswap for i8/u8 -assert(bswap(0xaa) == 0xaa); -assert(bswap(0xaa) == 0xaa); - -// check bswap for i16/u16 -assert(bswap(0xaabb) == 0xbbaa); -assert(bswap(0xaabb) == 0xbbaa); - -// check bswap for i32/u32 -assert(bswap(0xaabbccdd) == 0xddccbbaa); -assert(bswap(0xaabbccdd) == 0xddccbbaa); - -// check bswap for i64/u64 -assert(bswap(0x00112233aabbccdd) == 0xddccbbaa33221100); -assert(bswap(0x00112233aabbccdd) == 0xddccbbaa33221100); - -// check bswap for i32/u32 -assert(bswap(0xaabbccdd) == 0xddccbbaa); -assert(bswap(0xaabbccdd) == 0xddccbbaa); - -// check bswap16 for i8/u8 -assert(bswap16(0xaa) == 0xaa); -assert(bswap16(0xaa) == 0xaa); - -// check bswap16 for i16/u16 -assert(bswap16(0xaabb) == 0xbbaa); -assert(bswap16(0xaabb) == 0xbbaa); - -// check bswap16 for i32/u32 -assert(bswap16(0xff88aabb) == 0xff88bbaa); -assert(bswap16(0xff88aabb) == 0xff88bbaa); diff --git a/tests/compiler/std/typedarray.debug.wat b/tests/compiler/std/typedarray.debug.wat index e4400aaa40..e70cfe814c 100644 --- a/tests/compiler/std/typedarray.debug.wat +++ b/tests/compiler/std/typedarray.debug.wat @@ -45,7 +45,6 @@ (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) @@ -11766,63 +11765,6 @@ end end ) - (func $~lib/polyfills/bswap (param $0 i64) (result i64) - (local $1 i64) - (local $2 i64) - (local $3 i64) - i32.const 1 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.const 8 - i64.shr_u - i64.const 71777214294589695 - i64.and - local.set $1 - local.get $0 - i64.const 71777214294589695 - i64.and - i64.const 8 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - local.set $3 - local.get $3 - i64.const 16 - i64.shr_u - i64.const 281470681808895 - i64.and - local.set $1 - local.get $3 - i64.const 281470681808895 - i64.and - i64.const 16 - i64.shl - local.set $2 - local.get $1 - local.get $2 - i64.or - i64.const 32 - i64.rotr - return - ) (func $~lib/util/bytes/REVERSE (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -11831,9 +11773,11 @@ (local $6 i32) (local $7 i32) (local $8 i64) - (local $9 i32) - (local $10 i32) + (local $9 i64) + (local $10 i64) (local $11 i32) + (local $12 i32) + (local $13 i32) local.get $1 i32.const 1 i32.gt_u @@ -11877,12 +11821,58 @@ local.set $7 local.get $6 i64.load - call $~lib/polyfills/bswap + local.tee $8 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $8 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $9 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $9 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr local.set $8 local.get $6 local.get $7 i64.load - call $~lib/polyfills/bswap + local.tee $9 + i64.const 8 + i64.shr_u + i64.const 71777214294589695 + i64.and + local.get $9 + i64.const 71777214294589695 + i64.and + i64.const 8 + i64.shl + i64.or + local.tee $10 + i64.const 16 + i64.shr_u + i64.const 281470681808895 + i64.and + local.get $10 + i64.const 281470681808895 + i64.and + i64.const 16 + i64.shl + i64.or + i64.const 32 + i64.rotr i64.store local.get $7 local.get $8 @@ -11914,7 +11904,7 @@ i32.const 0 i32.shl i32.add - local.set $9 + local.set $11 local.get $0 local.get $3 local.get $2 @@ -11922,16 +11912,16 @@ i32.const 0 i32.shl i32.add - local.set $10 - local.get $9 + local.set $12 + local.get $11 i32.load8_u - local.set $11 - local.get $9 - local.get $10 + local.set $13 + local.get $11 + local.get $12 i32.load8_u i32.store8 - local.get $10 - local.get $11 + local.get $12 + local.get $13 i32.store8 local.get $2 i32.const 1 diff --git a/tests/compiler/std/typedarray.release.wat b/tests/compiler/std/typedarray.release.wat index a39f73ee29..083a150a99 100644 --- a/tests/compiler/std/typedarray.release.wat +++ b/tests/compiler/std/typedarray.release.wat @@ -3,9 +3,9 @@ (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i64_i32_i32_=>_i32 (func (param i64 i32 i32) (result i32))) (type $i64_i64_=>_i32 (func (param i64 i64) (result i32))) (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) @@ -5249,36 +5249,43 @@ f64.const 0 f64.eq ) - (func $~lib/util/bytes/REVERSE (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int8Array#reverse (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i64) - local.get $1 + (local $7 i32) + (local $8 i64) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $0 + i32.load offset=8 + local.tee $5 i32.const 1 i32.gt_u if - local.get $1 + local.get $5 i32.const 1 i32.shr_u local.set $4 - local.get $1 + local.get $5 i32.const 8 i32.sub - local.set $5 + local.set $6 loop $while-continue|0 - local.get $2 + local.get $1 i32.const 7 i32.add local.get $4 i32.lt_u if - local.get $0 + local.get $1 local.get $2 i32.add - local.tee $6 + local.tee $7 i64.load local.tee $3 i64.const 8 @@ -5292,31 +5299,31 @@ i64.shl i64.or local.set $3 + local.get $7 + local.get $2 local.get $6 - local.get $0 - local.get $5 i32.add - local.get $2 + local.get $1 i32.sub - local.tee $6 - i64.load local.tee $7 + i64.load + local.tee $8 i64.const 8 i64.shr_u i64.const 71777214294589695 i64.and - local.get $7 + local.get $8 i64.const 71777214294589695 i64.and i64.const 8 i64.shl i64.or - local.tee $7 + local.tee $8 i64.const 16 i64.shr_u i64.const 281470681808895 i64.and - local.get $7 + local.get $8 i64.const 281470681808895 i64.and i64.const 16 @@ -5325,7 +5332,7 @@ i64.const 32 i64.rotr i64.store - local.get $6 + local.get $7 local.get $3 i64.const 16 i64.shr_u @@ -5340,48 +5347,49 @@ i64.const 32 i64.rotr i64.store - local.get $2 + local.get $1 i32.const 8 i32.add - local.set $2 + local.set $1 br $while-continue|0 end end - local.get $1 + local.get $5 i32.const 1 i32.sub - local.set $1 + local.set $5 loop $while-continue|1 - local.get $2 + local.get $1 local.get $4 i32.lt_u if - local.get $0 + local.get $1 local.get $2 i32.add - local.tee $5 + local.tee $6 i32.load8_u - local.set $6 + local.set $7 + local.get $6 + local.get $2 local.get $5 - local.get $0 local.get $1 - local.get $2 i32.sub i32.add - local.tee $5 + local.tee $6 i32.load8_u i32.store8 - local.get $5 local.get $6 + local.get $7 i32.store8 - local.get $2 + local.get $1 i32.const 1 i32.add - local.set $2 + local.set $1 br $while-continue|1 end end end + local.get $0 ) (func $~lib/typedarray/Int16Array#reverse (param $0 i32) (result i32) (local $1 i32) @@ -42538,36 +42546,36 @@ i32.const 32 i32.sub global.set $~lib/memory/__stack_pointer - block $folding-inner41 - block $folding-inner40 - block $folding-inner39 - block $folding-inner38 - block $folding-inner37 - block $folding-inner36 - block $folding-inner35 - block $folding-inner34 - block $folding-inner33 - block $folding-inner32 - block $folding-inner31 - block $folding-inner30 - block $folding-inner29 - block $folding-inner28 - block $folding-inner27 - block $folding-inner26 - block $folding-inner25 - block $folding-inner24 - block $folding-inner23 - block $folding-inner22 - block $folding-inner18 - block $folding-inner17 - block $folding-inner16 - block $folding-inner21 - block $folding-inner20 - block $folding-inner19 - block $folding-inner15 - block $folding-inner14 - block $folding-inner13 - block $folding-inner12 + block $folding-inner36 + block $folding-inner35 + block $folding-inner34 + block $folding-inner33 + block $folding-inner32 + block $folding-inner31 + block $folding-inner30 + block $folding-inner29 + block $folding-inner28 + block $folding-inner27 + block $folding-inner26 + block $folding-inner25 + block $folding-inner24 + block $folding-inner23 + block $folding-inner22 + block $folding-inner18 + block $folding-inner17 + block $folding-inner16 + block $folding-inner21 + block $folding-inner20 + block $folding-inner19 + block $folding-inner15 + block $folding-inner14 + block $folding-inner13 + block $folding-inner12 + block $folding-inner11 + block $folding-inner10 + block $folding-inner9 + block $folding-inner8 + block $folding-inner7 block $folding-inner6 block $folding-inner5 block $folding-inner4 @@ -55098,8 +55106,6 @@ i32.const 12 i32.add global.set $~lib/memory/__stack_pointer - i32.const 0 - local.set $9 global.get $~lib/memory/__stack_pointer i32.const 20 i32.sub @@ -55128,61 +55134,61 @@ call $~lib/typedarray/Int8Array#constructor local.tee $1 i32.store offset=8 - loop $for-loop|0114 + i32.const 0 + local.set $16 + loop $for-loop|0171 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.extend8_s call $~lib/typedarray/Int8Array#__set local.get $1 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.extend8_s call $~lib/typedarray/Int8Array#__set - local.get $9 + local.get $16 i32.const 1 i32.add - local.set $9 - br $for-loop|0114 + local.set $16 + br $for-loop|0171 end end local.get $2 - i32.load offset=4 - local.get $2 - i32.load offset=8 - call $~lib/util/bytes/REVERSE + call $~lib/typedarray/Int8Array#reverse + drop i32.const 0 - local.set $9 + local.set $16 loop $for-loop|1 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 call $~lib/typedarray/Int8Array#__get i32.const 7616 local.get $3 i32.const 1 i32.sub - local.get $9 + local.get $16 i32.sub call $~lib/array/Array#__get i32.extend8_s i32.ne - br_if $folding-inner31 - local.get $9 + br_if $folding-inner7 + local.get $16 i32.const 1 i32.add - local.set $9 + local.set $16 br $for-loop|1 end end @@ -55196,42 +55202,37 @@ local.get $1 i32.store offset=12 local.get $1 - i32.load offset=4 - local.get $1 - i32.load offset=8 - call $~lib/util/bytes/REVERSE - local.get $1 + call $~lib/typedarray/Int8Array#reverse + local.tee $1 i32.store offset=16 local.get $1 i32.const 0 call $~lib/typedarray/Int8Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $1 i32.const 1 call $~lib/typedarray/Int8Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $1 i32.const 2 call $~lib/typedarray/Int8Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $1 i32.const 3 call $~lib/typedarray/Int8Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add global.set $~lib/memory/__stack_pointer - i32.const 0 - local.set $9 global.get $~lib/memory/__stack_pointer i32.const 20 i32.sub @@ -55260,65 +55261,65 @@ call $~lib/typedarray/Uint8Array#constructor local.tee $1 i32.store offset=8 - loop $for-loop|0115 + i32.const 0 + local.set $16 + loop $for-loop|02136 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.const 255 i32.and call $~lib/typedarray/Uint8Array#__set local.get $1 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.const 255 i32.and call $~lib/typedarray/Uint8Array#__set - local.get $9 + local.get $16 i32.const 1 i32.add - local.set $9 - br $for-loop|0115 + local.set $16 + br $for-loop|02136 end end local.get $2 - i32.load offset=4 - local.get $2 - i32.load offset=8 - call $~lib/util/bytes/REVERSE + call $~lib/typedarray/Int8Array#reverse + drop i32.const 0 - local.set $9 - loop $for-loop|1116 + local.set $16 + loop $for-loop|124 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 call $~lib/typedarray/Uint8Array#__get i32.const 7616 local.get $3 i32.const 1 i32.sub - local.get $9 + local.get $16 i32.sub call $~lib/array/Array#__get i32.const 255 i32.and i32.ne - br_if $folding-inner31 - local.get $9 + br_if $folding-inner7 + local.get $16 i32.const 1 i32.add - local.set $9 - br $for-loop|1116 + local.set $16 + br $for-loop|124 end end global.get $~lib/memory/__stack_pointer @@ -55330,42 +55331,37 @@ local.get $1 i32.store offset=12 local.get $1 - i32.load offset=4 - local.get $1 - i32.load offset=8 - call $~lib/util/bytes/REVERSE - local.get $1 + call $~lib/typedarray/Int8Array#reverse + local.tee $1 i32.store offset=16 local.get $1 i32.const 0 call $~lib/typedarray/Uint8Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $1 i32.const 1 call $~lib/typedarray/Uint8Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $1 i32.const 2 call $~lib/typedarray/Uint8Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $1 i32.const 3 call $~lib/typedarray/Uint8Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add global.set $~lib/memory/__stack_pointer - i32.const 0 - local.set $9 global.get $~lib/memory/__stack_pointer i32.const 20 i32.sub @@ -55394,65 +55390,65 @@ call $~lib/typedarray/Uint8ClampedArray#constructor local.tee $1 i32.store offset=8 - loop $for-loop|0117 + i32.const 0 + local.set $16 + loop $for-loop|029 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.const 255 i32.and call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 - local.get $9 + local.get $16 i32.const 7616 - local.get $9 + local.get $16 call $~lib/array/Array#__get i32.const 255 i32.and call $~lib/typedarray/Uint8ClampedArray#__set - local.get $9 + local.get $16 i32.const 1 i32.add - local.set $9 - br $for-loop|0117 + local.set $16 + br $for-loop|029 end end local.get $2 - i32.load offset=4 - local.get $2 - i32.load offset=8 - call $~lib/util/bytes/REVERSE + call $~lib/typedarray/Int8Array#reverse + drop i32.const 0 - local.set $9 - loop $for-loop|1118 + local.set $16 + loop $for-loop|132 local.get $3 - local.get $9 + local.get $16 i32.gt_s if local.get $2 - local.get $9 + local.get $16 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 7616 local.get $3 i32.const 1 i32.sub - local.get $9 + local.get $16 i32.sub call $~lib/array/Array#__get i32.const 255 i32.and i32.ne - br_if $folding-inner31 - local.get $9 + br_if $folding-inner7 + local.get $16 i32.const 1 i32.add - local.set $9 - br $for-loop|1118 + local.set $16 + br $for-loop|132 end end global.get $~lib/memory/__stack_pointer @@ -55464,36 +55460,33 @@ local.get $1 i32.store offset=12 local.get $1 - i32.load offset=4 - local.get $1 - i32.load offset=8 - call $~lib/util/bytes/REVERSE - local.get $1 + call $~lib/typedarray/Int8Array#reverse + local.tee $1 i32.store offset=16 local.get $1 i32.const 0 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $1 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $1 i32.const 3 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -55528,7 +55521,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|0171 + loop $for-loop|037175 local.get $3 local.get $16 i32.gt_s @@ -55551,7 +55544,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0171 + br $for-loop|037175 end end local.get $2 @@ -55559,7 +55552,7 @@ drop i32.const 0 local.set $16 - loop $for-loop|1119 + loop $for-loop|140 local.get $3 local.get $16 i32.gt_s @@ -55576,12 +55569,12 @@ call $~lib/array/Array#__get i32.extend16_s i32.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|1119 + br $for-loop|140 end end global.get $~lib/memory/__stack_pointer @@ -55601,25 +55594,25 @@ call $~lib/typedarray/Int16Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $1 i32.const 1 call $~lib/typedarray/Int16Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $1 i32.const 2 call $~lib/typedarray/Int16Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $1 i32.const 3 call $~lib/typedarray/Int16Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -55654,7 +55647,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|02136 + loop $for-loop|045114 local.get $3 local.get $16 i32.gt_s @@ -55679,7 +55672,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|02136 + br $for-loop|045114 end end local.get $2 @@ -55687,7 +55680,7 @@ drop i32.const 0 local.set $16 - loop $for-loop|124 + loop $for-loop|148 local.get $3 local.get $16 i32.gt_s @@ -55705,12 +55698,12 @@ i32.const 65535 i32.and i32.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|124 + br $for-loop|148 end end global.get $~lib/memory/__stack_pointer @@ -55730,25 +55723,25 @@ call $~lib/typedarray/Uint16Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $1 i32.const 1 call $~lib/typedarray/Uint16Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $1 i32.const 2 call $~lib/typedarray/Uint16Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $1 i32.const 3 call $~lib/typedarray/Uint16Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -55783,7 +55776,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|029 + loop $for-loop|053115 local.get $11 local.get $16 i32.gt_s @@ -55804,7 +55797,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|029 + br $for-loop|053115 end end local.get $9 @@ -55863,7 +55856,7 @@ end i32.const 0 local.set $16 - loop $for-loop|132 + loop $for-loop|156 local.get $11 local.get $16 i32.gt_s @@ -55879,12 +55872,12 @@ i32.sub call $~lib/array/Array#__get i32.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|132 + br $for-loop|156 end end global.get $~lib/memory/__stack_pointer @@ -55917,7 +55910,7 @@ i32.const 1 i32.sub local.set $3 - loop $while-continue|0121 + loop $while-continue|0117 local.get $1 local.get $4 i32.lt_u @@ -55948,7 +55941,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0121 + br $while-continue|0117 end end end @@ -55959,25 +55952,25 @@ call $~lib/typedarray/Int32Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $7 i32.const 1 call $~lib/typedarray/Int32Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $7 i32.const 2 call $~lib/typedarray/Int32Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $7 i32.const 3 call $~lib/typedarray/Int32Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -56012,7 +56005,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|037175 + loop $for-loop|061 local.get $11 local.get $16 i32.gt_s @@ -56033,7 +56026,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|037175 + br $for-loop|061 end end i32.const 0 @@ -56057,7 +56050,7 @@ i32.const 1 i32.sub local.set $3 - loop $while-continue|0123 + loop $while-continue|0119 local.get $0 local.get $4 i32.lt_u @@ -56088,13 +56081,13 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0123 + br $while-continue|0119 end end end i32.const 0 local.set $16 - loop $for-loop|140 + loop $for-loop|164 local.get $11 local.get $16 i32.gt_s @@ -56110,12 +56103,12 @@ i32.sub call $~lib/array/Array#__get i32.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|140 + br $for-loop|164 end end global.get $~lib/memory/__stack_pointer @@ -56147,7 +56140,7 @@ i32.const 1 i32.sub local.set $3 - loop $while-continue|0125 + loop $while-continue|0121 local.get $1 local.get $4 i32.lt_u @@ -56178,7 +56171,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0125 + br $while-continue|0121 end end end @@ -56189,25 +56182,25 @@ call $~lib/typedarray/Uint32Array#__get i32.const 8 i32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $7 i32.const 1 call $~lib/typedarray/Uint32Array#__get i32.const 7 i32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $7 i32.const 2 call $~lib/typedarray/Uint32Array#__get i32.const 6 i32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $7 i32.const 3 call $~lib/typedarray/Uint32Array#__get i32.const 5 i32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -56242,7 +56235,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|045126 + loop $for-loop|069 local.get $9 local.get $16 i32.gt_s @@ -56265,7 +56258,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|045126 + br $for-loop|069 end end i32.const 0 @@ -56289,7 +56282,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0127 + loop $while-continue|0122 local.get $0 local.get $3 i32.lt_u @@ -56320,13 +56313,13 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0127 + br $while-continue|0122 end end end i32.const 0 local.set $16 - loop $for-loop|148 + loop $for-loop|172 local.get $9 local.get $16 i32.gt_s @@ -56343,12 +56336,12 @@ call $~lib/array/Array#__get i64.extend_i32_s i64.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|148 + br $for-loop|172 end end global.get $~lib/memory/__stack_pointer @@ -56380,7 +56373,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0129 + loop $while-continue|0124 local.get $1 local.get $3 i32.lt_u @@ -56411,7 +56404,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0129 + br $while-continue|0124 end end end @@ -56422,25 +56415,25 @@ call $~lib/typedarray/Int64Array#__get i64.const 8 i64.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $5 i32.const 1 call $~lib/typedarray/Int64Array#__get i64.const 7 i64.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $5 i32.const 2 call $~lib/typedarray/Int64Array#__get i64.const 6 i64.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $5 i32.const 3 call $~lib/typedarray/Int64Array#__get i64.const 5 i64.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -56475,7 +56468,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|053130 + loop $for-loop|077125 local.get $9 local.get $16 i32.gt_s @@ -56498,7 +56491,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|053130 + br $for-loop|077125 end end i32.const 0 @@ -56522,7 +56515,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0132 + loop $while-continue|0127 local.get $0 local.get $3 i32.lt_u @@ -56553,13 +56546,13 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0132 + br $while-continue|0127 end end end i32.const 0 local.set $16 - loop $for-loop|156 + loop $for-loop|180 local.get $9 local.get $16 i32.gt_s @@ -56576,12 +56569,12 @@ call $~lib/array/Array#__get i64.extend_i32_s i64.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|156 + br $for-loop|180 end end global.get $~lib/memory/__stack_pointer @@ -56613,7 +56606,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0134 + loop $while-continue|0129 local.get $1 local.get $3 i32.lt_u @@ -56644,7 +56637,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0134 + br $while-continue|0129 end end end @@ -56655,25 +56648,25 @@ call $~lib/typedarray/Uint64Array#__get i64.const 8 i64.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $5 i32.const 1 call $~lib/typedarray/Uint64Array#__get i64.const 7 i64.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $5 i32.const 2 call $~lib/typedarray/Uint64Array#__get i64.const 6 i64.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $5 i32.const 3 call $~lib/typedarray/Uint64Array#__get i64.const 5 i64.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -56708,7 +56701,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|061 + loop $for-loop|085 local.get $9 local.get $16 i32.gt_s @@ -56731,7 +56724,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|061 + br $for-loop|085 end end i32.const 0 @@ -56755,7 +56748,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0135 + loop $while-continue|0130 local.get $0 local.get $3 i32.lt_u @@ -56786,13 +56779,13 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0135 + br $while-continue|0130 end end end i32.const 0 local.set $16 - loop $for-loop|164 + loop $for-loop|188 local.get $9 local.get $16 i32.gt_s @@ -56809,12 +56802,12 @@ call $~lib/array/Array#__get f32.convert_i32_s f32.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|164 + br $for-loop|188 end end global.get $~lib/memory/__stack_pointer @@ -56846,7 +56839,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0137 + loop $while-continue|0132 local.get $1 local.get $3 i32.lt_u @@ -56877,7 +56870,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0137 + br $while-continue|0132 end end end @@ -56888,25 +56881,25 @@ call $~lib/typedarray/Float32Array#__get f32.const 8 f32.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $5 i32.const 1 call $~lib/typedarray/Float32Array#__get f32.const 7 f32.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $5 i32.const 2 call $~lib/typedarray/Float32Array#__get f32.const 6 f32.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $5 i32.const 3 call $~lib/typedarray/Float32Array#__get f32.const 5 f32.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -56941,7 +56934,7 @@ i32.store offset=8 i32.const 0 local.set $16 - loop $for-loop|069 + loop $for-loop|093 local.get $9 local.get $16 i32.gt_s @@ -56964,7 +56957,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|069 + br $for-loop|093 end end i32.const 0 @@ -56988,7 +56981,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0138 + loop $while-continue|0133 local.get $0 local.get $3 i32.lt_u @@ -57019,13 +57012,13 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0138 + br $while-continue|0133 end end end i32.const 0 local.set $16 - loop $for-loop|172 + loop $for-loop|196 local.get $9 local.get $16 i32.gt_s @@ -57042,12 +57035,12 @@ call $~lib/array/Array#__get f64.convert_i32_s f64.ne - br_if $folding-inner31 + br_if $folding-inner7 local.get $16 i32.const 1 i32.add local.set $16 - br $for-loop|172 + br $for-loop|196 end end global.get $~lib/memory/__stack_pointer @@ -57080,7 +57073,7 @@ i32.const 1 i32.sub local.set $2 - loop $while-continue|0140 + loop $while-continue|0135 local.get $1 local.get $3 i32.lt_u @@ -57111,7 +57104,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|0140 + br $while-continue|0135 end end end @@ -57122,25 +57115,25 @@ call $~lib/typedarray/Float64Array#__get f64.const 8 f64.ne - br_if $folding-inner32 + br_if $folding-inner8 local.get $5 i32.const 1 call $~lib/typedarray/Float64Array#__get f64.const 7 f64.ne - br_if $folding-inner33 + br_if $folding-inner9 local.get $5 i32.const 2 call $~lib/typedarray/Float64Array#__get f64.const 6 f64.ne - br_if $folding-inner34 + br_if $folding-inner10 local.get $5 i32.const 3 call $~lib/typedarray/Float64Array#__get f64.const 5 f64.ne - br_if $folding-inner35 + br_if $folding-inner11 global.get $~lib/memory/__stack_pointer i32.const 20 i32.add @@ -57180,7 +57173,7 @@ local.get $4 i32.load offset=4 local.set $2 - loop $while-continue|0141 + loop $while-continue|0136 local.get $0 local.get $3 i32.lt_s @@ -57199,7 +57192,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0141 + br $while-continue|0136 end end i32.const -1 @@ -57231,7 +57224,7 @@ local.get $4 i32.load offset=4 local.set $0 - loop $while-continue|0142 + loop $while-continue|0137 local.get $1 local.get $16 i32.gt_s @@ -57256,7 +57249,7 @@ i32.const 1 i32.add local.set $16 - br $while-continue|0142 + br $while-continue|0137 end end i32.const 0 @@ -57294,7 +57287,7 @@ local.get $4 i32.load offset=4 local.set $2 - loop $while-continue|0143 + loop $while-continue|0138 local.get $0 local.get $3 i32.lt_s @@ -57313,7 +57306,7 @@ i32.const 1 i32.add local.set $0 - br $while-continue|0143 + br $while-continue|0138 end end i32.const -1 @@ -57345,7 +57338,7 @@ local.get $4 i32.load offset=4 local.set $0 - loop $while-continue|077 + loop $while-continue|0101 local.get $1 local.get $2 i32.lt_s @@ -57370,7 +57363,7 @@ i32.const 1 i32.add local.set $1 - br $while-continue|077 + br $while-continue|0101 end end i32.const 0 @@ -58453,7 +58446,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|083 + loop $for-loop|0107139 local.get $5 local.get $16 i32.gt_s @@ -58469,7 +58462,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|083 + br $for-loop|0107139 end end global.get $~lib/memory/__stack_pointer @@ -58542,7 +58535,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|187 + loop $for-loop|1111 local.get $5 local.get $16 i32.gt_s @@ -58559,7 +58552,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|187 + br $for-loop|1111 end end global.get $~lib/memory/__stack_pointer @@ -58591,7 +58584,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|092144 + loop $for-loop|0116200 local.get $3 local.get $16 i32.gt_s @@ -58608,7 +58601,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|092144 + br $for-loop|0116200 end end global.get $~lib/memory/__stack_pointer @@ -58642,7 +58635,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|197 + loop $for-loop|1121 local.get $3 local.get $16 i32.gt_s @@ -58659,7 +58652,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|197 + br $for-loop|1121 end end global.get $~lib/memory/__stack_pointer @@ -58691,7 +58684,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0102145 + loop $for-loop|0126 local.get $5 local.get $16 i32.gt_s @@ -58708,7 +58701,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0102145 + br $for-loop|0126 end end global.get $~lib/memory/__stack_pointer @@ -58781,7 +58774,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1107 + loop $for-loop|1131 local.get $5 local.get $16 i32.gt_s @@ -58798,7 +58791,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1107 + br $for-loop|1131 end end global.get $~lib/memory/__stack_pointer @@ -58830,7 +58823,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0112147 + loop $for-loop|0136 local.get $5 local.get $16 i32.gt_s @@ -58846,7 +58839,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0112147 + br $for-loop|0136 end end global.get $~lib/memory/__stack_pointer @@ -58921,7 +58914,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1117 + loop $for-loop|1141 local.get $5 local.get $16 i32.gt_s @@ -58938,7 +58931,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1117 + br $for-loop|1141 end end global.get $~lib/memory/__stack_pointer @@ -58970,7 +58963,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0122 + loop $for-loop|0146 local.get $5 local.get $16 i32.gt_s @@ -58987,7 +58980,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0122 + br $for-loop|0146 end end global.get $~lib/memory/__stack_pointer @@ -59062,7 +59055,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1127 + loop $for-loop|1151 local.get $5 local.get $16 i32.gt_s @@ -59079,7 +59072,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1127 + br $for-loop|1151 end end global.get $~lib/memory/__stack_pointer @@ -59111,7 +59104,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0132 + loop $for-loop|0156 local.get $5 local.get $16 i32.gt_s @@ -59126,7 +59119,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0132 + br $for-loop|0156 end end global.get $~lib/memory/__stack_pointer @@ -59201,7 +59194,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1137 + loop $for-loop|1161 local.get $5 local.get $16 i32.gt_s @@ -59218,7 +59211,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1137 + br $for-loop|1161 end end global.get $~lib/memory/__stack_pointer @@ -59250,7 +59243,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0142 + loop $for-loop|0166 local.get $5 local.get $16 i32.gt_s @@ -59265,7 +59258,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0142 + br $for-loop|0166 end end global.get $~lib/memory/__stack_pointer @@ -59340,7 +59333,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1147 + loop $for-loop|1171 local.get $5 local.get $16 i32.gt_s @@ -59357,7 +59350,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1147 + br $for-loop|1171 end end global.get $~lib/memory/__stack_pointer @@ -59389,7 +59382,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0152 + loop $for-loop|0176 local.get $5 local.get $16 i32.gt_s @@ -59405,7 +59398,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0152 + br $for-loop|0176 end end global.get $~lib/memory/__stack_pointer @@ -59480,7 +59473,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1157 + loop $for-loop|1181 local.get $5 local.get $16 i32.gt_s @@ -59497,7 +59490,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1157 + br $for-loop|1181 end end global.get $~lib/memory/__stack_pointer @@ -59529,7 +59522,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0162 + loop $for-loop|0186 local.get $5 local.get $16 i32.gt_s @@ -59545,7 +59538,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0162 + br $for-loop|0186 end end global.get $~lib/memory/__stack_pointer @@ -59620,7 +59613,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1167 + loop $for-loop|1191 local.get $5 local.get $16 i32.gt_s @@ -59637,7 +59630,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1167 + br $for-loop|1191 end end global.get $~lib/memory/__stack_pointer @@ -59669,7 +59662,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0172 + loop $for-loop|0196 local.get $5 local.get $16 i32.gt_s @@ -59685,7 +59678,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0172 + br $for-loop|0196 end end global.get $~lib/memory/__stack_pointer @@ -59760,7 +59753,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1177 + loop $for-loop|1201 local.get $5 local.get $16 i32.gt_s @@ -59777,7 +59770,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1177 + br $for-loop|1201 end end global.get $~lib/memory/__stack_pointer @@ -59809,7 +59802,7 @@ i32.store offset=4 i32.const 0 local.set $16 - loop $for-loop|0182 + loop $for-loop|0206 local.get $5 local.get $16 i32.gt_s @@ -59825,7 +59818,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|0182 + br $for-loop|0206 end end global.get $~lib/memory/__stack_pointer @@ -59900,7 +59893,7 @@ i32.store offset=16 i32.const 0 local.set $16 - loop $for-loop|1187 + loop $for-loop|1211 local.get $5 local.get $16 i32.gt_s @@ -59917,7 +59910,7 @@ i32.const 1 i32.add local.set $16 - br $for-loop|1187 + br $for-loop|1211 end end global.get $~lib/memory/__stack_pointer @@ -60012,7 +60005,7 @@ local.set $0 i32.const 0 local.set $1 - loop $for-loop|0192 + loop $for-loop|0216 local.get $1 local.get $3 i32.lt_s @@ -60044,7 +60037,7 @@ i32.const 1 i32.add local.set $1 - br $for-loop|0192 + br $for-loop|0216 end end local.get $7 @@ -60072,7 +60065,7 @@ local.set $2 i32.const 0 local.set $1 - loop $for-loop|0197 + loop $for-loop|0221 local.get $1 local.get $4 i32.lt_s @@ -60104,7 +60097,7 @@ i32.const 1 i32.add local.set $1 - br $for-loop|0197 + br $for-loop|0221 end end i32.const 10 @@ -60178,7 +60171,7 @@ local.set $2 i32.const 0 local.set $1 - loop $for-loop|0202 + loop $for-loop|0226 local.get $1 local.get $4 i32.lt_s @@ -60203,7 +60196,7 @@ i32.const 1 i32.add local.set $1 - br $for-loop|0202 + br $for-loop|0226 end end local.get $7 @@ -60301,19 +60294,19 @@ call $~lib/typedarray/Int8Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Int8Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Int8Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15376 i32.store offset=8 @@ -60328,19 +60321,19 @@ call $~lib/typedarray/Int8Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Int8Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Int8Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -60393,11 +60386,11 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of1158 - block $0of1159 - block $outOfRange160 + block $1of1151 + block $0of1152 + block $outOfRange153 global.get $~argumentsLength - br_table $0of1159 $1of1158 $outOfRange160 + br_table $0of1152 $1of1151 $outOfRange153 end unreachable end @@ -60424,19 +60417,19 @@ call $~lib/typedarray/Uint8Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Uint8Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Uint8Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15440 i32.store offset=8 @@ -60451,19 +60444,19 @@ call $~lib/typedarray/Uint8Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Uint8Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Uint8Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -60516,11 +60509,11 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $1of1162 - block $0of1163 - block $outOfRange164 + block $1of1155 + block $0of1156 + block $outOfRange157 global.get $~argumentsLength - br_table $0of1163 $1of1162 $outOfRange164 + br_table $0of1156 $1of1155 $outOfRange157 end unreachable end @@ -60547,19 +60540,19 @@ call $~lib/typedarray/Uint8ClampedArray#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15504 i32.store offset=8 @@ -60574,19 +60567,19 @@ call $~lib/typedarray/Uint8ClampedArray#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -60672,19 +60665,19 @@ call $~lib/typedarray/Int16Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Int16Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Int16Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15568 i32.store offset=8 @@ -60701,19 +60694,19 @@ call $~lib/typedarray/Int16Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Int16Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Int16Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -60799,19 +60792,19 @@ call $~lib/typedarray/Uint16Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Uint16Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Uint16Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15632 i32.store offset=8 @@ -60828,19 +60821,19 @@ call $~lib/typedarray/Uint16Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Uint16Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Uint16Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -60926,19 +60919,19 @@ call $~lib/typedarray/Int32Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Int32Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Int32Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15696 i32.store offset=8 @@ -60955,19 +60948,19 @@ call $~lib/typedarray/Int32Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Int32Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Int32Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61053,19 +61046,19 @@ call $~lib/typedarray/Uint32Array#__get i32.const 1 i32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Uint32Array#__get i32.const 2 i32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Uint32Array#__get i32.const 3 i32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15760 i32.store offset=8 @@ -61082,19 +61075,19 @@ call $~lib/typedarray/Uint32Array#__get i32.const 3 i32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Uint32Array#__get i32.const 2 i32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Uint32Array#__get i32.const 1 i32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61180,19 +61173,19 @@ call $~lib/typedarray/Int64Array#__get i64.const 1 i64.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Int64Array#__get i64.const 2 i64.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Int64Array#__get i64.const 3 i64.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15824 i32.store offset=8 @@ -61209,19 +61202,19 @@ call $~lib/typedarray/Int64Array#__get i64.const 3 i64.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Int64Array#__get i64.const 2 i64.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Int64Array#__get i64.const 1 i64.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61307,19 +61300,19 @@ call $~lib/typedarray/Uint64Array#__get i64.const 1 i64.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Uint64Array#__get i64.const 2 i64.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Uint64Array#__get i64.const 3 i64.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15888 i32.store offset=8 @@ -61336,19 +61329,19 @@ call $~lib/typedarray/Uint64Array#__get i64.const 3 i64.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Uint64Array#__get i64.const 2 i64.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Uint64Array#__get i64.const 1 i64.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61434,19 +61427,19 @@ call $~lib/typedarray/Float32Array#__get f32.const 1 f32.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $2 i32.const 1 call $~lib/typedarray/Float32Array#__get f32.const 2 f32.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $2 i32.const 2 call $~lib/typedarray/Float32Array#__get f32.const 3 f32.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15952 i32.store offset=8 @@ -61463,19 +61456,19 @@ call $~lib/typedarray/Float32Array#__get f32.const 3 f32.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $2 i32.const 1 call $~lib/typedarray/Float32Array#__get f32.const 2 f32.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $2 i32.const 2 call $~lib/typedarray/Float32Array#__get f32.const 1 f32.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61524,19 +61517,19 @@ call $~lib/typedarray/Float64Array#__get f64.const 1 f64.ne - br_if $folding-inner36 + br_if $folding-inner31 local.get $0 i32.const 1 call $~lib/typedarray/Float64Array#__get f64.const 2 f64.ne - br_if $folding-inner37 + br_if $folding-inner32 local.get $0 i32.const 2 call $~lib/typedarray/Float64Array#__get f64.const 3 f64.ne - br_if $folding-inner38 + br_if $folding-inner33 global.get $~lib/memory/__stack_pointer i32.const 15984 i32.store offset=8 @@ -61553,19 +61546,19 @@ call $~lib/typedarray/Float64Array#__get f64.const 3 f64.ne - br_if $folding-inner39 + br_if $folding-inner34 local.get $0 i32.const 1 call $~lib/typedarray/Float64Array#__get f64.const 2 f64.ne - br_if $folding-inner40 + br_if $folding-inner35 local.get $0 i32.const 2 call $~lib/typedarray/Float64Array#__get f64.const 1 f64.ne - br_if $folding-inner41 + br_if $folding-inner36 global.get $~lib/memory/__stack_pointer i32.const 12 i32.add @@ -61576,12 +61569,12 @@ i32.const 0 i32.gt_s if - loop $while-continue|0206 + loop $while-continue|0230 global.get $~lib/rt/itcms/state if call $~lib/rt/itcms/step drop - br $while-continue|0206 + br $while-continue|0230 end end end @@ -61655,168 +61648,168 @@ end i32.const 0 i32.const 1568 - i32.const 675 + i32.const 570 i32.const 5 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 676 - i32.const 5 + i32.const 575 + i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 672 - i32.const 5 + i32.const 576 + i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 673 - i32.const 5 + i32.const 577 + i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 730 - i32.const 5 + i32.const 578 + i32.const 3 call $~lib/builtins/abort unreachable end - i32.const 1056 - i32.const 1632 - i32.const 1865 - i32.const 9 + i32.const 0 + i32.const 1568 + i32.const 675 + i32.const 5 call $~lib/builtins/abort unreachable end - i32.const 1360 - i32.const 1632 - i32.const 1902 + i32.const 0 + i32.const 1568 + i32.const 676 i32.const 5 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 388 - i32.const 3 + i32.const 672 + i32.const 5 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 389 - i32.const 3 + i32.const 673 + i32.const 5 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 390 - i32.const 3 + i32.const 730 + i32.const 5 call $~lib/builtins/abort unreachable end - i32.const 33040 - i32.const 33088 - i32.const 1 - i32.const 1 + i32.const 1056 + i32.const 1632 + i32.const 1865 + i32.const 9 call $~lib/builtins/abort unreachable end - i32.const 0 - i32.const 1568 - i32.const 438 - i32.const 3 + i32.const 1360 + i32.const 1632 + i32.const 1902 + i32.const 5 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 440 + i32.const 388 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 461 + i32.const 389 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 463 + i32.const 390 i32.const 3 call $~lib/builtins/abort unreachable end - i32.const 0 - i32.const 1568 - i32.const 484 - i32.const 3 + i32.const 33040 + i32.const 33088 + i32.const 1 + i32.const 1 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 486 + i32.const 438 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 507 + i32.const 440 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 509 + i32.const 461 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 570 - i32.const 5 + i32.const 463 + i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 575 + i32.const 484 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 576 + i32.const 486 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 577 + i32.const 507 i32.const 3 call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1568 - i32.const 578 + i32.const 509 i32.const 3 call $~lib/builtins/abort unreachable