Portable conversions

This commit is contained in:
dcodeIO
2017-12-15 17:23:04 +01:00
parent 7cf879fb4b
commit 4b3cc981a6
31 changed files with 1147 additions and 483 deletions

View File

@ -28,8 +28,8 @@ Getting started
This version of the compiler is not on [npm](https://www.npmjs.com/package/assemblyscript), yet, but if you'd like to try it today or even plan to contribute, this is how you do it: This version of the compiler is not on [npm](https://www.npmjs.com/package/assemblyscript), yet, but if you'd like to try it today or even plan to contribute, this is how you do it:
``` ```
$> git clone https://github.com/AssemblyScript/next.git $> git clone https://github.com/AssemblyScript/assemblyscript.git
$> cd next $> cd assemblyscript
$> npm install $> npm install
``` ```
@ -47,7 +47,7 @@ $> node bin/asc yourModule.ts
Building Building
-------- --------
Building an UMD bundle to `dist/assemblyscript.js` (does not bundle [binaryen.js](https://github.com/AssemblyScript/binaryen.js)): Building an UMD bundle to `dist/assemblyscript.js` (does not bundle [binaryen.js](https://github.com/AssemblyScript/binaryen.js) which remains an external dependency):
``` ```
$> npm run build $> npm run build

View File

@ -1,4 +1,4 @@
import { Compiler, Target, typeToNativeType, typeToNativeOne, typeToNativeZero } from "./compiler"; import { Compiler, Target, ConversionKind, typeToNativeType, typeToNativeOne, typeToNativeZero } from "./compiler";
import { DiagnosticCode } from "./diagnostics"; import { DiagnosticCode } from "./diagnostics";
import { Node, Expression } from "./ast"; import { Node, Expression } from "./ast";
import { Type } from "./types"; import { Type } from "./types";
@ -7,35 +7,48 @@ import { Program, ElementFlags, Element, Global, FunctionPrototype, Local } from
/** Initializes the specified program with built-in functions. */ /** Initializes the specified program with built-in functions. */
export function initialize(program: Program): void { export function initialize(program: Program): void {
// math
addFunction(program, "isNaN", true);
addFunction(program, "isFinite", true);
addFunction(program, "clz", true); addFunction(program, "clz", true);
addFunction(program, "ctz", true); addFunction(program, "ctz", true);
addFunction(program, "popcnt", true); addFunction(program, "popcnt", true);
addFunction(program, "rotl", true); addFunction(program, "rotl", true);
addFunction(program, "rotr", true); addFunction(program, "rotr", true);
addFunction(program, "abs", true); addFunction(program, "abs", true);
addFunction(program, "ceil", true);
addFunction(program, "copysign", true);
addFunction(program, "floor", true);
addFunction(program, "max", true); addFunction(program, "max", true);
addFunction(program, "min", true); addFunction(program, "min", true);
addFunction(program, "ceil", true);
addFunction(program, "floor", true);
addFunction(program, "copysign", true);
addFunction(program, "nearest", true); addFunction(program, "nearest", true);
addFunction(program, "reinterpret", true);
addFunction(program, "sqrt", true); addFunction(program, "sqrt", true);
addFunction(program, "trunc", true); addFunction(program, "trunc", true);
addFunction(program, "current_memory");
addFunction(program, "grow_memory"); // memory access
addFunction(program, "unreachable");
addFunction(program, "load", true); addFunction(program, "load", true);
addFunction(program, "store", true); addFunction(program, "store", true);
addFunction(program, "reinterpret", true);
addFunction(program, "select", true);
addFunction(program, "sizeof", true); addFunction(program, "sizeof", true);
addFunction(program, "changetype", true);
addFunction(program, "isNaN", true); // control flow
addFunction(program, "isFinite", true); addFunction(program, "select", true);
addFunction(program, "assert"); addFunction(program, "unreachable");
// host operations
addFunction(program, "current_memory");
addFunction(program, "grow_memory");
// imported
addFunction(program, "parseInt"); addFunction(program, "parseInt");
addFunction(program, "parseFloat"); addFunction(program, "parseFloat");
// other
addFunction(program, "changetype", true);
addFunction(program, "assert");
// conversions and limits
addFunction(program, "i8").members = new Map([ addFunction(program, "i8").members = new Map([
[ "MIN_VALUE", new Global(program, "i8.MIN_VALUE", null, Type.i8).withConstantIntegerValue(-128, -1) ], [ "MIN_VALUE", new Global(program, "i8.MIN_VALUE", null, Type.i8).withConstantIntegerValue(-128, -1) ],
[ "MAX_VALUE", new Global(program, "i8.MAX_VALUE", null, Type.i8).withConstantIntegerValue(127, 0) ] [ "MAX_VALUE", new Global(program, "i8.MAX_VALUE", null, Type.i8).withConstantIntegerValue(127, 0) ]
@ -116,6 +129,76 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
switch (prototype.internalName) { switch (prototype.internalName) {
// math
case "isNaN": // isNaN<T>(value: T) -> bool
compiler.currentType = Type.bool;
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if (typeArguments[0].isAnyInteger)
return module.createI32(0);
if (typeArguments[0].isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]); // reports
compiler.currentType = Type.bool;
if (typeArguments[0] == Type.f32) {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f32);
return module.createBinary(BinaryOp.NeF32,
module.createTeeLocal(tempLocal0.index, arg0),
module.createGetLocal(tempLocal0.index, NativeType.F32)
);
} else {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f64);
return module.createBinary(BinaryOp.NeF64,
module.createTeeLocal(tempLocal0.index, arg0),
module.createGetLocal(tempLocal0.index, NativeType.F64)
);
}
}
break;
case "isFinite": // isFinite<T>(value: T) -> bool
compiler.currentType = Type.bool;
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if (typeArguments[0].isAnyInteger)
return module.createI32(1);
if (typeArguments[0].isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]); // reports
compiler.currentType = Type.bool;
if (typeArguments[0] == Type.f32) {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f32);
return module.createSelect(
module.createBinary(BinaryOp.NeF32,
module.createUnary(UnaryOp.AbsF32,
module.createTeeLocal(tempLocal0.index, arg0)
),
module.createF32(Infinity)
),
module.createI32(0),
module.createBinary(BinaryOp.EqF32,
module.createGetLocal(tempLocal0.index, NativeType.F32),
module.createGetLocal(tempLocal0.index, NativeType.F32)
)
);
} else {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f64);
return module.createSelect(
module.createBinary(BinaryOp.NeF64,
module.createUnary(UnaryOp.AbsF64,
module.createTeeLocal(tempLocal0.index, arg0)
),
module.createF64(Infinity)
),
module.createI32(0),
module.createBinary(BinaryOp.EqF64,
module.createGetLocal(tempLocal0.index, NativeType.F64),
module.createGetLocal(tempLocal0.index, NativeType.F64)
)
);
}
}
break;
case "clz": // clz<T>(value: T) -> T case "clz": // clz<T>(value: T) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode)) if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable(); return module.createUnreachable();
@ -357,47 +440,6 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
} }
break; break;
case "sqrt": // sqrt<T>(value: T) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if ((compiler.currentType = typeArguments[0]).isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
return (compiler.currentType = typeArguments[0]) == Type.f32 // sic
? module.createUnary(UnaryOp.SqrtF32, arg0)
: module.createUnary(UnaryOp.SqrtF64, arg0);
}
break;
case "trunc": // trunc<T>(value: T) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if ((compiler.currentType = typeArguments[0]).isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
return (compiler.currentType = typeArguments[0]) == Type.f32 // sic
? module.createUnary(UnaryOp.TruncF32, arg0)
: module.createUnary(UnaryOp.TruncF64, arg0);
}
break;
case "load": // load<T>(offset: usize) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
arg0 = compiler.compileExpression(operands[0], usizeType); // reports
if ((compiler.currentType = typeArguments[0]) != Type.void)
return module.createLoad(typeArguments[0].byteSize, typeArguments[0].isSignedInteger, arg0, typeToNativeType(typeArguments[0]));
break;
case "store": // store<T>(offset: usize, value: T) -> void
compiler.currentType = Type.void;
if (!validateCall(compiler, typeArguments, 1, operands, 2, reportNode))
return module.createUnreachable();
arg0 = compiler.compileExpression(operands[0], usizeType); // reports
arg1 = compiler.compileExpression(operands[1], typeArguments[0]); // reports
compiler.currentType = Type.void;
if (typeArguments[0] != Type.void)
return module.createStore(typeArguments[0].byteSize, arg0, arg1, typeToNativeType(typeArguments[0]));
break;
case "reinterpret": // reinterpret<T1,T2>(value: T1) -> T2 case "reinterpret": // reinterpret<T1,T2>(value: T1) -> T2
if (!validateCall(compiler, typeArguments, 2, operands, 1, reportNode)) if (!validateCall(compiler, typeArguments, 2, operands, 1, reportNode))
return module.createUnreachable(); return module.createUnreachable();
@ -424,6 +466,59 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
} }
break; break;
case "sqrt": // sqrt<T>(value: T) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if ((compiler.currentType = typeArguments[0]).isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
return (compiler.currentType = typeArguments[0]) == Type.f32 // sic
? module.createUnary(UnaryOp.SqrtF32, arg0)
: module.createUnary(UnaryOp.SqrtF64, arg0);
}
break;
case "trunc": // trunc<T>(value: T) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if ((compiler.currentType = typeArguments[0]).isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
return (compiler.currentType = typeArguments[0]) == Type.f32 // sic
? module.createUnary(UnaryOp.TruncF32, arg0)
: module.createUnary(UnaryOp.TruncF64, arg0);
}
break;
// memory access
case "load": // load<T>(offset: usize) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
arg0 = compiler.compileExpression(operands[0], usizeType); // reports
if ((compiler.currentType = typeArguments[0]) != Type.void)
return module.createLoad(typeArguments[0].byteSize, typeArguments[0].isSignedInteger, arg0, typeToNativeType(typeArguments[0]));
break;
case "store": // store<T>(offset: usize, value: T) -> void
compiler.currentType = Type.void;
if (!validateCall(compiler, typeArguments, 1, operands, 2, reportNode))
return module.createUnreachable();
arg0 = compiler.compileExpression(operands[0], usizeType); // reports
arg1 = compiler.compileExpression(operands[1], typeArguments[0]); // reports
compiler.currentType = Type.void;
if (typeArguments[0] != Type.void)
return module.createStore(typeArguments[0].byteSize, arg0, arg1, typeToNativeType(typeArguments[0]));
break;
case "sizeof": // sizeof<T>() -> usize
compiler.currentType = usizeType;
if (!validateCall(compiler, typeArguments, 1, operands, 0, reportNode))
return module.createUnreachable();
return usizeType.isLongInteger
? module.createI64(typeArguments[0].byteSize, 0)
: module.createI32(typeArguments[0].byteSize);
// control flow
case "select": // select<T>(ifTrue: T, ifFalse: T, condition: bool) -> T case "select": // select<T>(ifTrue: T, ifFalse: T, condition: bool) -> T
if (!validateCall(compiler, typeArguments, 1, operands, 3, reportNode)) if (!validateCall(compiler, typeArguments, 1, operands, 3, reportNode))
return module.createUnreachable(); return module.createUnreachable();
@ -436,6 +531,13 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
} }
break; break;
case "unreachable": // unreachable() -> *
// does not modify currentType
validateCall(compiler, typeArguments, 0, operands, 0, reportNode);
return module.createUnreachable();
// host operations
case "current_memory": // current_memory() -> i32 case "current_memory": // current_memory() -> i32
compiler.currentType = Type.i32; compiler.currentType = Type.i32;
if (!validateCall(compiler, typeArguments, 0, operands, 0, reportNode)) if (!validateCall(compiler, typeArguments, 0, operands, 0, reportNode))
@ -449,121 +551,7 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
arg0 = compiler.compileExpression(operands[0], Type.i32); arg0 = compiler.compileExpression(operands[0], Type.i32);
return module.createHost(HostOp.GrowMemory, null, [ arg0 ]); return module.createHost(HostOp.GrowMemory, null, [ arg0 ]);
case "unreachable": // unreachable() -> * // imported
// does not modify currentType
validateCall(compiler, typeArguments, 0, operands, 0, reportNode);
return module.createUnreachable();
case "sizeof": // sizeof<T>() -> usize
compiler.currentType = usizeType;
if (!validateCall(compiler, typeArguments, 1, operands, 0, reportNode))
return module.createUnreachable();
return usizeType.isLongInteger
? module.createI64(typeArguments[0].byteSize, 0)
: module.createI32(typeArguments[0].byteSize);
case "changetype": // changetype<T1,T2>(value: T1) -> T2
if (!validateCall(compiler, typeArguments, 2, operands, 1, reportNode))
return module.createUnreachable();
if ((typeArguments[0] == usizeType && typeArguments[1].classType) || (typeArguments[0].classType && typeArguments[1] == usizeType)) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
compiler.currentType = typeArguments[1];
return arg0;
}
compiler.error(DiagnosticCode.Type_0_cannot_be_changed_to_type_1, reportNode.range, typeArguments[0].toString(), typeArguments[1].toString());
return module.createUnreachable();
case "isNaN": // isNaN<T>(value: T) -> bool
compiler.currentType = Type.bool;
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if (typeArguments[0].isAnyInteger)
return module.createI32(0);
if (typeArguments[0].isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]); // reports
compiler.currentType = Type.bool;
if (typeArguments[0] == Type.f32) {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f32);
return module.createBinary(BinaryOp.NeF32,
module.createTeeLocal(tempLocal0.index, arg0),
module.createGetLocal(tempLocal0.index, NativeType.F32)
);
} else {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f64);
return module.createBinary(BinaryOp.NeF64,
module.createTeeLocal(tempLocal0.index, arg0),
module.createGetLocal(tempLocal0.index, NativeType.F64)
);
}
}
break;
case "isFinite": // isFinite<T>(value: T) -> bool
compiler.currentType = Type.bool;
if (!validateCall(compiler, typeArguments, 1, operands, 1, reportNode))
return module.createUnreachable();
if (typeArguments[0].isAnyInteger)
return module.createI32(1);
if (typeArguments[0].isAnyFloat) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]); // reports
compiler.currentType = Type.bool;
if (typeArguments[0] == Type.f32) {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f32);
return module.createSelect(
module.createBinary(BinaryOp.NeF32,
module.createUnary(UnaryOp.AbsF32,
module.createTeeLocal(tempLocal0.index, arg0)
),
module.createF32(Infinity)
),
module.createI32(0),
module.createBinary(BinaryOp.EqF32,
module.createGetLocal(tempLocal0.index, NativeType.F32),
module.createGetLocal(tempLocal0.index, NativeType.F32)
)
);
} else {
tempLocal0 = compiler.currentFunction.getAndFreeTempLocal(Type.f64);
return module.createSelect(
module.createBinary(BinaryOp.NeF64,
module.createUnary(UnaryOp.AbsF64,
module.createTeeLocal(tempLocal0.index, arg0)
),
module.createF64(Infinity)
),
module.createI32(0),
module.createBinary(BinaryOp.EqF64,
module.createGetLocal(tempLocal0.index, NativeType.F64),
module.createGetLocal(tempLocal0.index, NativeType.F64)
)
);
}
}
break;
case "assert": // assert(isTrue: bool) -> void
compiler.currentType = Type.void;
if (typeArguments.length != 0) {
compiler.error(DiagnosticCode.Expected_0_type_arguments_but_got_1, reportNode.range, "0", typeArguments.length.toString(10));
return module.createUnreachable();
}
if (operands.length < 1) {
compiler.error(DiagnosticCode.Expected_at_least_0_arguments_but_got_1, reportNode.range, "1", operands.length.toString(10));
return module.createUnreachable();
}
if (operands.length > 2) {
compiler.error(DiagnosticCode.Expected_0_arguments_but_got_1, reportNode.range, "2", operands.length.toString(10));
return module.createUnreachable();
}
arg0 = compiler.compileExpression(operands[0], Type.i32); // reports
arg1 = operands.length > 1 ? compiler.compileExpression(operands[1], usizeType) : typeToNativeZero(module, usizeType); // TODO: string type
compiler.currentType = Type.void;
return compiler.options.noAssert
? module.createNop()
: module.createIf(
module.createUnary(UnaryOp.EqzI32, arg0),
module.createUnreachable() // TODO: report message to embedder
);
case "parseInt": // takes a pointer to the string case "parseInt": // takes a pointer to the string
compiler.currentType = Type.f64; compiler.currentType = Type.f64;
@ -601,6 +589,110 @@ export function compileCall(compiler: Compiler, prototype: FunctionPrototype, ty
} }
arg0 = compiler.compileExpression(operands[0], usizeType); // reports arg0 = compiler.compileExpression(operands[0], usizeType); // reports
return module.createCallImport("parseFloat", [ arg0 ], NativeType.F64); return module.createCallImport("parseFloat", [ arg0 ], NativeType.F64);
// other
case "changetype": // changetype<T1,T2>(value: T1) -> T2
if (!validateCall(compiler, typeArguments, 2, operands, 1, reportNode))
return module.createUnreachable();
if ((typeArguments[0] == usizeType && typeArguments[1].classType) || (typeArguments[0].classType && typeArguments[1] == usizeType)) {
arg0 = compiler.compileExpression(operands[0], typeArguments[0]);
compiler.currentType = typeArguments[1];
return arg0;
}
compiler.error(DiagnosticCode.Type_0_cannot_be_changed_to_type_1, reportNode.range, typeArguments[0].toString(), typeArguments[1].toString());
return module.createUnreachable();
case "assert": // assert(isTrue: bool) -> void
compiler.currentType = Type.void;
if (typeArguments.length != 0) {
compiler.error(DiagnosticCode.Expected_0_type_arguments_but_got_1, reportNode.range, "0", typeArguments.length.toString(10));
return module.createUnreachable();
}
if (operands.length < 1) {
compiler.error(DiagnosticCode.Expected_at_least_0_arguments_but_got_1, reportNode.range, "1", operands.length.toString(10));
return module.createUnreachable();
}
if (operands.length > 2) {
compiler.error(DiagnosticCode.Expected_0_arguments_but_got_1, reportNode.range, "2", operands.length.toString(10));
return module.createUnreachable();
}
arg0 = compiler.compileExpression(operands[0], Type.i32); // reports
arg1 = operands.length > 1 ? compiler.compileExpression(operands[1], usizeType) : typeToNativeZero(module, usizeType); // TODO: string type
compiler.currentType = Type.void;
return compiler.options.noAssert
? module.createNop()
: module.createIf(
module.createUnary(UnaryOp.EqzI32, arg0),
module.createUnreachable() // TODO: report message to embedder
);
// conversions
case "i8":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.i8, ConversionKind.EXPLICIT);
case "i16":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.i16, ConversionKind.EXPLICIT);
case "i32":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.i32, ConversionKind.EXPLICIT);
case "i64":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.i64, ConversionKind.EXPLICIT);
case "isize":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], select<Type>(Type.isize64, Type.isize32, compiler.options.target == Target.WASM64), ConversionKind.EXPLICIT);
case "u8":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.u8, ConversionKind.EXPLICIT);
case "u16":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.u16, ConversionKind.EXPLICIT);
case "u32":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.u32, ConversionKind.EXPLICIT);
case "u64":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.u64, ConversionKind.EXPLICIT);
case "usize":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], usizeType, ConversionKind.EXPLICIT);
case "bool":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.bool, ConversionKind.EXPLICIT);
case "f32":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.f32, ConversionKind.EXPLICIT);
case "f64":
if (!validateCall(compiler, typeArguments, 0, operands, 1, reportNode))
return module.createUnreachable();
return compiler.compileExpression(operands[0], Type.f64, ConversionKind.EXPLICIT);
} }
return 0; return 0;
} }

View File

@ -127,7 +127,7 @@ export class Options {
} }
/** Indicates the desired kind of a conversion. */ /** Indicates the desired kind of a conversion. */
const enum ConversionKind { export const enum ConversionKind {
/** No conversion. */ /** No conversion. */
NONE, NONE,
/** Implicit conversion. */ /** Implicit conversion. */

View File

@ -1028,12 +1028,14 @@ export class Global extends Element {
withConstantIntegerValue(lo: i32, hi: i32): this { withConstantIntegerValue(lo: i32, hi: i32): this {
this.constantIntegerValue = new I64(lo, hi); this.constantIntegerValue = new I64(lo, hi);
this.hasConstantValue = true; this.hasConstantValue = true;
this.isMutable = false;
return this; return this;
} }
withConstantFloatValue(value: f64): this { withConstantFloatValue(value: f64): this {
this.constantFloatValue = value; this.constantFloatValue = value;
this.hasConstantValue = true; this.hasConstantValue = true;
this.isMutable = false;
return this; return this;
} }
} }

View File

@ -15,34 +15,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -818,34 +818,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -1035,34 +1035,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -43,34 +43,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -8,34 +8,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -53,34 +53,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -38,34 +38,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -32,34 +32,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -149,34 +149,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -310,34 +310,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -1191,34 +1191,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -48,34 +48,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -43,34 +43,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -1,27 +1,27 @@
(module (module
(type $v (func)) (type $v (func))
(global $i8.MIN_VALUE (mut i32) (i32.const -128)) (global $i8.MIN_VALUE i32 (i32.const -128))
(global $i8.MAX_VALUE (mut i32) (i32.const 127)) (global $i8.MAX_VALUE i32 (i32.const 127))
(global $i16.MIN_VALUE (mut i32) (i32.const -32768)) (global $i16.MIN_VALUE i32 (i32.const -32768))
(global $i16.MAX_VALUE (mut i32) (i32.const 32767)) (global $i16.MAX_VALUE i32 (i32.const 32767))
(global $i32.MIN_VALUE (mut i32) (i32.const -2147483648)) (global $i32.MIN_VALUE i32 (i32.const -2147483648))
(global $i32.MAX_VALUE (mut i32) (i32.const 2147483647)) (global $i32.MAX_VALUE i32 (i32.const 2147483647))
(global $i64.MIN_VALUE (mut i64) (i64.const -9223372036854775808)) (global $i64.MIN_VALUE i64 (i64.const -9223372036854775808))
(global $i64.MAX_VALUE (mut i64) (i64.const 9223372036854775807)) (global $i64.MAX_VALUE i64 (i64.const 9223372036854775807))
(global $u8.MIN_VALUE (mut i32) (i32.const 0)) (global $u8.MIN_VALUE i32 (i32.const 0))
(global $u8.MAX_VALUE (mut i32) (i32.const 255)) (global $u8.MAX_VALUE i32 (i32.const 255))
(global $u16.MIN_VALUE (mut i32) (i32.const 0)) (global $u16.MIN_VALUE i32 (i32.const 0))
(global $u16.MAX_VALUE (mut i32) (i32.const 65535)) (global $u16.MAX_VALUE i32 (i32.const 65535))
(global $u32.MIN_VALUE (mut i32) (i32.const 0)) (global $u32.MIN_VALUE i32 (i32.const 0))
(global $u32.MAX_VALUE (mut i32) (i32.const -1)) (global $u32.MAX_VALUE i32 (i32.const -1))
(global $u64.MIN_VALUE (mut i64) (i64.const 0)) (global $u64.MIN_VALUE i64 (i64.const 0))
(global $u64.MAX_VALUE (mut i64) (i64.const -1)) (global $u64.MAX_VALUE i64 (i64.const -1))
(global $bool.MIN_VALUE (mut i32) (i32.const 0)) (global $bool.MIN_VALUE i32 (i32.const 0))
(global $bool.MAX_VALUE (mut i32) (i32.const 1)) (global $bool.MAX_VALUE i32 (i32.const 1))
(global $f32.MIN_SAFE_INTEGER (mut f32) (f32.const -16777215)) (global $f32.MIN_SAFE_INTEGER f32 (f32.const -16777215))
(global $f32.MAX_SAFE_INTEGER (mut f32) (f32.const 16777215)) (global $f32.MAX_SAFE_INTEGER f32 (f32.const 16777215))
(global $f64.MIN_SAFE_INTEGER (mut f64) (f64.const -9007199254740991)) (global $f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
(global $f64.MAX_SAFE_INTEGER (mut f64) (f64.const 9007199254740991)) (global $f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
(global $HEAP_START i32 (i32.const 4)) (global $HEAP_START i32 (i32.const 4))
(memory $0 1) (memory $0 1)
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -109,34 +109,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -141,34 +141,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -257,34 +257,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -2055,34 +2055,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -19,34 +19,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -0,0 +1,120 @@
(module
(type $v (func))
(global $portable-conversions/f (mut f32) (f32.const 0))
(global $portable-conversions/F (mut f64) (f64.const 0))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i64.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i64.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i64.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i64.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
)
)

View File

@ -0,0 +1,69 @@
let i: i32 = 0;
let I: i64 = 0;
let f: f32 = 0;
let F: f64 = 0;
i8(i);
i8(I);
i8(f);
i8(F);
i16(i);
i16(I);
i16(f);
i16(F);
i32(i);
i32(I);
i32(f);
i32(F);
i64(i);
i64(I);
i64(f);
i64(F);
isize(i);
isize(I);
isize(f);
isize(F);
u8(i);
u8(I);
u8(f);
u8(F);
u16(i);
u16(I);
u16(f);
u16(F);
u32(i);
u32(I);
u32(f);
u32(F);
u64(i);
u64(I);
u64(f);
u64(F);
usize(i);
usize(I);
usize(f);
usize(F);
bool(i);
bool(I);
bool(f);
bool(F);
f32(i);
f32(I);
f32(f);
f32(F);
f64(i);
f64(I);
f64(f);
f64(F);

View File

@ -0,0 +1,381 @@
(module
(type $v (func))
(global $portable-conversions/i (mut i32) (i32.const 0))
(global $portable-conversions/I (mut i64) (i64.const 0))
(global $portable-conversions/f (mut f32) (f32.const 0))
(global $portable-conversions/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(drop
(i32.shr_s
(i32.shl
(get_global $portable-conversions/i)
(i32.const 24)
)
(i32.const 24)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.wrap/i64
(get_global $portable-conversions/I)
)
(i32.const 24)
)
(i32.const 24)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
(i32.const 24)
)
(i32.const 24)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
(i32.const 24)
)
(i32.const 24)
)
)
(drop
(i32.shr_s
(i32.shl
(get_global $portable-conversions/i)
(i32.const 16)
)
(i32.const 16)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.wrap/i64
(get_global $portable-conversions/I)
)
(i32.const 16)
)
(i32.const 16)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
(i32.const 16)
)
(i32.const 16)
)
)
(drop
(i32.shr_s
(i32.shl
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
(i32.const 16)
)
(i32.const 16)
)
)
(drop
(get_global $portable-conversions/i)
)
(drop
(i32.wrap/i64
(get_global $portable-conversions/I)
)
)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i64.extend_s/i32
(get_global $portable-conversions/i)
)
)
(drop
(get_global $portable-conversions/I)
)
(drop
(i64.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i64.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(get_global $portable-conversions/i)
)
(drop
(i32.wrap/i64
(get_global $portable-conversions/I)
)
)
(drop
(i32.trunc_s/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_s/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.and
(get_global $portable-conversions/i)
(i32.const 255)
)
)
(drop
(i32.and
(i32.wrap/i64
(get_global $portable-conversions/I)
)
(i32.const 255)
)
)
(drop
(i32.and
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
(i32.const 255)
)
)
(drop
(i32.and
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
(i32.const 255)
)
)
(drop
(i32.and
(get_global $portable-conversions/i)
(i32.const 65535)
)
)
(drop
(i32.and
(i32.wrap/i64
(get_global $portable-conversions/I)
)
(i32.const 65535)
)
)
(drop
(i32.and
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
(i32.const 65535)
)
)
(drop
(i32.and
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
(i32.const 65535)
)
)
(drop
(get_global $portable-conversions/i)
)
(drop
(i32.wrap/i64
(get_global $portable-conversions/I)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i64.extend_u/i32
(get_global $portable-conversions/i)
)
)
(drop
(get_global $portable-conversions/I)
)
(drop
(i64.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i64.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(get_global $portable-conversions/i)
)
(drop
(i32.wrap/i64
(get_global $portable-conversions/I)
)
)
(drop
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
)
(drop
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
)
(drop
(i32.and
(get_global $portable-conversions/i)
(i32.const 1)
)
)
(drop
(i32.and
(i32.wrap/i64
(get_global $portable-conversions/I)
)
(i32.const 1)
)
)
(drop
(i32.and
(i32.trunc_u/f32
(get_global $portable-conversions/f)
)
(i32.const 1)
)
)
(drop
(i32.and
(i32.trunc_u/f64
(get_global $portable-conversions/F)
)
(i32.const 1)
)
)
(drop
(f32.convert_s/i32
(get_global $portable-conversions/i)
)
)
(drop
(f32.convert_s/i64
(get_global $portable-conversions/I)
)
)
(drop
(get_global $portable-conversions/f)
)
(drop
(f32.demote/f64
(get_global $portable-conversions/F)
)
)
(drop
(f64.convert_s/i32
(get_global $portable-conversions/i)
)
)
(drop
(f64.convert_s/i64
(get_global $portable-conversions/I)
)
)
(drop
(f64.promote/f32
(get_global $portable-conversions/f)
)
)
(drop
(get_global $portable-conversions/F)
)
)
)
(;
[program.elements]
isNaN
isFinite
clz
ctz
popcnt
rotl
rotr
abs
max
min
ceil
floor
copysign
nearest
reinterpret
sqrt
trunc
load
store
sizeof
select
unreachable
current_memory
grow_memory
parseInt
parseFloat
changetype
assert
i8
i16
i32
i64
u8
u16
u32
u64
bool
f32
f64
isize
usize
portable-conversions/i
portable-conversions/I
portable-conversions/f
portable-conversions/F
[program.exports]
;)

View File

@ -48,34 +48,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -147,34 +147,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -35,34 +35,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -330,34 +330,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -623,34 +623,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32

View File

@ -62,34 +62,34 @@
) )
(; (;
[program.elements] [program.elements]
isNaN
isFinite
clz clz
ctz ctz
popcnt popcnt
rotl rotl
rotr rotr
abs abs
ceil
copysign
floor
max max
min min
ceil
floor
copysign
nearest nearest
reinterpret
sqrt sqrt
trunc trunc
current_memory
grow_memory
unreachable
load load
store store
reinterpret
select
sizeof sizeof
changetype select
isNaN unreachable
isFinite current_memory
assert grow_memory
parseInt parseInt
parseFloat parseFloat
changetype
assert
i8 i8
i16 i16
i32 i32