@@ -18,14 +18,15 @@ export type RelooperRef = usize;
1818export type RelooperBlockRef = usize ;
1919export type Index = u32 ;
2020
21- export const enum NativeType {
22- None = 0 , // _BinaryenTypeNone(),
23- I32 = 1 , // _BinaryenTypeInt32(),
24- I64 = 2 , // _BinaryenTypeInt64(),
25- F32 = 3 , // _BinaryenTypeFloat32(),
26- F64 = 4 , // _BinaryenTypeFloat64(),
27- Unreachable = 5 , // _BinaryenTypeUnreachable(),
28- Auto = - 1 // _BinaryenTypeAuto()
21+ export enum NativeType {
22+ None = _BinaryenTypeNone ( ) ,
23+ I32 = _BinaryenTypeInt32 ( ) ,
24+ I64 = _BinaryenTypeInt64 ( ) ,
25+ F32 = _BinaryenTypeFloat32 ( ) ,
26+ F64 = _BinaryenTypeFloat64 ( ) ,
27+ V128 = _BinaryenTypeVec128 ( ) ,
28+ Unreachable = _BinaryenTypeUnreachable ( ) ,
29+ Auto = _BinaryenTypeAuto ( )
2930}
3031
3132export enum ExpressionId {
@@ -442,6 +443,15 @@ export class Module {
442443 return _BinaryenConst ( this . ref , out ) ;
443444 }
444445
446+ createV128 ( bytes : Uint8Array ) : ExpressionRef {
447+ assert ( bytes . length == 16 ) ;
448+ var out = this . lit ;
449+ // FIXME: does this work or do we need to malloc?
450+ for ( let i = 0 ; i < 16 ; ++ i ) store < u8 > ( out + i , bytes [ i ] ) ;
451+ _BinaryenLiteralVec128 ( out , out ) ;
452+ return _BinaryenConst ( this . ref , out ) ;
453+ }
454+
445455 // expressions
446456
447457 createUnary (
0 commit comments