diff options
-rwxr-xr-x | build-js.sh | 5 | ||||
-rw-r--r-- | src/binaryen-c.cpp | 7 | ||||
-rw-r--r-- | src/binaryen-c.h | 5 | ||||
-rw-r--r-- | src/js/binaryen.js-post.js | 20 |
4 files changed, 36 insertions, 1 deletions
diff --git a/build-js.sh b/build-js.sh index 1cd4c87ec..480fba290 100755 --- a/build-js.sh +++ b/build-js.sh @@ -258,6 +258,11 @@ export_function "_BinaryenPromoteFloat32" export_function "_BinaryenDemoteFloat64" export_function "_BinaryenReinterpretInt32" export_function "_BinaryenReinterpretInt64" +export_function "_BinaryenExtendS8Int32" +export_function "_BinaryenExtendS16Int32" +export_function "_BinaryenExtendS8Int64" +export_function "_BinaryenExtendS16Int64" +export_function "_BinaryenExtendS32Int64" export_function "_BinaryenAddInt32" export_function "_BinaryenSubInt32" export_function "_BinaryenMulInt32" diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 8d7f9b0bc..53daef977 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -271,6 +271,11 @@ BinaryenOp BinaryenTruncUFloat64ToInt32(void) { return TruncUFloat64ToInt32; } BinaryenOp BinaryenTruncUFloat64ToInt64(void) { return TruncUFloat64ToInt64; } BinaryenOp BinaryenReinterpretFloat32(void) { return ReinterpretFloat32; } BinaryenOp BinaryenReinterpretFloat64(void) { return ReinterpretFloat64; } +BinaryenOp BinaryenExtendS8Int32(void) { return ExtendS8Int32; } +BinaryenOp BinaryenExtendS16Int32(void) { return ExtendS16Int32; } +BinaryenOp BinaryenExtendS8Int64(void) { return ExtendS8Int64; } +BinaryenOp BinaryenExtendS16Int64(void) { return ExtendS16Int64; } +BinaryenOp BinaryenExtendS32Int64(void) { return ExtendS32Int64; } BinaryenOp BinaryenConvertSInt32ToFloat32(void) { return ConvertSInt32ToFloat32; } BinaryenOp BinaryenConvertSInt32ToFloat64(void) { return ConvertSInt32ToFloat64; } BinaryenOp BinaryenConvertUInt32ToFloat32(void) { return ConvertUInt32ToFloat32; } @@ -835,7 +840,7 @@ BinaryenExpressionId BinaryenExpressionGetId(BinaryenExpressionRef expr) { if (tracing) { std::cout << " BinaryenExpressionGetId(expressions[" << expressions[expr] << "]);\n"; } - + return ((Expression*)expr)->_id; } BinaryenType BinaryenExpressionGetType(BinaryenExpressionRef expr) { diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 87c44db60..1c9bd9da4 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -233,6 +233,11 @@ BinaryenOp BinaryenPromoteFloat32(void); BinaryenOp BinaryenDemoteFloat64(void); BinaryenOp BinaryenReinterpretInt32(void); BinaryenOp BinaryenReinterpretInt64(void); +BinaryenOp BinaryenExtendS8Int32(void); +BinaryenOp BinaryenExtendS16Int32(void); +BinaryenOp BinaryenExtendS8Int64(void); +BinaryenOp BinaryenExtendS16Int64(void); +BinaryenOp BinaryenExtendS32Int64(void); BinaryenOp BinaryenAddInt32(void); BinaryenOp BinaryenSubInt32(void); BinaryenOp BinaryenMulInt32(void); diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index e9b4039f7..fbabfe995 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -115,6 +115,11 @@ Module['PromoteFloat32'] = Module['_BinaryenPromoteFloat32'](); Module['DemoteFloat64'] = Module['_BinaryenDemoteFloat64'](); Module['ReinterpretInt32'] = Module['_BinaryenReinterpretInt32'](); Module['ReinterpretInt64'] = Module['_BinaryenReinterpretInt64'](); +Module['ExtendS8Int32'] = Module['_BinaryenExtendS8Int32'](); +Module['ExtendS16Int32'] = Module['_BinaryenExtendS16Int32'](); +Module['ExtendS8Int64'] = Module['_BinaryenExtendS8Int64'](); +Module['ExtendS16Int64'] = Module['_BinaryenExtendS16Int64'](); +Module['ExtendS32Int64'] = Module['_BinaryenExtendS32Int64'](); Module['AddInt32'] = Module['_BinaryenAddInt32'](); Module['SubInt32'] = Module['_BinaryenSubInt32'](); Module['MulInt32'] = Module['_BinaryenMulInt32'](); @@ -349,6 +354,12 @@ Module['Module'] = function(module) { 'reinterpret': function(value) { return Module['_BinaryenUnary'](module, Module['ReinterpretFloat32'], value); }, + 'extend8_s': function(value) { + return Module['_BinaryenUnary'](module, Module['ExtendS8Int32'], value); + }, + 'extend16_s': function(value) { + return Module['_BinaryenUnary'](module, Module['ExtendS16Int32'], value); + }, 'wrap': function(value) { return Module['_BinaryenUnary'](module, Module['WrapInt64'], value); }, @@ -590,6 +601,15 @@ Module['Module'] = function(module) { 'reinterpret': function(value) { return Module['_BinaryenUnary'](module, Module['ReinterpretFloat64'], value); }, + 'extend8_s': function(value) { + return Module['_BinaryenUnary'](module, Module['ExtendS8Int64'], value); + }, + 'extend16_s': function(value) { + return Module['_BinaryenUnary'](module, Module['ExtendS16Int64'], value); + }, + 'extend32_s': function(value) { + return Module['_BinaryenUnary'](module, Module['ExtendS32Int64'], value); + }, 'extend_s': function(value) { return Module['_BinaryenUnary'](module, Module['ExtendSInt32'], value); }, |