diff --git a/package-lock.json b/package-lock.json index fccff050c9..f7c90fb853 100644 --- a/package-lock.json +++ b/package-lock.json @@ -572,9 +572,9 @@ "dev": true }, "binaryen": { - "version": "89.0.0-nightly.20190918", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-89.0.0-nightly.20190918.tgz", - "integrity": "sha512-3ToFheQo+qOg3N8IFArHqLEcKljmTA++DQxcyLAvMYvc0GsTlPWdXAj4BAndi1IngQqAXUQRx8LdIxPAddTxww==" + "version": "89.0.0-nightly.20191012", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-89.0.0-nightly.20191012.tgz", + "integrity": "sha512-ipKFZEyrMnFuEPCzEsXZ80DwZhGzrPldQ+vtcyCfdr8O75PKawfll1gmdWg4sUtzjSnfdvK9NiYfzm021lDNUg==" }, "bluebird": { "version": "3.5.5", diff --git a/package.json b/package.json index d008faa551..44f48c71f0 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@protobufjs/utf8": "^1.1.0", - "binaryen": "89.0.0-nightly.20190918", + "binaryen": "89.0.0-nightly.20191012", "glob": "^7.1.4", "long": "^4.0.0", "opencollective-postinstall": "^2.0.0", diff --git a/src/builtins.ts b/src/builtins.ts index 3d69a96450..1de377d9e2 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -52,7 +52,8 @@ import { getConstValueF32, getConstValueF64, Relooper, - RelooperBlockRef + RelooperBlockRef, + SIMDLoadOp } from "./module"; import { @@ -296,6 +297,9 @@ export namespace BuiltinSymbols { export const v128_extract_lane = "~lib/builtins/v128.extract_lane"; export const v128_replace_lane = "~lib/builtins/v128.replace_lane"; export const v128_shuffle = "~lib/builtins/v128.shuffle"; + export const v128_swizzle = "~lib/builtins/v128.swizzle"; + export const v128_load_splat = "~lib/builtins/v128.load_splat"; + export const v128_load_ext = "~lib/builtins/v128.load_ext"; export const v128_load = "~lib/builtins/v128.load"; export const v128_store = "~lib/builtins/v128.store"; export const v128_add = "~lib/builtins/v128.add"; @@ -310,6 +314,7 @@ export namespace BuiltinSymbols { export const v128_and = "~lib/builtins/v128.and"; export const v128_or = "~lib/builtins/v128.or"; export const v128_xor = "~lib/builtins/v128.xor"; + export const v128_andnot = "~lib/builtins/v128.andnot"; export const v128_not = "~lib/builtins/v128.not"; export const v128_bitselect = "~lib/builtins/v128.bitselect"; export const v128_any_true = "~lib/builtins/v128.any_true"; @@ -402,6 +407,8 @@ export namespace BuiltinSymbols { export const i16x8_widen_low_i8x16_u = "~lib/builtins/i16x8.widen_low_i8x16_u"; export const i16x8_widen_high_i8x16_s = "~lib/builtins/i16x8.widen_high_i8x16_s"; export const i16x8_widen_high_i8x16_u = "~lib/builtins/i16x8.widen_high_i8x16_u"; + export const i16x8_load8x8_s = "~lib/builtins/i16x8.load8x8_s"; + export const i16x8_load8x8_u = "~lib/builtins/i16x8.load8x8_u"; export const i32x4_splat = "~lib/builtins/i32x4.splat"; export const i32x4_extract_lane = "~lib/builtins/i32x4.extract_lane"; @@ -431,6 +438,8 @@ export namespace BuiltinSymbols { export const i32x4_widen_low_i16x8_u = "~lib/builtins/i32x4.widen_low_i16x8_u"; export const i32x4_widen_high_i16x8_s = "~lib/builtins/i32x4.widen_high_i16x8_s"; export const i32x4_widen_high_i16x8_u = "~lib/builtins/i32x4.widen_high_i16x8_u"; + export const i32x4_load16x4_s = "~lib/builtins/i32x4.load16x4_s"; + export const i32x4_load16x4_u = "~lib/builtins/i32x4.load16x4_u"; export const i64x2_splat = "~lib/builtins/i64x2.splat"; export const i64x2_extract_lane = "~lib/builtins/i64x2.extract_lane"; @@ -445,6 +454,8 @@ export namespace BuiltinSymbols { export const i64x2_all_true = "~lib/builtins/i64x2.all_true"; // i64x2 has no .eq etc. export const i64x2_trunc_sat_f64x2_s = "~lib/builtins/i64x2.trunc_sat_f64x2_s"; export const i64x2_trunc_sat_f64x2_u = "~lib/builtins/i64x2.trunc_sat_f64x2_u"; + export const i64x2_load32x2_s = "~lib/builtins/i64x2.load32x2_s"; + export const i64x2_load32x2_u = "~lib/builtins/i64x2.load32x2_u"; export const f32x4_splat = "~lib/builtins/f32x4.splat"; export const f32x4_extract_lane = "~lib/builtins/f32x4.extract_lane"; @@ -493,6 +504,11 @@ export namespace BuiltinSymbols { export const f64x2_qfms = "~lib/builtins/f64x2.qfms"; export const v8x16_shuffle = "~lib/builtins/v8x16.shuffle"; + export const v8x16_swizzle = "~lib/builtins/v8x16.swizzle"; + export const v8x16_load_splat = "~lib/builtins/v8x16.load_splat"; + export const v16x8_load_splat = "~lib/builtins/v16x8.load_splat"; + export const v32x4_load_splat = "~lib/builtins/v32x4.load_splat"; + export const v64x2_load_splat = "~lib/builtins/v64x2.load_splat"; // internals export const heap_base = "~lib/heap/__heap_base"; @@ -2935,6 +2951,158 @@ export function compileCall( compiler.currentType = Type.v128; return module.unreachable(); } + case BuiltinSymbols.v128_swizzle: { // swizzle(a: v128, b: v128) -> v128 + if ( + checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | + checkTypeAbsent(typeArguments, reportNode, prototype) | + checkArgsRequired(operands, 2, reportNode, compiler) + ) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.CONV_IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.CONV_IMPLICIT); + return module.binary(BinaryOp.SwizzleV8x16, arg0, arg1); + } + case BuiltinSymbols.v128_load_splat: { // load_splat(ptr: usize, immOffset?: usize, immAlign?: usize) -> v128 + if ( + checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | + checkTypeRequired(typeArguments, reportNode, compiler, true) | + checkArgsOptional(operands, 1, 3, reportNode, compiler) + ) return module.unreachable(); + let type = typeArguments![0]; + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, Constraints.CONV_IMPLICIT); + let numOperands = operands.length; + let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports + if (immOffset < 0) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + let immAlign: i32; + let naturalAlign = type.byteSize; + if (numOperands == 3) { + immAlign = evaluateImmediateOffset(operands[2], compiler); + if (immAlign < 0) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + } else { + immAlign = naturalAlign; + } + compiler.currentType = Type.v128; + if (!type.is(TypeFlags.REFERENCE)) { + if (immAlign > naturalAlign) { + compiler.error( + DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive, + operands[2].range, "Alignment", "0", naturalAlign.toString() + ); + return module.unreachable(); + } + if (!isPowerOf2(immAlign)) { + compiler.error( + DiagnosticCode._0_must_be_a_power_of_two, + operands[2].range, "Alignment" + ); + return module.unreachable(); + } + switch (type.kind) { + case TypeKind.I8: + case TypeKind.U8: { + return module.simd_load(SIMDLoadOp.LoadSplatV8x16, arg0, immOffset, immAlign); + } + case TypeKind.I16: + case TypeKind.U16: { + return module.simd_load(SIMDLoadOp.LoadSplatV16x8, arg0, immOffset, immAlign); + } + case TypeKind.I32: + case TypeKind.U32: + case TypeKind.F32: { + return module.simd_load(SIMDLoadOp.LoadSplatV32x4, arg0, immOffset, immAlign); + } + case TypeKind.ISIZE: + case TypeKind.USIZE: { + if (!compiler.options.isWasm64) { + return module.simd_load(SIMDLoadOp.LoadSplatV32x4, arg0, immOffset, immAlign); + } + // fall-through + } + case TypeKind.I64: + case TypeKind.U64: + case TypeKind.F64: { + return module.simd_load(SIMDLoadOp.LoadSplatV64x2, arg0, immOffset, immAlign); + } + } + } + compiler.error( + DiagnosticCode.Operation_0_cannot_be_applied_to_type_1, + reportNode.typeArgumentsRange, "v128.load_splat", type.toString() + ); + return module.unreachable(); + } + case BuiltinSymbols.v128_load_ext: { // load_ext(ptr: usize, immOffset?: usize, immAlign?: usize) -> v128 + if ( + checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | + checkTypeRequired(typeArguments, reportNode, compiler, true) | + checkArgsOptional(operands, 1, 3, reportNode, compiler) + ) return module.unreachable(); + let type = typeArguments![0]; + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, Constraints.CONV_IMPLICIT); + let numOperands = operands.length; + let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports + if (immOffset < 0) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + let immAlign: i32; + let naturalAlign = type.byteSize; + if (numOperands == 3) { + immAlign = evaluateImmediateOffset(operands[2], compiler); + if (immAlign < 0) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + } else { + immAlign = naturalAlign; + } + compiler.currentType = Type.v128; + if (!type.is(TypeFlags.REFERENCE)) { + if (immAlign > naturalAlign) { + compiler.error( + DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive, + operands[2].range, "Alignment", "0", naturalAlign.toString() + ); + return module.unreachable(); + } + if (!isPowerOf2(immAlign)) { + compiler.error( + DiagnosticCode._0_must_be_a_power_of_two, + operands[2].range, "Alignment" + ); + return module.unreachable(); + } + switch (type.kind) { + case TypeKind.I8: return module.simd_load(SIMDLoadOp.LoadI8ToI16x8, arg0, immOffset, immAlign); + case TypeKind.U8: return module.simd_load(SIMDLoadOp.LoadU8ToU16x8, arg0, immOffset, immAlign); + case TypeKind.I16: return module.simd_load(SIMDLoadOp.LoadI16ToI32x4, arg0, immOffset, immAlign); + case TypeKind.U16: return module.simd_load(SIMDLoadOp.LoadU16ToU32x4, arg0, immOffset, immAlign); + case TypeKind.ISIZE: { + if (compiler.options.isWasm64) break; + // fall-through + } + case TypeKind.I32: return module.simd_load(SIMDLoadOp.LoadI32ToI64x2, arg0, immOffset, immAlign); + case TypeKind.USIZE: { + if (compiler.options.isWasm64) break; + // fall-through + } + case TypeKind.U32: return module.simd_load(SIMDLoadOp.LoadU32ToU64x2, arg0, immOffset, immAlign); + } + } + compiler.error( + DiagnosticCode.Operation_0_cannot_be_applied_to_type_1, + reportNode.typeArgumentsRange, "v128.load_ext", type.toString() + ); + return module.unreachable(); + } case BuiltinSymbols.v128_add: { // add(a: v128, b: v128) -> v128 if ( checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | @@ -3758,6 +3926,19 @@ export function compileCall( let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.CONV_IMPLICIT); return module.binary(BinaryOp.XorV128, arg0, arg1); } + case BuiltinSymbols.v128_andnot: { // andnot(a: v128, b: v128) -> v128 + if ( + checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | + checkTypeAbsent(typeArguments, reportNode, prototype) | + checkArgsRequired(operands, 2, reportNode, compiler) + ) { + compiler.currentType = Type.v128; + return module.unreachable(); + } + let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.CONV_IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.CONV_IMPLICIT); + return module.binary(BinaryOp.AndNotV128, arg0, arg1); + } case BuiltinSymbols.v128_not: { // not(a: v128) -> v128 if ( checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | @@ -3770,19 +3951,6 @@ export function compileCall( let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.CONV_IMPLICIT); return module.unary(UnaryOp.NotV128, arg0); } - // case BuiltinSymbols.v128_andnot: { // andnot(a: v128, b: v128) -> v128 - // if ( - // checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | - // checkTypeAbsent(typeArguments, reportNode, prototype) | - // checkArgsRequired(operands, 2, reportNode, compiler) - // ) { - // compiler.currentType = Type.v128; - // return module.unreachable(); - // } - // let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.CONV_IMPLICIT); - // let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.CONV_IMPLICIT); - // return module.binary(BinaryOp.AndnotV128, arg0); - // } case BuiltinSymbols.v128_bitselect: { // bitselect(v1: v128, v2: v128, c: v128) -> v128 if ( checkFeatureEnabled(Feature.SIMD, reportNode, compiler) | @@ -4209,6 +4377,8 @@ function tryDeferASM( case BuiltinSymbols.i16x8_widen_low_i8x16_u: return deferASM(BuiltinSymbols.v128_widen_low, compiler, Type.u8, operands, Type.v128, reportNode); case BuiltinSymbols.i16x8_widen_high_i8x16_s: return deferASM(BuiltinSymbols.v128_widen_high, compiler, Type.i8, operands, Type.v128, reportNode); case BuiltinSymbols.i16x8_widen_high_i8x16_u: return deferASM(BuiltinSymbols.v128_widen_high, compiler, Type.u8, operands, Type.v128, reportNode); + case BuiltinSymbols.i16x8_load8x8_s: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.i8, operands, Type.v128, reportNode); + case BuiltinSymbols.i16x8_load8x8_u: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.u8, operands, Type.v128, reportNode); case BuiltinSymbols.i32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i32, operands, Type.v128, reportNode); case BuiltinSymbols.i32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i32, operands, Type.i32, reportNode); @@ -4238,6 +4408,8 @@ function tryDeferASM( case BuiltinSymbols.i32x4_widen_low_i16x8_u: return deferASM(BuiltinSymbols.v128_widen_low, compiler, Type.u16, operands, Type.v128, reportNode); case BuiltinSymbols.i32x4_widen_high_i16x8_s: return deferASM(BuiltinSymbols.v128_widen_high, compiler, Type.i16, operands, Type.v128, reportNode); case BuiltinSymbols.i32x4_widen_high_i16x8_u: return deferASM(BuiltinSymbols.v128_widen_high, compiler, Type.u16, operands, Type.v128, reportNode); + case BuiltinSymbols.i32x4_load16x4_s: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.i16, operands, Type.v128, reportNode); + case BuiltinSymbols.i32x4_load16x4_u: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.u16, operands, Type.v128, reportNode); case BuiltinSymbols.i64x2_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i64, operands, Type.v128, reportNode); case BuiltinSymbols.i64x2_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i64, operands, Type.i64, reportNode); @@ -4252,6 +4424,8 @@ function tryDeferASM( case BuiltinSymbols.i64x2_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i64, operands, Type.i32, reportNode); case BuiltinSymbols.i64x2_trunc_sat_f64x2_s: return deferASM(BuiltinSymbols.v128_trunc_sat, compiler, Type.i64, operands, Type.v128, reportNode); case BuiltinSymbols.i64x2_trunc_sat_f64x2_u: return deferASM(BuiltinSymbols.v128_trunc_sat, compiler, Type.u64, operands, Type.v128, reportNode); + case BuiltinSymbols.i64x2_load32x2_s: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.i32, operands, Type.v128, reportNode); + case BuiltinSymbols.i64x2_load32x2_u: return deferASM(BuiltinSymbols.v128_load_ext, compiler, Type.u32, operands, Type.v128, reportNode); case BuiltinSymbols.f32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.f32, operands, Type.v128, reportNode); case BuiltinSymbols.f32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.f32, operands, Type.f32, reportNode); @@ -4300,6 +4474,11 @@ function tryDeferASM( case BuiltinSymbols.f64x2_qfms: return deferASM(BuiltinSymbols.v128_qfms, compiler, Type.f64, operands, Type.v128, reportNode); case BuiltinSymbols.v8x16_shuffle: return deferASM(BuiltinSymbols.v128_shuffle, compiler, Type.i8, operands, Type.v128, reportNode); + case BuiltinSymbols.v8x16_swizzle: return deferASM(BuiltinSymbols.v128_swizzle, compiler, null, operands, Type.v128, reportNode); + case BuiltinSymbols.v8x16_load_splat: return deferASM(BuiltinSymbols.v128_load_splat, compiler, Type.u8, operands, Type.v128, reportNode); + case BuiltinSymbols.v16x8_load_splat: return deferASM(BuiltinSymbols.v128_load_splat, compiler, Type.u16, operands, Type.v128, reportNode); + case BuiltinSymbols.v32x4_load_splat: return deferASM(BuiltinSymbols.v128_load_splat, compiler, Type.u32, operands, Type.v128, reportNode); + case BuiltinSymbols.v64x2_load_splat: return deferASM(BuiltinSymbols.v128_load_splat, compiler, Type.u64, operands, Type.v128, reportNode); } /* tslint:enable:max-line-length */ return 0; @@ -4309,7 +4488,7 @@ function tryDeferASM( function deferASM( name: string, compiler: Compiler, - typeArgument: Type, + typeArgument: Type | null, operands: Expression[], contextualType: Type, reportNode: CallExpression @@ -4320,7 +4499,7 @@ function deferASM( return compileCall( compiler, prototype, - [ typeArgument ], + typeArgument ? [ typeArgument ] : null, operands, contextualType, reportNode, diff --git a/src/compiler.ts b/src/compiler.ts index 3740f3aa2b..d2b4d0005c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -449,7 +449,7 @@ export class Compiler extends DiagnosticEmitter { // set up function table var functionTable = this.functionTable; - module.setFunctionTable(functionTable.length, 0xffffffff, functionTable); + module.setFunctionTable(functionTable.length, 0xffffffff, functionTable, module.i32(0)); module.addFunction("null", this.ensureFunctionType(null, Type.void), null, module.block(null, [])); // import table if requested (default table is named '0' by Binaryen) diff --git a/src/glue/binaryen.d.ts b/src/glue/binaryen.d.ts index 5ccd113b3d..e684fb7d5a 100644 --- a/src/glue/binaryen.d.ts +++ b/src/glue/binaryen.d.ts @@ -73,6 +73,7 @@ declare function _BinaryenSIMDReplaceId(): BinaryenExpressionId; declare function _BinaryenSIMDShuffleId(): BinaryenExpressionId; declare function _BinaryenSIMDTernaryId(): BinaryenExpressionId; declare function _BinaryenSIMDShiftId(): BinaryenExpressionId; +declare function _BinaryenSIMDLoadId(): BinaryenExpressionId; declare function _BinaryenMemoryInitId(): BinaryenExpressionId; declare function _BinaryenDataDropId(): BinaryenExpressionId; declare function _BinaryenMemoryCopyId(): BinaryenExpressionId; @@ -85,7 +86,6 @@ declare function _BinaryenPushId(): BinaryenExpressionId; declare function _BinaryenPopId(): BinaryenExpressionId; declare type BinaryenModuleRef = usize; -declare type v128ptr = usize; // TODO: LLVM C-abi for const uint8_t[16]? declare function _BinaryenModuleCreate(): BinaryenModuleRef; declare function _BinaryenModuleDispose(module: BinaryenModuleRef): void; @@ -97,7 +97,7 @@ declare function _BinaryenLiteralInt32(out: usize, x: i32): void; declare function _BinaryenLiteralInt64(out: usize, x: i32, y: i32): void; declare function _BinaryenLiteralFloat32(out: usize, x: f32): void; declare function _BinaryenLiteralFloat64(out: usize, x: f64): void; -declare function _BinaryenLiteralVec128(out: usize, x: v128ptr): void; +declare function _BinaryenLiteralVec128(out: usize, xPtr: usize): void; declare function _BinaryenLiteralFloat32Bits(out: usize, x: i32): void; declare function _BinaryenLiteralFloat64Bits(out: usize, x: i32, y: i32): void; @@ -240,174 +240,180 @@ declare function _BinaryenLeFloat64(): BinaryenOp; declare function _BinaryenGtFloat64(): BinaryenOp; declare function _BinaryenGeFloat64(): BinaryenOp; -declare type BinaryenHostOp = BinaryenOp; - -declare function _BinaryenMemorySize(): BinaryenHostOp; -declare function _BinaryenMemoryGrow(): BinaryenHostOp; - -declare type BinaryenAtomicRMWOp = BinaryenOp; - -declare function _BinaryenAtomicRMWAdd(): BinaryenAtomicRMWOp; -declare function _BinaryenAtomicRMWSub(): BinaryenAtomicRMWOp; -declare function _BinaryenAtomicRMWAnd(): BinaryenAtomicRMWOp; -declare function _BinaryenAtomicRMWOr(): BinaryenAtomicRMWOp; -declare function _BinaryenAtomicRMWXor(): BinaryenAtomicRMWOp; -declare function _BinaryenAtomicRMWXchg(): BinaryenAtomicRMWOp; - -declare type BinaryenSIMDOp = BinaryenOp; - -declare function _BinaryenSplatVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenSplatVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenSplatVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenSplatVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenSplatVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenSplatVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenExtractLaneVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenReplaceLaneVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenEqVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenNeVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenLtSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenLtUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenGtSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenGtUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenLeSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenLeUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenGeSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenGeUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenEqVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenNeVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenLtSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenLtUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenGtSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenGtUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenLeSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenLeUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenGeSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenGeUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenEqVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenNeVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenLtSVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenLtUVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenGtSVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenGtUVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenLeSVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenLeUVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenGeSVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenGeUVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenEqVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenNeVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenLtVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenGtVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenLeVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenGeVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenEqVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenNeVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenLtVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenGtVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenLeVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenGeVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenNotVec128(): BinaryenSIMDOp; -declare function _BinaryenAndVec128(): BinaryenSIMDOp; -declare function _BinaryenOrVec128(): BinaryenSIMDOp; -declare function _BinaryenXorVec128(): BinaryenSIMDOp; -declare function _BinaryenBitselectVec128(): BinaryenSIMDOp; -declare function _BinaryenNegVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenAnyTrueVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenAllTrueVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenShlVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenShrSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenShrUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenAddVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenAddSatSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenAddSatUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenSubVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenSubSatSVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenSubSatUVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenMulVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenNegVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenAnyTrueVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenAllTrueVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenShlVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenShrSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenShrUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenAddVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenAddSatSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenAddSatUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenSubVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenSubSatSVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenSubSatUVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenMulVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenNegVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenAnyTrueVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenAllTrueVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenShlVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenShrSVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenShrUVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenAddVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenSubVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenMulVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenNegVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenAnyTrueVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenAllTrueVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenShlVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenShrSVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenShrUVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenAddVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenSubVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenAbsVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenNegVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenSqrtVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenQFMAVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenQFMSVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenAddVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenSubVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenMulVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenDivVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenMinVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenMaxVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenAbsVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenNegVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenSqrtVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenQFMAVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenQFMSVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenAddVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenSubVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenMulVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenDivVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenMinVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenMaxVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenTruncSatSVecF32x4ToVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenTruncSatUVecF32x4ToVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenTruncSatSVecF64x2ToVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenTruncSatUVecF64x2ToVecI64x2(): BinaryenSIMDOp; -declare function _BinaryenConvertSVecI32x4ToVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenConvertUVecI32x4ToVecF32x4(): BinaryenSIMDOp; -declare function _BinaryenConvertSVecI64x2ToVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenConvertUVecI64x2ToVecF64x2(): BinaryenSIMDOp; -declare function _BinaryenNarrowSVecI16x8ToVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenNarrowUVecI16x8ToVecI8x16(): BinaryenSIMDOp; -declare function _BinaryenNarrowSVecI32x4ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenNarrowUVecI32x4ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenWidenLowSVecI8x16ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenWidenHighSVecI8x16ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenWidenLowUVecI8x16ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenWidenHighUVecI8x16ToVecI16x8(): BinaryenSIMDOp; -declare function _BinaryenWidenLowSVecI16x8ToVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenWidenHighSVecI16x8ToVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenWidenLowUVecI16x8ToVecI32x4(): BinaryenSIMDOp; -declare function _BinaryenWidenHighUVecI16x8ToVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenMemorySize(): BinaryenOp; +declare function _BinaryenMemoryGrow(): BinaryenOp; + +declare function _BinaryenAtomicRMWAdd(): BinaryenOp; +declare function _BinaryenAtomicRMWSub(): BinaryenOp; +declare function _BinaryenAtomicRMWAnd(): BinaryenOp; +declare function _BinaryenAtomicRMWOr(): BinaryenOp; +declare function _BinaryenAtomicRMWXor(): BinaryenOp; +declare function _BinaryenAtomicRMWXchg(): BinaryenOp; + +declare function _BinaryenSplatVecI8x16(): BinaryenOp; +declare function _BinaryenExtractLaneSVecI8x16(): BinaryenOp; +declare function _BinaryenExtractLaneUVecI8x16(): BinaryenOp; +declare function _BinaryenReplaceLaneVecI8x16(): BinaryenOp; +declare function _BinaryenSplatVecI16x8(): BinaryenOp; +declare function _BinaryenExtractLaneSVecI16x8(): BinaryenOp; +declare function _BinaryenExtractLaneUVecI16x8(): BinaryenOp; +declare function _BinaryenReplaceLaneVecI16x8(): BinaryenOp; +declare function _BinaryenSplatVecI32x4(): BinaryenOp; +declare function _BinaryenExtractLaneVecI32x4(): BinaryenOp; +declare function _BinaryenReplaceLaneVecI32x4(): BinaryenOp; +declare function _BinaryenSplatVecI64x2(): BinaryenOp; +declare function _BinaryenExtractLaneVecI64x2(): BinaryenOp; +declare function _BinaryenReplaceLaneVecI64x2(): BinaryenOp; +declare function _BinaryenSplatVecF32x4(): BinaryenOp; +declare function _BinaryenExtractLaneVecF32x4(): BinaryenOp; +declare function _BinaryenReplaceLaneVecF32x4(): BinaryenOp; +declare function _BinaryenSplatVecF64x2(): BinaryenOp; +declare function _BinaryenExtractLaneVecF64x2(): BinaryenOp; +declare function _BinaryenReplaceLaneVecF64x2(): BinaryenOp; +declare function _BinaryenEqVecI8x16(): BinaryenOp; +declare function _BinaryenNeVecI8x16(): BinaryenOp; +declare function _BinaryenLtSVecI8x16(): BinaryenOp; +declare function _BinaryenLtUVecI8x16(): BinaryenOp; +declare function _BinaryenGtSVecI8x16(): BinaryenOp; +declare function _BinaryenGtUVecI8x16(): BinaryenOp; +declare function _BinaryenLeSVecI8x16(): BinaryenOp; +declare function _BinaryenLeUVecI8x16(): BinaryenOp; +declare function _BinaryenGeSVecI8x16(): BinaryenOp; +declare function _BinaryenGeUVecI8x16(): BinaryenOp; +declare function _BinaryenEqVecI16x8(): BinaryenOp; +declare function _BinaryenNeVecI16x8(): BinaryenOp; +declare function _BinaryenLtSVecI16x8(): BinaryenOp; +declare function _BinaryenLtUVecI16x8(): BinaryenOp; +declare function _BinaryenGtSVecI16x8(): BinaryenOp; +declare function _BinaryenGtUVecI16x8(): BinaryenOp; +declare function _BinaryenLeSVecI16x8(): BinaryenOp; +declare function _BinaryenLeUVecI16x8(): BinaryenOp; +declare function _BinaryenGeSVecI16x8(): BinaryenOp; +declare function _BinaryenGeUVecI16x8(): BinaryenOp; +declare function _BinaryenEqVecI32x4(): BinaryenOp; +declare function _BinaryenNeVecI32x4(): BinaryenOp; +declare function _BinaryenLtSVecI32x4(): BinaryenOp; +declare function _BinaryenLtUVecI32x4(): BinaryenOp; +declare function _BinaryenGtSVecI32x4(): BinaryenOp; +declare function _BinaryenGtUVecI32x4(): BinaryenOp; +declare function _BinaryenLeSVecI32x4(): BinaryenOp; +declare function _BinaryenLeUVecI32x4(): BinaryenOp; +declare function _BinaryenGeSVecI32x4(): BinaryenOp; +declare function _BinaryenGeUVecI32x4(): BinaryenOp; +declare function _BinaryenEqVecF32x4(): BinaryenOp; +declare function _BinaryenNeVecF32x4(): BinaryenOp; +declare function _BinaryenLtVecF32x4(): BinaryenOp; +declare function _BinaryenGtVecF32x4(): BinaryenOp; +declare function _BinaryenLeVecF32x4(): BinaryenOp; +declare function _BinaryenGeVecF32x4(): BinaryenOp; +declare function _BinaryenEqVecF64x2(): BinaryenOp; +declare function _BinaryenNeVecF64x2(): BinaryenOp; +declare function _BinaryenLtVecF64x2(): BinaryenOp; +declare function _BinaryenGtVecF64x2(): BinaryenOp; +declare function _BinaryenLeVecF64x2(): BinaryenOp; +declare function _BinaryenGeVecF64x2(): BinaryenOp; +declare function _BinaryenNotVec128(): BinaryenOp; +declare function _BinaryenAndVec128(): BinaryenOp; +declare function _BinaryenOrVec128(): BinaryenOp; +declare function _BinaryenXorVec128(): BinaryenOp; +declare function _BinaryenAndNotVec128(): BinaryenOp; +declare function _BinaryenBitselectVec128(): BinaryenOp; +declare function _BinaryenNegVecI8x16(): BinaryenOp; +declare function _BinaryenAnyTrueVecI8x16(): BinaryenOp; +declare function _BinaryenAllTrueVecI8x16(): BinaryenOp; +declare function _BinaryenShlVecI8x16(): BinaryenOp; +declare function _BinaryenShrSVecI8x16(): BinaryenOp; +declare function _BinaryenShrUVecI8x16(): BinaryenOp; +declare function _BinaryenAddVecI8x16(): BinaryenOp; +declare function _BinaryenAddSatSVecI8x16(): BinaryenOp; +declare function _BinaryenAddSatUVecI8x16(): BinaryenOp; +declare function _BinaryenSubVecI8x16(): BinaryenOp; +declare function _BinaryenSubSatSVecI8x16(): BinaryenOp; +declare function _BinaryenSubSatUVecI8x16(): BinaryenOp; +declare function _BinaryenMulVecI8x16(): BinaryenOp; +declare function _BinaryenNegVecI16x8(): BinaryenOp; +declare function _BinaryenAnyTrueVecI16x8(): BinaryenOp; +declare function _BinaryenAllTrueVecI16x8(): BinaryenOp; +declare function _BinaryenShlVecI16x8(): BinaryenOp; +declare function _BinaryenShrSVecI16x8(): BinaryenOp; +declare function _BinaryenShrUVecI16x8(): BinaryenOp; +declare function _BinaryenAddVecI16x8(): BinaryenOp; +declare function _BinaryenAddSatSVecI16x8(): BinaryenOp; +declare function _BinaryenAddSatUVecI16x8(): BinaryenOp; +declare function _BinaryenSubVecI16x8(): BinaryenOp; +declare function _BinaryenSubSatSVecI16x8(): BinaryenOp; +declare function _BinaryenSubSatUVecI16x8(): BinaryenOp; +declare function _BinaryenMulVecI16x8(): BinaryenOp; +declare function _BinaryenNegVecI32x4(): BinaryenOp; +declare function _BinaryenAnyTrueVecI32x4(): BinaryenOp; +declare function _BinaryenAllTrueVecI32x4(): BinaryenOp; +declare function _BinaryenShlVecI32x4(): BinaryenOp; +declare function _BinaryenShrSVecI32x4(): BinaryenOp; +declare function _BinaryenShrUVecI32x4(): BinaryenOp; +declare function _BinaryenAddVecI32x4(): BinaryenOp; +declare function _BinaryenSubVecI32x4(): BinaryenOp; +declare function _BinaryenMulVecI32x4(): BinaryenOp; +declare function _BinaryenNegVecI64x2(): BinaryenOp; +declare function _BinaryenAnyTrueVecI64x2(): BinaryenOp; +declare function _BinaryenAllTrueVecI64x2(): BinaryenOp; +declare function _BinaryenShlVecI64x2(): BinaryenOp; +declare function _BinaryenShrSVecI64x2(): BinaryenOp; +declare function _BinaryenShrUVecI64x2(): BinaryenOp; +declare function _BinaryenAddVecI64x2(): BinaryenOp; +declare function _BinaryenSubVecI64x2(): BinaryenOp; +declare function _BinaryenAbsVecF32x4(): BinaryenOp; +declare function _BinaryenNegVecF32x4(): BinaryenOp; +declare function _BinaryenSqrtVecF32x4(): BinaryenOp; +declare function _BinaryenQFMAVecF32x4(): BinaryenOp; +declare function _BinaryenQFMSVecF32x4(): BinaryenOp; +declare function _BinaryenAddVecF32x4(): BinaryenOp; +declare function _BinaryenSubVecF32x4(): BinaryenOp; +declare function _BinaryenMulVecF32x4(): BinaryenOp; +declare function _BinaryenDivVecF32x4(): BinaryenOp; +declare function _BinaryenMinVecF32x4(): BinaryenOp; +declare function _BinaryenMaxVecF32x4(): BinaryenOp; +declare function _BinaryenAbsVecF64x2(): BinaryenOp; +declare function _BinaryenNegVecF64x2(): BinaryenOp; +declare function _BinaryenSqrtVecF64x2(): BinaryenOp; +declare function _BinaryenQFMAVecF64x2(): BinaryenOp; +declare function _BinaryenQFMSVecF64x2(): BinaryenOp; +declare function _BinaryenAddVecF64x2(): BinaryenOp; +declare function _BinaryenSubVecF64x2(): BinaryenOp; +declare function _BinaryenMulVecF64x2(): BinaryenOp; +declare function _BinaryenDivVecF64x2(): BinaryenOp; +declare function _BinaryenMinVecF64x2(): BinaryenOp; +declare function _BinaryenMaxVecF64x2(): BinaryenOp; +declare function _BinaryenTruncSatSVecF32x4ToVecI32x4(): BinaryenOp; +declare function _BinaryenTruncSatUVecF32x4ToVecI32x4(): BinaryenOp; +declare function _BinaryenTruncSatSVecF64x2ToVecI64x2(): BinaryenOp; +declare function _BinaryenTruncSatUVecF64x2ToVecI64x2(): BinaryenOp; +declare function _BinaryenConvertSVecI32x4ToVecF32x4(): BinaryenOp; +declare function _BinaryenConvertUVecI32x4ToVecF32x4(): BinaryenOp; +declare function _BinaryenConvertSVecI64x2ToVecF64x2(): BinaryenOp; +declare function _BinaryenConvertUVecI64x2ToVecF64x2(): BinaryenOp; +declare function _BinaryenLoadSplatVec8x16(): BinaryenOp; +declare function _BinaryenLoadSplatVec16x8(): BinaryenOp; +declare function _BinaryenLoadSplatVec32x4(): BinaryenOp; +declare function _BinaryenLoadSplatVec64x2(): BinaryenOp; +declare function _BinaryenLoadExtSVec8x8ToVecI16x8(): BinaryenOp; +declare function _BinaryenLoadExtUVec8x8ToVecI16x8(): BinaryenOp; +declare function _BinaryenLoadExtSVec16x4ToVecI32x4(): BinaryenOp; +declare function _BinaryenLoadExtUVec16x4ToVecI32x4(): BinaryenOp; +declare function _BinaryenLoadExtSVec32x2ToVecI64x2(): BinaryenOp; +declare function _BinaryenLoadExtUVec32x2ToVecI64x2(): BinaryenOp; +declare function _BinaryenNarrowSVecI16x8ToVecI8x16(): BinaryenOp; +declare function _BinaryenNarrowUVecI16x8ToVecI8x16(): BinaryenOp; +declare function _BinaryenNarrowSVecI32x4ToVecI16x8(): BinaryenOp; +declare function _BinaryenNarrowUVecI32x4ToVecI16x8(): BinaryenOp; +declare function _BinaryenWidenLowSVecI8x16ToVecI16x8(): BinaryenOp; +declare function _BinaryenWidenHighSVecI8x16ToVecI16x8(): BinaryenOp; +declare function _BinaryenWidenLowUVecI8x16ToVecI16x8(): BinaryenOp; +declare function _BinaryenWidenHighUVecI8x16ToVecI16x8(): BinaryenOp; +declare function _BinaryenWidenLowSVecI16x8ToVecI32x4(): BinaryenOp; +declare function _BinaryenWidenHighSVecI16x8ToVecI32x4(): BinaryenOp; +declare function _BinaryenWidenLowUVecI16x8ToVecI32x4(): BinaryenOp; +declare function _BinaryenWidenHighUVecI16x8ToVecI32x4(): BinaryenOp; +declare function _BinaryenSwizzleVec8x16(): BinaryenOp; declare type BinaryenExpressionRef = usize; @@ -439,17 +445,18 @@ declare function _BinaryenUnreachable(module: BinaryenModuleRef): BinaryenExpres declare function _BinaryenAtomicLoad(module: BinaryenModuleRef, bytes: BinaryenIndex, offset: BinaryenIndex, type: BinaryenType, ptr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenAtomicStore(module: BinaryenModuleRef, bytes: BinaryenIndex, offset: BinaryenIndex, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; -declare function _BinaryenAtomicRMW(module: BinaryenModuleRef, op: BinaryenAtomicRMWOp, bytes: i32, offset: i32, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenAtomicRMW(module: BinaryenModuleRef, op: BinaryenOp, bytes: i32, offset: i32, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; declare function _BinaryenAtomicCmpxchg(module: BinaryenModuleRef, bytes: i32, offset: i32, ptr: BinaryenExpressionRef, expected: BinaryenExpressionRef, replacement: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; declare function _BinaryenAtomicWait(module: BinaryenModuleRef, ptr: BinaryenExpressionRef, expected: BinaryenExpressionRef, timeout: BinaryenExpressionRef, expectedType: BinaryenType): BinaryenExpressionRef; declare function _BinaryenAtomicNotify(module: BinaryenModuleRef, ptr: BinaryenExpressionRef, notifyCount: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenAtomicFence(module: BinaryenModuleRef): BinaryenExpressionRef; -declare function _BinaryenSIMDExtract(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, idx: u8): BinaryenExpressionRef; -declare function _BinaryenSIMDReplace(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, idx: u8, value: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenSIMDShuffle(module: BinaryenModuleRef, left: BinaryenExpressionRef, right: BinaryenExpressionRef, mask: v128ptr): BinaryenExpressionRef; -declare function _BinaryenSIMDTernary(module: BinaryenModuleRef, op: BinaryenSIMDOp, a: BinaryenExpressionRef, b: BinaryenExpressionRef, c: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenSIMDShift(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, shift: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDExtract(module: BinaryenModuleRef, op: BinaryenOp, vec: BinaryenExpressionRef, idx: u8): BinaryenExpressionRef; +declare function _BinaryenSIMDReplace(module: BinaryenModuleRef, op: BinaryenOp, vec: BinaryenExpressionRef, idx: u8, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShuffle(module: BinaryenModuleRef, left: BinaryenExpressionRef, right: BinaryenExpressionRef, maskPtr: usize): BinaryenExpressionRef; +declare function _BinaryenSIMDTernary(module: BinaryenModuleRef, op: BinaryenOp, a: BinaryenExpressionRef, b: BinaryenExpressionRef, c: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShift(module: BinaryenModuleRef, op: BinaryenOp, vec: BinaryenExpressionRef, shift: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDLoad(module: BinaryenModuleRef, op: BinaryenOp, offset: u32, align: u32, ptr: BinaryenExportRef): BinaryenExpressionRef; declare function _BinaryenMemoryInit(module: BinaryenModuleRef, segment: u32, dest: BinaryenExpressionRef, offset: BinaryenExpressionRef, size: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenDataDrop(module: BinaryenModuleRef, segment: u32): BinaryenExpressionRef; @@ -570,28 +577,33 @@ declare function _BinaryenAtomicNotifyGetNotifyCount(expr: BinaryenExpressionRef declare function _BinaryenAtomicFenceGetOrder(expr: BinaryenExportRef): u8; -declare function _BinaryenSIMDExtractGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDExtractGetOp(expr: BinaryenExpressionRef): BinaryenOp; declare function _BinaryenSIMDExtractGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDExtractGetIdx(expr: BinaryenExpressionRef): u8; -declare function _BinaryenSIMDReplaceGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDReplaceGetOp(expr: BinaryenExpressionRef): BinaryenOp; declare function _BinaryenSIMDReplaceGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDReplaceGetIdx(expr: BinaryenExpressionRef): u8; declare function _BinaryenSIMDReplaceGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDShuffleGetLeft(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDShuffleGetRight(expr: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenSIMDShuffleGetMask(expr: BinaryenExpressionRef, out: v128ptr): void; +declare function _BinaryenSIMDShuffleGetMask(expr: BinaryenExpressionRef, outPtr: usize): void; -declare function _BinaryenSIMDTernaryGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDTernaryGetOp(expr: BinaryenExpressionRef): BinaryenOp; declare function _BinaryenSIMDTernaryGetA(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDTernaryGetB(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDTernaryGetC(expr: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenSIMDShiftGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDShiftGetOp(expr: BinaryenExpressionRef): BinaryenOp; declare function _BinaryenSIMDShiftGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenSIMDShiftGetShift(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDLoadGetOp(expr: BinaryenExpressionRef): BinaryenOp; +declare function _BinaryenSIMDLoadGetOffset(expr: BinaryenExpressionRef): u32; +declare function _BinaryenSIMDLoadGetAlign(expr: BinaryenExpressionRef): u32; +declare function _BinaryenSIMDLoadGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; + declare function _BinaryenMemoryInitGetSegment(expr: BinaryenExpressionRef): u32; declare function _BinaryenMemoryInitGetDest(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenMemoryInitGetOffset(expr: BinaryenExpressionRef): BinaryenExpressionRef; @@ -670,7 +682,7 @@ declare function _BinaryenRemoveExport(module: BinaryenModuleRef, externalName: declare type BinaryenGlobalRef = usize; -declare function _BinaryenAddGlobal(module: BinaryenModuleRef, name: usize, type: BinaryenType, mutable: i8, init: BinaryenExpressionRef): BinaryenGlobalRef; +declare function _BinaryenAddGlobal(module: BinaryenModuleRef, name: usize, type: BinaryenType, mutable: bool, init: BinaryenExpressionRef): BinaryenGlobalRef; declare function _BinaryenRemoveGlobal(module: BinaryenModuleRef, name: usize): void; declare type BinaryenEventRef = usize; @@ -685,7 +697,7 @@ declare function _BinaryenEventGetType(event: BinaryenEventRef): usize; declare function _BinaryenEventGetNumParams(event: BinaryenEventRef): BinaryenIndex; declare function _BinaryenEventGetParam(event: BinaryenEventRef, index: BinaryenIndex): BinaryenType; -declare function _BinaryenSetFunctionTable(module: BinaryenModuleRef, initial: BinaryenIndex, maximum: BinaryenIndex, funcs: usize, numFuncs: BinaryenIndex): void; +declare function _BinaryenSetFunctionTable(module: BinaryenModuleRef, initial: BinaryenIndex, maximum: BinaryenIndex, funcs: usize, numFuncs: BinaryenIndex, offset: BinaryenExpressionRef): void; declare function _BinaryenSetMemory(module: BinaryenModuleRef, initial: BinaryenIndex, maximum: BinaryenIndex, exportName: usize, segments: usize, segmentPassive: usize, segmentOffsets: usize, segmentSizes: usize, numSegments: BinaryenIndex, shared: bool): void; @@ -706,6 +718,8 @@ declare function _BinaryenModuleGetDebugInfoFileName(module: BinaryenModuleRef, declare function _BinaryenModuleGetFeatures(module: BinaryenModuleRef): BinaryenFeatureFlags; declare function _BinaryenModuleSetFeatures(module: BinaryenModuleRef, featureFlags: BinaryenFeatureFlags): void; +declare function _BinaryenAddCustomSection(module: BinaryenModuleRef, name: usize, contents: usize, contentsSize: BinaryenIndex): void; + declare type BinaryenRelooperRef = usize; declare type BinaryenRelooperBlockRef = usize; @@ -723,4 +737,4 @@ declare function _BinaryenSetShrinkLevel(level: i32): void; declare function _BinaryenGetDebugInfo(): bool; declare function _BinaryenSetDebugInfo(on: bool): void; -declare function _BinaryenSetAPITracing(on: i32): void; +declare function _BinaryenSetAPITracing(on: bool): void; diff --git a/src/module.ts b/src/module.ts index 13b7234247..22da5d6cb6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -4,7 +4,6 @@ *//***/ import { Target } from "./common"; -import { Type } from "./types"; export type ModuleRef = usize; export type FunctionTypeRef = usize; @@ -79,6 +78,7 @@ export enum ExpressionId { SIMDShuffle = _BinaryenSIMDShuffleId(), SIMDTernary = _BinaryenSIMDTernaryId(), SIMDShift = _BinaryenSIMDShiftId(), + SIMDLoad = _BinaryenSIMDLoadId(), MemoryInit = _BinaryenMemoryInitId(), DataDrop = _BinaryenDataDropId(), MemoryCopy = _BinaryenMemoryCopyId(), @@ -325,6 +325,7 @@ export enum BinaryOp { AndV128 = _BinaryenAndVec128(), OrV128 = _BinaryenOrVec128(), XorV128 = _BinaryenXorVec128(), + AndNotV128 = _BinaryenAndNotVec128(), AddI8x16 = _BinaryenAddVecI8x16(), AddSatI8x16 = _BinaryenAddSatSVecI8x16(), AddSatU8x16 = _BinaryenAddSatUVecI8x16(), @@ -359,7 +360,8 @@ export enum BinaryOp { NarrowI16x8ToI8x16 = _BinaryenNarrowSVecI16x8ToVecI8x16(), NarrowU16x8ToU8x16 = _BinaryenNarrowUVecI16x8ToVecI8x16(), NarrowI32x4ToI16x8 = _BinaryenNarrowSVecI32x4ToVecI16x8(), - NarrowU32x4ToU16x8 = _BinaryenNarrowUVecI32x4ToVecI16x8() + NarrowU32x4ToU16x8 = _BinaryenNarrowUVecI32x4ToVecI16x8(), + SwizzleV8x16 = _BinaryenSwizzleVec8x16() } export enum HostOp { @@ -419,6 +421,19 @@ export enum SIMDTernaryOp { QFMSF64x2 = _BinaryenQFMSVecF64x2() } +export enum SIMDLoadOp { + LoadSplatV8x16 = _BinaryenLoadSplatVec8x16(), + LoadSplatV16x8 = _BinaryenLoadSplatVec16x8(), + LoadSplatV32x4 = _BinaryenLoadSplatVec32x4(), + LoadSplatV64x2 = _BinaryenLoadSplatVec64x2(), + LoadI8ToI16x8 = _BinaryenLoadExtSVec8x8ToVecI16x8(), + LoadU8ToU16x8 = _BinaryenLoadExtUVec8x8ToVecI16x8(), + LoadI16ToI32x4 = _BinaryenLoadExtSVec16x4ToVecI32x4(), + LoadU16ToU32x4 = _BinaryenLoadExtUVec16x4ToVecI32x4(), + LoadI32ToI64x2 = _BinaryenLoadExtSVec32x2ToVecI64x2(), + LoadU32ToU64x2 = _BinaryenLoadExtUVec32x2ToVecI64x2() +} + export class MemorySegment { buffer: Uint8Array; @@ -921,7 +936,7 @@ export class Module { } simd_ternary( - op: BinaryenSIMDOp, + op: SIMDTernaryOp, a: ExpressionRef, b: ExpressionRef, c: ExpressionRef @@ -937,6 +952,15 @@ export class Module { return _BinaryenSIMDShift(this.ref, op, vec, shift); } + simd_load( + op: SIMDLoadOp, + ptr: ExpressionRef, + offset: u32, + align: u32 + ): ExpressionRef { + return _BinaryenSIMDLoad(this.ref, op, offset, align, ptr); + } + // meta addGlobal( @@ -946,7 +970,7 @@ export class Module { initializer: ExpressionRef ): GlobalRef { var cStr = this.allocStringCached(name); - return _BinaryenAddGlobal(this.ref, cStr, type, mutable ? 1 : 0, initializer); + return _BinaryenAddGlobal(this.ref, cStr, type, mutable, initializer); } removeGlobal( @@ -1169,7 +1193,8 @@ export class Module { setFunctionTable( initial: Index, maximum: Index, - funcs: string[] + funcs: string[], + offset: ExpressionRef ): void { var numNames = funcs.length; var names = new Array(numNames); @@ -1178,7 +1203,7 @@ export class Module { } var cArr = allocI32Array(names); try { - _BinaryenSetFunctionTable(this.ref, initial, maximum, cArr, numNames); + _BinaryenSetFunctionTable(this.ref, initial, maximum, cArr, numNames, offset); } finally { memory.free(cArr); } @@ -1188,6 +1213,16 @@ export class Module { _BinaryenSetStart(this.ref, func); } + addCustomSection(name: string, contents: Uint8Array): void { + var cStr = this.allocStringCached(name); + var cArr = allocU8Array(contents); + try { + _BinaryenAddCustomSection(this.ref, cStr, cArr, contents.length); + } finally { + memory.free(cArr); + } + } + getOptimizeLevel(): i32 { return _BinaryenGetOptimizeLevel(); } @@ -2063,6 +2098,10 @@ export function traverse(expr: ExpressionRef, data: T, visit: (expr: Expressi visit(_BinaryenSIMDShiftGetShift(expr), data); break; } + case ExpressionId.SIMDLoad: { + visit(_BinaryenSIMDLoadGetPtr(expr), data); + break; + } case ExpressionId.MemoryInit: { visit(_BinaryenMemoryInitGetDest(expr), data); visit(_BinaryenMemoryInitGetOffset(expr), data); diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts index d1aa36a735..268bc64f4b 100644 --- a/std/assembly/builtins.ts +++ b/std/assembly/builtins.ts @@ -120,11 +120,11 @@ export declare function trunc(value: T): T; // @ts-ignore: decorator @unsafe @builtin -export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): T; +export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T; // @ts-ignore: decorator @unsafe @builtin -export declare function store(offset: usize, value: void, immOffset?: usize, immAlign?: usize): void; +export declare function store(ptr: usize, value: void, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @builtin @@ -181,11 +181,11 @@ export declare function instantiate(...args: void[]): T; export namespace atomic { // @ts-ignore: decorator @unsafe @builtin - export declare function load(offset: usize, immOffset?: usize): T; + export declare function load(ptr: usize, immOffset?: usize): T; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: T, immOffset?: usize): void; + export declare function store(ptr: usize, value: T, immOffset?: usize): void; // @ts-ignore: decorator @builtin @@ -306,61 +306,61 @@ export namespace i32 { // @ts-ignore: decorator @builtin - export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export declare function store8(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export declare function store16(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export declare function store(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; export namespace atomic { // @ts-ignore: decorator @builtin - export declare function load8_u(offset: usize, immOffset?: usize): i32; + export declare function load8_u(ptr: usize, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load16_u(offset: usize, immOffset?: usize): i32; + export declare function load16_u(ptr: usize, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize): i32; + export declare function load(ptr: usize, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function store8(offset: usize, value: i32, immOffset?: usize): void; + export declare function store8(ptr: usize, value: i32, immOffset?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store16(offset: usize, value: i32, immOffset?: usize): void; + export declare function store16(ptr: usize, value: i32, immOffset?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: i32, immOffset?: usize): void; + export declare function store(ptr: usize, value: i32, immOffset?: usize): void; // @ts-ignore: decorator @builtin @@ -370,93 +370,93 @@ export namespace i32 { // @ts-ignore: decorator @builtin - export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } export namespace rmw16 { // @ts-ignore: decorator @builtin - export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } export namespace rmw { // @ts-ignore: decorator @builtin - export declare function add(offset: usize, value: i32, immOffset?: usize): i32; + export declare function add(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function sub(offset: usize, value: i32, immOffset?: usize): i32; + export declare function sub(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function and(offset: usize, value: i32, immOffset?: usize): i32; + export declare function and(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function or(offset: usize, value: i32, immOffset?: usize): i32; + export declare function or(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @builtin - export declare function xor(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xor(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg(offset: usize, value: i32, immOffset?: usize): i32; + export declare function xchg(ptr: usize, value: i32, immOffset?: usize): i32; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export declare function cmpxchg(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } } } @@ -485,31 +485,31 @@ export namespace i64 { // @ts-ignore: decorator @builtin - export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load32_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export declare function load32_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize): i64; + export declare function load(ptr: usize, immOffset?: usize): i64; // @ts-ignore: decorator @builtin @@ -529,53 +529,53 @@ export namespace i64 { // @ts-ignore: decorator @unsafe @builtin - export declare function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export declare function store8(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export declare function store16(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export declare function store32(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export declare function store(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; export namespace atomic { // @ts-ignore: decorator @builtin - export declare function load8_u(offset: usize, immOffset?: usize): i64; + export declare function load8_u(ptr: usize, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load16_u(offset: usize, immOffset?: usize): i64; + export declare function load16_u(ptr: usize, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load32_u(offset: usize, immOffset?: usize): i64; + export declare function load32_u(ptr: usize, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize): i64; + export declare function load(ptr: usize, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function store8(offset: usize, value: i64, immOffset?: usize): void; + export declare function store8(ptr: usize, value: i64, immOffset?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store16(offset: usize, value: i64, immOffset?: usize): void; + export declare function store16(ptr: usize, value: i64, immOffset?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store32(offset: usize, value: i64, immOffset?: usize): void; + export declare function store32(ptr: usize, value: i64, immOffset?: usize): void; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: i64, immOffset?: usize): void; + export declare function store(ptr: usize, value: i64, immOffset?: usize): void; // @ts-ignore: decorator @builtin @@ -585,124 +585,124 @@ export namespace i64 { // @ts-ignore: decorator @builtin - export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } export namespace rmw16 { // @ts-ignore: decorator @builtin - export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } export namespace rmw32 { // @ts-ignore: decorator @builtin - export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } export namespace rmw { // @ts-ignore: decorator @builtin - export declare function add(offset: usize, value: i64, immOffset?: usize): i64; + export declare function add(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function sub(offset: usize, value: i64, immOffset?: usize): i64; + export declare function sub(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function and(offset: usize, value: i64, immOffset?: usize): i64; + export declare function and(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function or(offset: usize, value: i64, immOffset?: usize): i64; + export declare function or(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @builtin - export declare function xor(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xor(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function xchg(offset: usize, value: i64, immOffset?: usize): i64; + export declare function xchg(ptr: usize, value: i64, immOffset?: usize): i64; // @ts-ignore: decorator @unsafe @builtin - export declare function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export declare function cmpxchg(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } } } @@ -866,7 +866,7 @@ export namespace f32 { // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f32; + export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f32; // @ts-ignore: decorator @builtin @@ -890,7 +890,7 @@ export namespace f32 { // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void; + export declare function store(ptr: usize, value: f32, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @builtin @@ -945,7 +945,7 @@ export namespace f64 { // @ts-ignore: decorator @builtin - export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f64; + export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f64; // @ts-ignore: decorator @builtin @@ -969,7 +969,7 @@ export namespace f64 { // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void; + export declare function store(ptr: usize, value: f64, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @builtin @@ -1001,13 +1001,25 @@ export namespace v128 { @builtin export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128; + // @ts-ignore: decorator + @builtin + export declare function swizzle(a: v128, s: v128): v128; + // @ts-ignore: decorator @unsafe @builtin - export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): v128; + export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): v128; // @ts-ignore: decorator @unsafe @builtin - export declare function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void; + export declare function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128; + + // @ts-ignore: decorator + @unsafe @builtin + export declare function load_ext(ptr: usize, immOffset?: usize, immAlign?: usize): v128; + + // @ts-ignore: decorator + @unsafe @builtin + export declare function store(ptr: usize, value: v128, immOffset?: usize, immAlign?: usize): void; // @ts-ignore: decorator @builtin @@ -1057,6 +1069,10 @@ export namespace v128 { @builtin export declare function xor(a: v128, b: v128): v128; + // @ts-ignore: decorator + @builtin + export declare function andnot(a: v128, b: v128): v128; + // @ts-ignore: decorator @builtin export declare function not(a: v128): v128; @@ -1405,6 +1421,14 @@ export namespace i16x8 { // @ts-ignore: decorator @builtin export declare function widen_high_i8x16_u(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + + // @ts-ignore: decorator + @builtin + export declare function load8x8_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } // @ts-ignore: decorator @@ -1524,6 +1548,14 @@ export namespace i32x4 { // @ts-ignore: decorator @builtin export declare function widen_high_i16x8_u(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function load16x4_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + + // @ts-ignore: decorator + @builtin + export declare function load16x4_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } // @ts-ignore: decorator @@ -1587,6 +1619,14 @@ export namespace i64x2 { // @ts-ignore: decorator @builtin export declare function trunc_sat_f64x2_u(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function load32x2_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + + // @ts-ignore: decorator + @builtin + export declare function load32x2_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } // @ts-ignore: decorator @@ -1788,6 +1828,35 @@ export namespace v8x16 { l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8 ): v128; + + // @ts-ignore: decorator + @builtin + export declare function swizzle(a: v128, s: v128): v128; + + // @ts-ignore: decorator + @unsafe @builtin + export declare function load_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128; +} + +export namespace v16x8 { + + // @ts-ignore: decorator + @unsafe @builtin + export declare function load_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128; +} + +export namespace v32x4 { + + // @ts-ignore: decorator + @unsafe @builtin + export declare function load_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128; +} + +export namespace v64x2 { + + // @ts-ignore: decorator + @unsafe @builtin + export declare function load_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } // @ts-ignore: decorator diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index cd83a7c7af..edb4625e9e 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -188,9 +188,9 @@ declare function lengthof any>(func?: T): i32; /** Atomic operations. */ declare namespace atomic { /** Atomically loads an integer value from memory and returns it. */ - export function load(offset: usize, immOffset?: usize): T; + export function load(ptr: usize, immOffset?: usize): T; /** Atomically stores an integer value to memory. */ - export function store(offset: usize, value: T, immOffset?: usize): void; + export function store(ptr: usize, value: T, immOffset?: usize): void; /** Atomically adds an integer value in memory. */ export function add(ptr: usize, value: T, immOffset?: usize): T; /** Atomically subtracts an integer value in memory. */ @@ -247,87 +247,87 @@ declare namespace i32 { /** Largest representable value. */ export const MAX_VALUE: i32; /** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */ - export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32; /** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */ - export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32; /** Loads a 16-bit signed integer value from memory and returns it as a 32-bit integer. */ - export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32; /** Loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */ - export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32; /** Loads a 32-bit integer value from memory. */ - export function load(offset: usize, immOffset?: usize, immAlign?: usize): i32; + export function load(ptr: usize, immOffset?: usize, immAlign?: usize): i32; /** Stores a 32-bit integer value to memory as an 8-bit integer. */ - export function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export function store8(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; /** Stores a 32-bit integer value to memory as a 16-bit integer. */ - export function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export function store16(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; /** Stores a 32-bit integer value to memory. */ - export function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export function store(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void; /** Atomic 32-bit integer operations. */ export namespace atomic { /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */ - export function load8_u(offset: usize, immOffset?: usize): i32; + export function load8_u(ptr: usize, immOffset?: usize): i32; /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */ - export function load16_u(offset: usize, immOffset?: usize): i32; + export function load16_u(ptr: usize, immOffset?: usize): i32; /** Atomically loads a 32-bit integer value from memory and returns it. */ - export function load(offset: usize, immOffset?: usize): i32; + export function load(ptr: usize, immOffset?: usize): i32; /** Atomically stores a 32-bit integer value to memory as an 8-bit integer. */ - export function store8(offset: usize, value: i32, immOffset?: usize): void; + export function store8(ptr: usize, value: i32, immOffset?: usize): void; /** Atomically stores a 32-bit integer value to memory as a 16-bit integer. */ - export function store16(offset: usize, value: i32, immOffset?: usize): void; + export function store16(ptr: usize, value: i32, immOffset?: usize): void; /** Atomically stores a 32-bit integer value to memory. */ - export function store(offset: usize, value: i32, immOffset?: usize): void; + export function store(ptr: usize, value: i32, immOffset?: usize): void; /** Performs a wait operation on a 32-bit integer value in memory suspending this agent if the condition is met. */ export function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult; /** Atomic 32-bit integer read-modify-write operations on 8-bit values. */ export namespace rmw8 { /** Atomically adds an 8-bit unsigned integer value in memory. */ - export function add_u(offset: usize, value: i32, immOffset?: usize): i32; + export function add_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically subtracts an 8-bit unsigned integer value in memory. */ - export function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise AND operation an 8-bit unsigned integer value in memory. */ - export function and_u(offset: usize, value: i32, immOffset?: usize): i32; + export function and_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise OR operation an 8-bit unsigned integer value in memory. */ - export function or_u(offset: usize, value: i32, immOffset?: usize): i32; + export function or_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise XOR operation an 8-bit unsigned integer value in memory. */ - export function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically exchanges an 8-bit unsigned integer value in memory. */ - export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */ - export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } /** Atomic 32-bit integer read-modify-write operations on 16-bit values. */ export namespace rmw16 { /** Atomically adds a 16-bit unsigned integer value in memory. */ - export function add_u(offset: usize, value: i32, immOffset?: usize): i32; + export function add_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically adds a 16-bit unsigned integer value in memory. */ - export function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise AND operation a 16-bit unsigned integer value in memory. */ - export function and_u(offset: usize, value: i32, immOffset?: usize): i32; + export function and_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise OR operation a 16-bit unsigned integer value in memory. */ - export function or_u(offset: usize, value: i32, immOffset?: usize): i32; + export function or_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise XOR operation a 16-bit unsigned integer value in memory. */ - export function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically exchanges a 16-bit unsigned integer value in memory. */ - export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */ - export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } /** Atomic 32-bit integer read-modify-write operations. */ export namespace rmw { /** Atomically adds a 32-bit integer value in memory. */ - export function add(offset: usize, value: i32, immOffset?: usize): i32; + export function add(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically subtracts a 32-bit integer value in memory. */ - export function sub(offset: usize, value: i32, immOffset?: usize): i32; + export function sub(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise AND operation a 32-bit integer value in memory. */ - export function and(offset: usize, value: i32, immOffset?: usize): i32; + export function and(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise OR operation a 32-bit integer value in memory. */ - export function or(offset: usize, value: i32, immOffset?: usize): i32; + export function or(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically performs a bitwise XOR operation a 32-bit integer value in memory. */ - export function xor(offset: usize, value: i32, immOffset?: usize): i32; + export function xor(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically exchanges a 32-bit integer value in memory. */ - export function xchg(offset: usize, value: i32, immOffset?: usize): i32; + export function xchg(ptr: usize, value: i32, immOffset?: usize): i32; /** Atomically compares and exchanges a 32-bit integer value in memory if the condition is met. */ - export function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + export function cmpxchg(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } } } @@ -339,114 +339,114 @@ declare namespace i64 { /** Largest representable value. */ export const MAX_VALUE: i64; /** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */ - export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads a 16-bit signed integer value from memory and returns it as a 64-bit integer. */ - export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads a 32-bit signed integer value from memory and returns it as a 64-bit integer. */ - export function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load32_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load32_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Loads a 64-bit unsigned integer value from memory. */ - export function load(offset: usize, immOffset?: usize, immAlign?: usize): i64; + export function load(ptr: usize, immOffset?: usize, immAlign?: usize): i64; /** Stores a 64-bit integer value to memory as an 8-bit integer. */ - export function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export function store8(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; /** Stores a 64-bit integer value to memory as a 16-bit integer. */ - export function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export function store16(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; /** Stores a 64-bit integer value to memory as a 32-bit integer. */ - export function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export function store32(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; /** Stores a 64-bit integer value to memory. */ - export function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + export function store(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void; /** Atomic 64-bit integer operations. */ export namespace atomic { /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load8_u(offset: usize, immOffset?: usize): i64; + export function load8_u(ptr: usize, immOffset?: usize): i64; /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load16_u(offset: usize, immOffset?: usize): i64; + export function load16_u(ptr: usize, immOffset?: usize): i64; /** Atomically loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */ - export function load32_u(offset: usize, immOffset?: usize): i64; + export function load32_u(ptr: usize, immOffset?: usize): i64; /** Atomically loads a 64-bit integer value from memory and returns it. */ - export function load(offset: usize, immOffset?: usize): i64; + export function load(ptr: usize, immOffset?: usize): i64; /** Atomically stores a 64-bit integer value to memory as an 8-bit integer. */ - export function store8(offset: usize, value: i64, immOffset?: usize): void; + export function store8(ptr: usize, value: i64, immOffset?: usize): void; /** Atomically stores a 64-bit integer value to memory as a 16-bit integer. */ - export function store16(offset: usize, value: i64, immOffset?: usize): void; + export function store16(ptr: usize, value: i64, immOffset?: usize): void; /** Atomically stores a 64-bit integer value to memory as a 32-bit integer. */ - export function store32(offset: usize, value: i64, immOffset?: usize): void; + export function store32(ptr: usize, value: i64, immOffset?: usize): void; /** Atomically stores a 64-bit integer value to memory. */ - export function store(offset: usize, value: i64, immOffset?: usize): void; + export function store(ptr: usize, value: i64, immOffset?: usize): void; /** Performs a wait operation on a 64-bit integer value in memory suspending this agent if the condition is met. */ export function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult; /** Atomic 64-bit integer read-modify-write operations on 8-bit values. */ export namespace rmw8 { /** Atomically adds an 8-bit unsigned integer value in memory. */ - export function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export function add_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically subtracts an 8-bit unsigned integer value in memory. */ - export function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise AND operation on an 8-bit unsigned integer value in memory. */ - export function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export function and_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise OR operation on an 8-bit unsigned integer value in memory. */ - export function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export function or_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise XOR operation on an 8-bit unsigned integer value in memory. */ - export function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically exchanges an 8-bit unsigned integer value in memory. */ - export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */ - export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } /** Atomic 64-bit integer read-modify-write operations on 16-bit values. */ export namespace rmw16 { /** Atomically adds a 16-bit unsigned integer value in memory. */ - export function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export function add_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically subtracts a 16-bit unsigned integer value in memory. */ - export function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise AND operation on a 16-bit unsigned integer value in memory. */ - export function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export function and_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise OR operation on a 16-bit unsigned integer value in memory. */ - export function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export function or_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise XOR operation on a 16-bit unsigned integer value in memory. */ - export function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically exchanges a 16-bit unsigned integer value in memory. */ - export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */ - export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } /** Atomic 64-bit integer read-modify-write operations on 32-bit values. */ export namespace rmw32 { /** Atomically adds a 32-bit unsigned integer value in memory. */ - export function add_u(offset: usize, value: i64, immOffset?: usize): i64; + export function add_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically subtracts a 32-bit unsigned integer value in memory. */ - export function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise AND operation on a 32-bit unsigned integer value in memory. */ - export function and_u(offset: usize, value: i64, immOffset?: usize): i64; + export function and_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise OR operation on a 32-bit unsigned integer value in memory. */ - export function or_u(offset: usize, value: i64, immOffset?: usize): i64; + export function or_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise XOR operation on a 32-bit unsigned integer value in memory. */ - export function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically exchanges a 32-bit unsigned integer value in memory. */ - export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically compares and exchanges a 32-bit unsigned integer value in memory if the condition is met. */ - export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } /** Atomic 64-bit integer read-modify-write operations. */ export namespace rmw { /** Atomically adds a 64-bit integer value in memory. */ - export function add(offset: usize, value: i64, immOffset?: usize): i64; + export function add(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically subtracts a 64-bit integer value in memory. */ - export function sub(offset: usize, value: i64, immOffset?: usize): i64; + export function sub(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise AND operation on a 64-bit integer value in memory. */ - export function and(offset: usize, value: i64, immOffset?: usize): i64; + export function and(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise OR operation on a 64-bit integer value in memory. */ - export function or(offset: usize, value: i64, immOffset?: usize): i64; + export function or(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically performs a bitwise XOR operation on a 64-bit integer value in memory. */ - export function xor(offset: usize, value: i64, immOffset?: usize): i64; + export function xor(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically exchanges a 64-bit integer value in memory. */ - export function xchg(offset: usize, value: i64, immOffset?: usize): i64; + export function xchg(ptr: usize, value: i64, immOffset?: usize): i64; /** Atomically compares and exchanges a 64-bit integer value in memory if the condition is met. */ - export function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + export function cmpxchg(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } } } @@ -510,9 +510,9 @@ declare namespace f32 { /** Difference between 1 and the smallest representable value greater than 1. */ export const EPSILON: f32; /** Loads a 32-bit float from memory. */ - export function load(offset: usize, immOffset?: usize, immAlign?: usize): f32; + export function load(ptr: usize, immOffset?: usize, immAlign?: usize): f32; /** Stores a 32-bit float to memory. */ - export function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void; + export function store(ptr: usize, value: f32, immOffset?: usize, immAlign?: usize): void; } /** Converts any other numeric value to a 64-bit float. */ declare function f64(value: any): f64; @@ -530,9 +530,9 @@ declare namespace f64 { /** Difference between 1 and the smallest representable value greater than 1. */ export const EPSILON: f64; /** Loads a 64-bit float from memory. */ - export function load(offset: usize, immOffset?: usize, immAlign?: usize): f64; + export function load(ptr: usize, immOffset?: usize, immAlign?: usize): f64; /** Stores a 64-bit float to memory. */ - export function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void; + export function store(ptr: usize, value: f64, immOffset?: usize, immAlign?: usize): void; } /** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */ declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128; @@ -545,10 +545,16 @@ declare namespace v128 { export function replace_lane(x: v128, idx: u8, value: T): v128; /** Selects lanes from either 128-bit vector according to the specified lane indexes. */ export function shuffle(a: v128, b: v128, ...lanes: u8[]): v128; + /** Selects 8-bit lanes from the first 128-bit vector according to the indexes [0-15] specified by the 8-bit lanes of the second 128-bit vector. */ + export function swizzle(a: v128, s: v128): v128; /** Loads a 128-bit vector from memory. */ - export function load(offset: usize, immOffset?: usize, immAlign?: usize): v128; + export function load(ptr: usize, immOffset?: usize, immAlign?: usize): v128; + /** Creates a 128-bit vector with identical lanes by loading the splatted value. */ + export function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128 + /** Creates a 128-bit vector by loading the lanes of the specified type and extending each to the next larger type. */ + export function load_ext(ptr: usize, immOffset?: usize, immAlign?: usize): v128 /** Stores a 128-bit vector to memory. */ - export function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void; + export function store(ptr: usize, value: v128, immOffset?: usize, immAlign?: usize): void; /** Adds each lane of two 128-bit vectors. */ export function add(a: v128, b: v128): v128; /** Subtracts each lane of two 128-bit vectors. */ @@ -567,13 +573,15 @@ declare namespace v128 { export function shl(a: v128, b: i32): v128; /** Performs a bitwise right shift on each lane of a 128-bit vector by a scalar. */ export function shr(a: v128, b: i32): v128; - /** Performs the bitwise AND operation on each lane of two 128-bit vectors. */ + /** Performs the bitwise AND operation on two 128-bit vectors. */ export function and(a: v128, b: v128): v128; - /** Performs the bitwise OR operation on each lane of two 128-bit vectors. */ + /** Performs the bitwise OR operation on two 128-bit vectors. */ export function or(a: v128, b: v128): v128; - /** Performs the bitwise XOR operation on each lane of two 128-bit vectors. */ + /** Performs the bitwise XOR operation on two 128-bit vectors. */ export function xor(a: v128, b: v128): v128; - /** Performs the bitwise NOT operation on each lane of a 128-bit vector. */ + /** Performs the bitwise ANDNOT operation on two 128-bit vectors. */ + export function andnot(a: v128, b: v128): v128; + /** Performs the bitwise NOT operation on a 128-bit vector. */ export function not(a: v128): v128; /** Selects bits of either 128-bit vector according to the specified mask. */ export function bitselect(v1: v128, v2: v128, mask: v128): v128; @@ -747,6 +755,10 @@ declare namespace i16x8 { export function widen_high_i8x16_s(a: v128): v128; /** Widens the high 8-bit unsigned integer lanes of a 128-bit vector to 16-bit unsigned integer lanes. */ export function widen_high_i8x16_u(a: v128): v128; + /** Creates a vector with eight 16-bit integer lanes by loading and sign extending eight 8-bit integers. */ + export function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + /** Creates a vector with eight 16-bit integer lanes by loading and zero extending eight 8-bit integers. */ + export function load8x8_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } /** Initializes a 128-bit vector from four 32-bit integer values. Arguments must be compile-time constants. */ declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128; @@ -807,6 +819,10 @@ declare namespace i32x4 { export function widen_high_i16x8_s(a: v128): v128; /** Widens the high 16-bit unsigned integer lanes of a 128-bit vector to 32-bit unsigned integer lanes. */ export function widen_high_i16x8_u(a: v128): v128; + /** Creates a vector with four 32-bit integer lanes by loading and sign extending four 16-bit integers. */ + export function load16x4_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + /** Creates a vector with four 32-bit integer lanes by loading and zero extending four 16-bit integers. */ + export function load16x4_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } /** Initializes a 128-bit vector from two 64-bit integer values. Arguments must be compile-time constants. */ declare function i64x2(a: i64, b: i64): v128; @@ -839,6 +855,10 @@ declare namespace i64x2 { export function trunc_sat_f64x2_s(a: v128): v128; /** Truncates each 64-bit float lane of a 128-bit vector to an unsigned integer with saturation. */ export function trunc_sat_f64x2_u(a: v128): v128; + /** Creates a vector with two 64-bit integer lanes by loading and sign extending two 32-bit integers. */ + export function load32x2_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128; + /** Creates a vector with two 64-bit integer lanes by loading and zero extending two 32-bit integers. */ + export function load32x2_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128; } /** Initializes a 128-bit vector from four 32-bit float values. Arguments must be compile-time constants. */ declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128; @@ -937,8 +957,24 @@ declare namespace f64x2 { export function qfms(a: v128, b: v128, c: v128): v128; } declare namespace v8x16 { - /** Selects 8-bit lanes from either 128-bit vector according to the specified lane indexes. */ + /** Selects 8-bit lanes from either 128-bit vector according to the specified [0-15] respectively [16-31] lane indexes. */ export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128; + /** Selects 8-bit lanes from the first 128-bit vector according to the indexes [0-15] specified by the 8-bit lanes of the second 128-bit vector. */ + export function swizzle(a: v128, s: v128): v128; + /** Loads an 8-bit integer and splats it sixteen times forming a new 128-bit vector. */ + export function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128; +} +declare namespace v16x8 { + /** Loads a 16-bit integer and splats it eight times forming a new 128-bit vector. */ + export function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128; +} +declare namespace v32x4 { + /** Loads a 32-bit integer and splats it four times forming a new 128-bit vector. */ + export function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128; +} +declare namespace v64x2 { + /** Loads a 64-bit integer and splats it two times forming a new 128-bit vector. */ + export function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128; } /** Macro type evaluating to the underlying native WebAssembly type. */ declare type native = T; diff --git a/tests/compiler.js b/tests/compiler.js index 82c0c3b772..3f286b89df 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -247,17 +247,21 @@ function runTest(basename) { var glue = {}; if (fs.existsSync(gluePath)) glue = require(gluePath); - if (!testInstantiate(basename, untouchedBuffer, "untouched", glue)) { - failed = true; - failedTests.add(basename); - } else { - console.log(); - if (!testInstantiate(basename, optimizedBuffer, "optimized", glue)) { + if (!config.skipInstantiate) { + if (!testInstantiate(basename, untouchedBuffer, "untouched", glue)) { failed = true; failedTests.add(basename); + } else { + console.log(); + if (!testInstantiate(basename, optimizedBuffer, "optimized", glue)) { + failed = true; + failedTests.add(basename); + } } + console.log(); + } else { + console.log("- " + colorsUtil.yellow("instantiate SKIPPED") + "\n"); } - console.log(); }); if (failed) return 1; }); diff --git a/tests/compiler/features/simd.json b/tests/compiler/features/simd.json index 2344125c9b..314c29279f 100644 --- a/tests/compiler/features/simd.json +++ b/tests/compiler/features/simd.json @@ -4,5 +4,6 @@ ], "asc_flags": [ "--runtime none" - ] + ], + "skipInstantiate": true } diff --git a/tests/compiler/features/simd.optimized.wat b/tests/compiler/features/simd.optimized.wat index 448b21f960..eefe5781a4 100644 --- a/tests/compiler/features/simd.optimized.wat +++ b/tests/compiler/features/simd.optimized.wat @@ -1,9 +1,144 @@ (module (type $FUNCSIG$v (func)) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00s\00i\00m\00d\00.\00t\00s") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00s\00t\00u\00b\00.\00t\00s") + (data (i32.const 56) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00s\00i\00m\00d\00.\00t\00s") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (func $start (; 0 ;) (type $FUNCSIG$v) + (start $start) + (func $~lib/rt/stub/maybeGrowMemory (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + memory.size + local.tee $2 + i32.const 16 + i32.shl + local.tee $1 + i32.gt_u + if + local.get $2 + local.get $0 + local.get $1 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $0 + global.set $~lib/rt/stub/offset + ) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + (local $1 i32) + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $1 + i32.const -64 + i32.sub + call $~lib/rt/stub/maybeGrowMemory + local.get $1 + i32.const 16 + i32.sub + local.tee $0 + i32.const 64 + i32.store + local.get $0 + i32.const -1 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 64 + i32.store offset=12 + local.get $1 + ) + (func $~lib/rt/stub/__free (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 71 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + i32.const -1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 73 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/stub/offset + local.get $1 + i32.load + local.get $0 + i32.add + i32.eq + if + local.get $1 + global.set $~lib/rt/stub/offset + end + ) + (func $start (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 112 + global.set $~lib/rt/stub/startOffset + i32.const 112 + global.set $~lib/rt/stub/offset + call $~lib/rt/stub/__alloc + local.tee $0 + local.get $0 + v128.load offset=16 + v128.store offset=32 + local.get $0 + call $~lib/rt/stub/__free + ) + (func $null (; 5 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/features/simd.ts b/tests/compiler/features/simd.ts index 1339c204ad..4627c42367 100644 --- a/tests/compiler/features/simd.ts +++ b/tests/compiler/features/simd.ts @@ -48,11 +48,12 @@ function test_v128(): void { ) == v128(16, 2, 14, 4, 12, 6, 10, 8, 8, 10, 6, 12, 4, 14, 2, 16), ); + { + let ptr = __alloc(64, 0); + v128.store(ptr, v128.load(ptr, 16), 32); + __free(ptr); + } // generic operations are tested by the aliases below already - - // FIXME: node/nightly currently fails to validate this. works in node/v8-canary. - // var base = memory.allocate(256); - // v128.store(base, v128.load(base + 16, 32), 64); } function test_i8x16(): void { @@ -205,6 +206,29 @@ function test_i16x8(): void { assert(i16x8.widen_low_i8x16_u(i8x16.replace_lane(i8x16.splat(-1), 8, 0)) == i16x8.splat(255)); assert(i16x8.widen_high_i8x16_s(i8x16.replace_lane(i8x16.splat(-1), 0, 0)) == i16x8.splat(-1)); assert(i16x8.widen_high_i8x16_u(i8x16.replace_lane(i8x16.splat(-1), 0, 0)) == i16x8.splat(255)); + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 1); + // store(ptr, 2, 1); + // store(ptr, 3, 2); + // store(ptr, 4, 3); + // store(ptr, 5, 4); + // store(ptr, 6, 5); + // store(ptr, 7, 6); + // store(ptr, -1, 7); + // assert( + // i16x8.load8x8_s(ptr) + // == + // v128(1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, -1, -1) + // ); + // assert( + // i16x8.load8x8_u(ptr) + // == + // v128(1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, -1, 0) + // ); + // __free(ptr); + // } } function test_i32x4(): void { @@ -266,6 +290,25 @@ function test_i32x4(): void { assert(i32x4.widen_low_i16x8_u(i16x8.replace_lane(i16x8.splat(-1), 4, 0)) == i32x4.splat(65535)); assert(i32x4.widen_high_i16x8_s(i16x8.replace_lane(i16x8.splat(-1), 0, 0)) == i32x4.splat(-1)); assert(i32x4.widen_high_i16x8_u(i16x8.replace_lane(i16x8.splat(-1), 0, 0)) == i32x4.splat(65535)); + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 1); + // store(ptr, 2, 2); + // store(ptr, 3, 4); + // store(ptr, -1, 6); + // assert( + // i32x4.load16x4_s(ptr) + // == + // v128(1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, -1, -1, -1, -1) + // ); + // assert( + // i32x4.load16x4_u(ptr) + // == + // v128(1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, -1, -1, 0, 0) + // ); + // __free(ptr); + // } } function test_i64x2(): void { @@ -308,6 +351,23 @@ function test_i64x2(): void { == i64x2.splat(0) ); + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 1); + // store(ptr, -1, 4); + // assert( + // i64x2.load32x2_s(ptr) + // == + // v128(1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1) + // ); + // assert( + // i64x2.load32x2_u(ptr) + // == + // v128(1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0) + // ); + // __free(ptr); + // } } function test_f32x4(): void { @@ -442,6 +502,65 @@ function test_v8x16(): void { == v128(0, 17, 2, 19, 4, 21, 6, 23, 8, 25, 10, 27, 12, 29, 14, 31) ); + var c = v128(16, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + assert( + v8x16.swizzle(a, c) + == + v128(0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + ); + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 42); + // assert( + // v8x16.load_splat(ptr) + // == + // v128(42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42) + // ); + // __free(ptr); + // } +} + +function test_v16x8(): void { + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 42); + // assert( + // v16x8.load_splat(ptr) + // == + // v128(42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0) + // ); + // __free(ptr); + // } +} + +function test_v32x4(): void { + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 42); + // assert( + // v32x4.load_splat(ptr) + // == + // v128(42, 0, 0, 0, 42, 0, 0, 0, 42, 0, 0, 0, 42, 0, 0, 0) + // ); + // __free(ptr); + // } +} + +function test_v64x2(): void { + // TODO: not yet implemented in binaryen/src/wasm-interpreter.h + // { + // let ptr = __alloc(16, 0); + // store(ptr, 42); + // assert( + // v64x2.load_splat(ptr) + // == + // v128(42, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0) + // ); + // __free(ptr); + // } } if (ASC_FEATURE_SIMD) { @@ -453,4 +572,7 @@ if (ASC_FEATURE_SIMD) { test_f32x4(); test_f64x2(); test_v8x16(); + test_v16x8(); + test_v32x4(); + test_v64x2(); } diff --git a/tests/compiler/features/simd.untouched.wat b/tests/compiler/features/simd.untouched.wat index a5d87cec47..69b7e1d2a6 100644 --- a/tests/compiler/features/simd.untouched.wat +++ b/tests/compiler/features/simd.untouched.wat @@ -1,23 +1,196 @@ (module (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00s\00i\00m\00d\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00s\00t\00u\00b\00.\00t\00s\00") + (data (i32.const 56) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00s\00i\00m\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/builtins/i16.MAX_VALUE i32 (i32.const 32767)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/u8.MAX_VALUE i32 (i32.const 255)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) (global $~lib/builtins/u16.MAX_VALUE i32 (i32.const 65535)) + (global $~lib/heap/__heap_base i32 (i32.const 104)) (export "memory" (memory $0)) (start $start) - (func $features/simd/test_v128 (; 1 ;) (type $FUNCSIG$v) - nop + (func $~lib/rt/stub/maybeGrowMemory (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + memory.size + local.set $1 + local.get $1 + i32.const 16 + i32.shl + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $0 + global.set $~lib/rt/stub/offset + ) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $3 + i32.const 16 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + local.set $5 + local.get $2 + local.get $5 + i32.add + call $~lib/rt/stub/maybeGrowMemory + local.get $2 + i32.const 16 + i32.sub + local.set $6 + local.get $6 + local.get $5 + i32.store + local.get $6 + i32.const -1 + i32.store offset=4 + local.get $6 + local.get $1 + i32.store offset=8 + local.get $6 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__free (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 71 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + local.set $1 + local.get $1 + i32.load offset=4 + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 73 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.load + i32.add + global.get $~lib/rt/stub/offset + i32.eq + if + local.get $1 + global.set $~lib/rt/stub/offset + end + ) + (func $features/simd/test_v128 (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 64 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $0 + local.get $0 + local.get $0 + v128.load offset=16 + v128.store offset=32 + local.get $0 + call $~lib/rt/stub/__free ) - (func $features/simd/test_i8x16 (; 2 ;) (type $FUNCSIG$v) + (func $features/simd/test_i8x16 (; 5 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -36,8 +209,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 60 + i32.const 72 + i32.const 61 i32.const 2 call $~lib/builtins/abort unreachable @@ -54,8 +227,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 62 + i32.const 72 + i32.const 63 i32.const 2 call $~lib/builtins/abort unreachable @@ -73,8 +246,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 64 + i32.const 72 + i32.const 65 i32.const 2 call $~lib/builtins/abort unreachable @@ -90,8 +263,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 65 + i32.const 72 + i32.const 66 i32.const 2 call $~lib/builtins/abort unreachable @@ -107,8 +280,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 66 + i32.const 72 + i32.const 67 i32.const 2 call $~lib/builtins/abort unreachable @@ -123,8 +296,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 67 + i32.const 72 + i32.const 68 i32.const 2 call $~lib/builtins/abort unreachable @@ -140,8 +313,8 @@ i32.eqz if i32.const 0 - i32.const 24 i32.const 72 + i32.const 73 i32.const 2 call $~lib/builtins/abort unreachable @@ -157,8 +330,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 73 + i32.const 72 + i32.const 74 i32.const 2 call $~lib/builtins/abort unreachable @@ -172,8 +345,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 74 + i32.const 72 + i32.const 75 i32.const 2 call $~lib/builtins/abort unreachable @@ -189,8 +362,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 75 + i32.const 72 + i32.const 76 i32.const 2 call $~lib/builtins/abort unreachable @@ -206,8 +379,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 80 + i32.const 72 + i32.const 81 i32.const 2 call $~lib/builtins/abort unreachable @@ -238,8 +411,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 118 + i32.const 72 + i32.const 119 i32.const 2 call $~lib/builtins/abort unreachable @@ -255,8 +428,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 119 + i32.const 72 + i32.const 120 i32.const 2 call $~lib/builtins/abort unreachable @@ -272,8 +445,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 120 + i32.const 72 + i32.const 121 i32.const 2 call $~lib/builtins/abort unreachable @@ -289,8 +462,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 121 + i32.const 72 + i32.const 122 i32.const 2 call $~lib/builtins/abort unreachable @@ -306,8 +479,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 122 + i32.const 72 + i32.const 123 i32.const 2 call $~lib/builtins/abort unreachable @@ -323,8 +496,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 123 + i32.const 72 + i32.const 124 i32.const 2 call $~lib/builtins/abort unreachable @@ -340,8 +513,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 124 + i32.const 72 + i32.const 125 i32.const 2 call $~lib/builtins/abort unreachable @@ -357,8 +530,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 125 + i32.const 72 + i32.const 126 i32.const 2 call $~lib/builtins/abort unreachable @@ -374,8 +547,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 126 + i32.const 72 + i32.const 127 i32.const 2 call $~lib/builtins/abort unreachable @@ -391,14 +564,14 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 127 + i32.const 72 + i32.const 128 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_i16x8 (; 3 ;) (type $FUNCSIG$v) + (func $features/simd/test_i16x8 (; 6 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -417,8 +590,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 134 + i32.const 72 + i32.const 135 i32.const 2 call $~lib/builtins/abort unreachable @@ -435,8 +608,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 136 + i32.const 72 + i32.const 137 i32.const 2 call $~lib/builtins/abort unreachable @@ -454,8 +627,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 138 + i32.const 72 + i32.const 139 i32.const 2 call $~lib/builtins/abort unreachable @@ -471,8 +644,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 139 + i32.const 72 + i32.const 140 i32.const 2 call $~lib/builtins/abort unreachable @@ -488,8 +661,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 140 + i32.const 72 + i32.const 141 i32.const 2 call $~lib/builtins/abort unreachable @@ -504,8 +677,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 141 + i32.const 72 + i32.const 142 i32.const 2 call $~lib/builtins/abort unreachable @@ -521,8 +694,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 146 + i32.const 72 + i32.const 147 i32.const 2 call $~lib/builtins/abort unreachable @@ -538,8 +711,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 147 + i32.const 72 + i32.const 148 i32.const 2 call $~lib/builtins/abort unreachable @@ -553,8 +726,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 148 + i32.const 72 + i32.const 149 i32.const 2 call $~lib/builtins/abort unreachable @@ -570,8 +743,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 149 + i32.const 72 + i32.const 150 i32.const 2 call $~lib/builtins/abort unreachable @@ -587,8 +760,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 154 + i32.const 72 + i32.const 155 i32.const 2 call $~lib/builtins/abort unreachable @@ -619,8 +792,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 192 + i32.const 72 + i32.const 193 i32.const 2 call $~lib/builtins/abort unreachable @@ -636,8 +809,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 193 + i32.const 72 + i32.const 194 i32.const 2 call $~lib/builtins/abort unreachable @@ -653,8 +826,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 194 + i32.const 72 + i32.const 195 i32.const 2 call $~lib/builtins/abort unreachable @@ -670,8 +843,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 195 + i32.const 72 + i32.const 196 i32.const 2 call $~lib/builtins/abort unreachable @@ -687,8 +860,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 196 + i32.const 72 + i32.const 197 i32.const 2 call $~lib/builtins/abort unreachable @@ -704,8 +877,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 197 + i32.const 72 + i32.const 198 i32.const 2 call $~lib/builtins/abort unreachable @@ -721,8 +894,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 198 + i32.const 72 + i32.const 199 i32.const 2 call $~lib/builtins/abort unreachable @@ -738,8 +911,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 199 + i32.const 72 + i32.const 200 i32.const 2 call $~lib/builtins/abort unreachable @@ -755,8 +928,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 200 + i32.const 72 + i32.const 201 i32.const 2 call $~lib/builtins/abort unreachable @@ -772,14 +945,14 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 201 + i32.const 72 + i32.const 202 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_i32x4 (; 4 ;) (type $FUNCSIG$v) + (func $features/simd/test_i32x4 (; 7 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -798,8 +971,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 212 + i32.const 72 + i32.const 236 i32.const 2 call $~lib/builtins/abort unreachable @@ -816,8 +989,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 214 + i32.const 72 + i32.const 238 i32.const 2 call $~lib/builtins/abort unreachable @@ -835,8 +1008,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 216 + i32.const 72 + i32.const 240 i32.const 2 call $~lib/builtins/abort unreachable @@ -852,8 +1025,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 217 + i32.const 72 + i32.const 241 i32.const 2 call $~lib/builtins/abort unreachable @@ -869,8 +1042,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 218 + i32.const 72 + i32.const 242 i32.const 2 call $~lib/builtins/abort unreachable @@ -885,8 +1058,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 219 + i32.const 72 + i32.const 243 i32.const 2 call $~lib/builtins/abort unreachable @@ -898,8 +1071,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 224 + i32.const 72 + i32.const 248 i32.const 2 call $~lib/builtins/abort unreachable @@ -911,8 +1084,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 225 + i32.const 72 + i32.const 249 i32.const 2 call $~lib/builtins/abort unreachable @@ -928,8 +1101,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 226 + i32.const 72 + i32.const 250 i32.const 2 call $~lib/builtins/abort unreachable @@ -945,8 +1118,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 231 + i32.const 72 + i32.const 255 i32.const 2 call $~lib/builtins/abort unreachable @@ -977,8 +1150,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 245 + i32.const 72 + i32.const 269 i32.const 2 call $~lib/builtins/abort unreachable @@ -994,8 +1167,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 246 + i32.const 72 + i32.const 270 i32.const 2 call $~lib/builtins/abort unreachable @@ -1011,8 +1184,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 247 + i32.const 72 + i32.const 271 i32.const 2 call $~lib/builtins/abort unreachable @@ -1028,8 +1201,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 248 + i32.const 72 + i32.const 272 i32.const 2 call $~lib/builtins/abort unreachable @@ -1045,8 +1218,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 249 + i32.const 72 + i32.const 273 i32.const 2 call $~lib/builtins/abort unreachable @@ -1062,8 +1235,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 250 + i32.const 72 + i32.const 274 i32.const 2 call $~lib/builtins/abort unreachable @@ -1079,8 +1252,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 251 + i32.const 72 + i32.const 275 i32.const 2 call $~lib/builtins/abort unreachable @@ -1096,8 +1269,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 252 + i32.const 72 + i32.const 276 i32.const 2 call $~lib/builtins/abort unreachable @@ -1113,8 +1286,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 253 + i32.const 72 + i32.const 277 i32.const 2 call $~lib/builtins/abort unreachable @@ -1130,14 +1303,14 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 254 + i32.const 72 + i32.const 278 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_i64x2 (; 5 ;) (type $FUNCSIG$v) + (func $features/simd/test_i64x2 (; 8 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -1152,8 +1325,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 273 + i32.const 72 + i32.const 316 i32.const 2 call $~lib/builtins/abort unreachable @@ -1170,8 +1343,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 275 + i32.const 72 + i32.const 318 i32.const 2 call $~lib/builtins/abort unreachable @@ -1189,8 +1362,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 277 + i32.const 72 + i32.const 320 i32.const 2 call $~lib/builtins/abort unreachable @@ -1206,8 +1379,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 278 + i32.const 72 + i32.const 321 i32.const 2 call $~lib/builtins/abort unreachable @@ -1222,8 +1395,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 279 + i32.const 72 + i32.const 322 i32.const 2 call $~lib/builtins/abort unreachable @@ -1235,8 +1408,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 284 + i32.const 72 + i32.const 327 i32.const 2 call $~lib/builtins/abort unreachable @@ -1248,8 +1421,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 285 + i32.const 72 + i32.const 328 i32.const 2 call $~lib/builtins/abort unreachable @@ -1265,8 +1438,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 286 + i32.const 72 + i32.const 329 i32.const 2 call $~lib/builtins/abort unreachable @@ -1282,14 +1455,14 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 291 + i32.const 72 + i32.const 334 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_f32x4 (; 6 ;) (type $FUNCSIG$v) + (func $features/simd/test_f32x4 (; 9 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -1309,8 +1482,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 315 + i32.const 72 + i32.const 375 i32.const 2 call $~lib/builtins/abort unreachable @@ -1327,8 +1500,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 317 + i32.const 72 + i32.const 377 i32.const 2 call $~lib/builtins/abort unreachable @@ -1346,8 +1519,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 319 + i32.const 72 + i32.const 379 i32.const 2 call $~lib/builtins/abort unreachable @@ -1363,8 +1536,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 320 + i32.const 72 + i32.const 380 i32.const 2 call $~lib/builtins/abort unreachable @@ -1380,8 +1553,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 321 + i32.const 72 + i32.const 381 i32.const 2 call $~lib/builtins/abort unreachable @@ -1401,8 +1574,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 323 + i32.const 72 + i32.const 383 i32.const 2 call $~lib/builtins/abort unreachable @@ -1418,8 +1591,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 324 + i32.const 72 + i32.const 384 i32.const 2 call $~lib/builtins/abort unreachable @@ -1434,8 +1607,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 325 + i32.const 72 + i32.const 385 i32.const 2 call $~lib/builtins/abort unreachable @@ -1447,8 +1620,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 326 + i32.const 72 + i32.const 386 i32.const 2 call $~lib/builtins/abort unreachable @@ -1460,8 +1633,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 327 + i32.const 72 + i32.const 387 i32.const 2 call $~lib/builtins/abort unreachable @@ -1477,8 +1650,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 328 + i32.const 72 + i32.const 388 i32.const 2 call $~lib/builtins/abort unreachable @@ -1494,8 +1667,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 333 + i32.const 72 + i32.const 393 i32.const 2 call $~lib/builtins/abort unreachable @@ -1525,8 +1698,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 342 + i32.const 72 + i32.const 402 i32.const 2 call $~lib/builtins/abort unreachable @@ -1542,8 +1715,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 343 + i32.const 72 + i32.const 403 i32.const 2 call $~lib/builtins/abort unreachable @@ -1559,8 +1732,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 344 + i32.const 72 + i32.const 404 i32.const 2 call $~lib/builtins/abort unreachable @@ -1576,8 +1749,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 345 + i32.const 72 + i32.const 405 i32.const 2 call $~lib/builtins/abort unreachable @@ -1593,8 +1766,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 346 + i32.const 72 + i32.const 406 i32.const 2 call $~lib/builtins/abort unreachable @@ -1610,8 +1783,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 347 + i32.const 72 + i32.const 407 i32.const 2 call $~lib/builtins/abort unreachable @@ -1627,8 +1800,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 348 + i32.const 72 + i32.const 408 i32.const 2 call $~lib/builtins/abort unreachable @@ -1644,8 +1817,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 349 + i32.const 72 + i32.const 409 i32.const 2 call $~lib/builtins/abort unreachable @@ -1660,14 +1833,14 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 350 + i32.const 72 + i32.const 410 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_f64x2 (; 7 ;) (type $FUNCSIG$v) + (func $features/simd/test_f64x2 (; 10 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -1687,8 +1860,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 377 + i32.const 72 + i32.const 437 i32.const 2 call $~lib/builtins/abort unreachable @@ -1705,8 +1878,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 379 + i32.const 72 + i32.const 439 i32.const 2 call $~lib/builtins/abort unreachable @@ -1724,8 +1897,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 381 + i32.const 72 + i32.const 441 i32.const 2 call $~lib/builtins/abort unreachable @@ -1741,8 +1914,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 382 + i32.const 72 + i32.const 442 i32.const 2 call $~lib/builtins/abort unreachable @@ -1758,8 +1931,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 383 + i32.const 72 + i32.const 443 i32.const 2 call $~lib/builtins/abort unreachable @@ -1779,8 +1952,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 385 + i32.const 72 + i32.const 445 i32.const 2 call $~lib/builtins/abort unreachable @@ -1796,8 +1969,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 386 + i32.const 72 + i32.const 446 i32.const 2 call $~lib/builtins/abort unreachable @@ -1812,8 +1985,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 387 + i32.const 72 + i32.const 447 i32.const 2 call $~lib/builtins/abort unreachable @@ -1825,8 +1998,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 388 + i32.const 72 + i32.const 448 i32.const 2 call $~lib/builtins/abort unreachable @@ -1838,8 +2011,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 389 + i32.const 72 + i32.const 449 i32.const 2 call $~lib/builtins/abort unreachable @@ -1855,8 +2028,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 390 + i32.const 72 + i32.const 450 i32.const 2 call $~lib/builtins/abort unreachable @@ -1872,8 +2045,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 395 + i32.const 72 + i32.const 455 i32.const 2 call $~lib/builtins/abort unreachable @@ -1903,8 +2076,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 404 + i32.const 72 + i32.const 464 i32.const 2 call $~lib/builtins/abort unreachable @@ -1920,8 +2093,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 405 + i32.const 72 + i32.const 465 i32.const 2 call $~lib/builtins/abort unreachable @@ -1937,8 +2110,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 406 + i32.const 72 + i32.const 466 i32.const 2 call $~lib/builtins/abort unreachable @@ -1954,8 +2127,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 407 + i32.const 72 + i32.const 467 i32.const 2 call $~lib/builtins/abort unreachable @@ -1971,8 +2144,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 408 + i32.const 72 + i32.const 468 i32.const 2 call $~lib/builtins/abort unreachable @@ -1988,8 +2161,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 409 + i32.const 72 + i32.const 469 i32.const 2 call $~lib/builtins/abort unreachable @@ -2005,8 +2178,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 410 + i32.const 72 + i32.const 470 i32.const 2 call $~lib/builtins/abort unreachable @@ -2022,8 +2195,8 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 411 + i32.const 72 + i32.const 471 i32.const 2 call $~lib/builtins/abort unreachable @@ -2038,16 +2211,17 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 412 + i32.const 72 + i32.const 472 i32.const 2 call $~lib/builtins/abort unreachable end ) - (func $features/simd/test_v8x16 (; 8 ;) (type $FUNCSIG$v) + (func $features/simd/test_v8x16 (; 11 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) + (local $2 v128) v128.const i32x4 0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c local.set $0 v128.const i32x4 0x13121110 0x17161514 0x1b1a1918 0x1f1e1d1c @@ -2063,14 +2237,52 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 440 + i32.const 72 + i32.const 500 i32.const 2 call $~lib/builtins/abort unreachable end + v128.const i32x4 0x0c0d0e10 0x08090a0b 0x04050607 0x00010203 + local.set $2 + local.get $0 + local.get $2 + v8x16.swizzle + v128.const i32x4 0x0c0d0e00 0x08090a0b 0x04050607 0x00010203 + i8x16.eq + i8x16.all_true + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 506 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $features/simd/test_v16x8 (; 12 ;) (type $FUNCSIG$v) + nop ) - (func $start:features/simd (; 9 ;) (type $FUNCSIG$v) + (func $features/simd/test_v32x4 (; 13 ;) (type $FUNCSIG$v) + nop + ) + (func $features/simd/test_v64x2 (; 14 ;) (type $FUNCSIG$v) + nop + ) + (func $start:features/simd (; 15 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $features/simd/test_v128 call $features/simd/test_i8x16 call $features/simd/test_i16x8 @@ -2079,10 +2291,13 @@ call $features/simd/test_f32x4 call $features/simd/test_f64x2 call $features/simd/test_v8x16 + call $features/simd/test_v16x8 + call $features/simd/test_v32x4 + call $features/simd/test_v64x2 ) - (func $start (; 10 ;) (type $FUNCSIG$v) + (func $start (; 16 ;) (type $FUNCSIG$v) call $start:features/simd ) - (func $null (; 11 ;) (type $FUNCSIG$v) + (func $null (; 17 ;) (type $FUNCSIG$v) ) )