summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/binaryen-c.cpp18
-rw-r--r--src/binaryen-c.h6
-rw-r--r--src/js/binaryen.js-post.js24
-rw-r--r--test/binaryen.js/kitchen-sink.js6
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt60
-rw-r--r--test/example/c-api-kitchen-sink.c6
-rw-r--r--test/example/c-api-kitchen-sink.txt30
7 files changed, 150 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 86eb5324d..267bd9cc3 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -722,6 +722,24 @@ BinaryenOp BinaryenExtendLowUVecI32x4ToVecI64x2(void) {
BinaryenOp BinaryenExtendHighUVecI32x4ToVecI64x2(void) {
return ExtendHighUVecI32x4ToVecI64x2;
}
+BinaryenOp BinaryenConvertLowSVecI32x4ToVecF64x2(void) {
+ return ConvertLowSVecI32x4ToVecF64x2;
+}
+BinaryenOp BinaryenConvertLowUVecI32x4ToVecF64x2(void) {
+ return ConvertLowUVecI32x4ToVecF64x2;
+}
+BinaryenOp BinaryenTruncSatZeroSVecF64x2ToVecI32x4(void) {
+ return TruncSatZeroSVecF64x2ToVecI32x4;
+}
+BinaryenOp BinaryenTruncSatZeroUVecF64x2ToVecI32x4(void) {
+ return TruncSatZeroUVecF64x2ToVecI32x4;
+}
+BinaryenOp BinaryenDemoteZeroVecF64x2ToVecF32x4(void) {
+ return DemoteZeroVecF64x2ToVecF32x4;
+}
+BinaryenOp BinaryenPromoteLowVecF32x4ToVecF64x2(void) {
+ return PromoteLowVecF32x4ToVecF64x2;
+}
BinaryenOp BinaryenSwizzleVec8x16(void) { return SwizzleVec8x16; }
BinaryenOp BinaryenRefIsNull(void) { return RefIsNull; }
BinaryenOp BinaryenRefIsFunc(void) { return RefIsFunc; }
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index 038ed43c2..ccabe8bb5 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -564,6 +564,12 @@ BINARYEN_API BinaryenOp BinaryenExtendLowSVecI32x4ToVecI64x2(void);
BINARYEN_API BinaryenOp BinaryenExtendHighSVecI32x4ToVecI64x2(void);
BINARYEN_API BinaryenOp BinaryenExtendLowUVecI32x4ToVecI64x2(void);
BINARYEN_API BinaryenOp BinaryenExtendHighUVecI32x4ToVecI64x2(void);
+BINARYEN_API BinaryenOp BinaryenConvertLowSVecI32x4ToVecF64x2(void);
+BINARYEN_API BinaryenOp BinaryenConvertLowUVecI32x4ToVecF64x2(void);
+BINARYEN_API BinaryenOp BinaryenTruncSatZeroSVecF64x2ToVecI32x4(void);
+BINARYEN_API BinaryenOp BinaryenTruncSatZeroUVecF64x2ToVecI32x4(void);
+BINARYEN_API BinaryenOp BinaryenDemoteZeroVecF64x2ToVecF32x4(void);
+BINARYEN_API BinaryenOp BinaryenPromoteLowVecF32x4ToVecF64x2(void);
BINARYEN_API BinaryenOp BinaryenSwizzleVec8x16(void);
BINARYEN_API BinaryenOp BinaryenRefIsNull(void);
BINARYEN_API BinaryenOp BinaryenRefIsFunc(void);
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index 15e342eb8..7d13395a1 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -493,6 +493,12 @@ function initializeConstants() {
'ExtendHighSVecI32x4ToVecI64x2',
'ExtendLowUVecI32x4ToVecI64x2',
'ExtendHighUVecI32x4ToVecI64x2',
+ 'ConvertLowSVecI32x4ToVecF64x2',
+ 'ConvertLowUVecI32x4ToVecF64x2',
+ 'TruncSatZeroSVecF64x2ToVecI32x4',
+ 'TruncSatZeroUVecF64x2ToVecI32x4',
+ 'DemoteZeroVecF64x2ToVecF32x4',
+ 'PromoteLowVecF32x4ToVecF64x2',
'SwizzleVec8x16',
'RefIsNull',
'RefIsFunc',
@@ -1856,6 +1862,12 @@ function wrapModule(module, self = {}) {
'extend_high_i16x8_u'(value) {
return Module['_BinaryenUnary'](module, Module['ExtendHighUVecI16x8ToVecI32x4'], value);
},
+ 'trunc_sat_f64x2_s_zero'(value) {
+ return Module['_BinaryenUnary'](module, Module['TruncSatZeroSVecF64x2ToVecI32x4'], value);
+ },
+ 'trunc_sat_f64x2_u_zero'(value) {
+ return Module['_BinaryenUnary'](module, Module['TruncSatZeroUVecF64x2ToVecI32x4'], value);
+ },
};
self['i64x2'] = {
@@ -2009,6 +2021,9 @@ function wrapModule(module, self = {}) {
'convert_i32x4_u'(value) {
return Module['_BinaryenUnary'](module, Module['ConvertUVecI32x4ToVecF32x4'], value);
},
+ 'demote_f64x2_zero'(value) {
+ return Module['_BinaryenUnary'](module, Module['DemoteZeroVecF64x2ToVecF32x4'], value);
+ },
};
self['f64x2'] = {
@@ -2084,6 +2099,15 @@ function wrapModule(module, self = {}) {
'nearest'(value) {
return Module['_BinaryenUnary'](module, Module['NearestVecF64x2'], value);
},
+ 'convert_low_i32x4_s'(value) {
+ return Module['_BinaryenUnary'](module, Module['ConvertLowSVecI32x4ToVecF64x2'], value);
+ },
+ 'convert_low_i32x4_u'(value) {
+ return Module['_BinaryenUnary'](module, Module['ConvertLowUVecI32x4ToVecF64x2'], value);
+ },
+ 'promote_low_f32x4'(value) {
+ return Module['_BinaryenUnary'](module, Module['PromoteLowVecF32x4ToVecF64x2'], value);
+ },
};
self['funcref'] = {
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 851843466..7a191a90d 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -293,10 +293,14 @@ function test_core() {
module.f64x2.abs(module.v128.const(v128_bytes)),
module.f64x2.neg(module.v128.const(v128_bytes)),
module.f64x2.sqrt(module.v128.const(v128_bytes)),
+ module.f64x2.convert_low_i32x4_s(module.v128.const(v128_bytes)),
+ module.f64x2.convert_low_i32x4_u(module.v128.const(v128_bytes)),
+ module.f64x2.promote_low_f32x4(module.v128.const(v128_bytes)),
module.i32x4.trunc_sat_f32x4_s(module.v128.const(v128_bytes)),
module.i32x4.trunc_sat_f32x4_u(module.v128.const(v128_bytes)),
module.f32x4.convert_i32x4_s(module.v128.const(v128_bytes)),
module.f32x4.convert_i32x4_u(module.v128.const(v128_bytes)),
+ module.f32x4.demote_f64x2_zero(module.v128.const(v128_bytes)),
module.i16x8.extend_low_i8x16_s(module.v128.const(v128_bytes)),
module.i16x8.extend_high_i8x16_s(module.v128.const(v128_bytes)),
module.i16x8.extend_low_i8x16_u(module.v128.const(v128_bytes)),
@@ -305,6 +309,8 @@ function test_core() {
module.i32x4.extend_high_i16x8_s(module.v128.const(v128_bytes)),
module.i32x4.extend_low_i16x8_u(module.v128.const(v128_bytes)),
module.i32x4.extend_high_i16x8_u(module.v128.const(v128_bytes)),
+ module.i32x4.trunc_sat_f64x2_s_zero(module.v128.const(v128_bytes)),
+ module.i32x4.trunc_sat_f64x2_u_zero(module.v128.const(v128_bytes)),
module.i64x2.extend_low_i32x4_s(module.v128.const(v128_bytes)),
module.i64x2.extend_high_i32x4_s(module.v128.const(v128_bytes)),
module.i64x2.extend_low_i32x4_u(module.v128.const(v128_bytes)),
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index a58203818..f9c4bc5a9 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -542,6 +542,21 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (f64x2.convert_low_i32x4_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.convert_low_i32x4_u
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.promote_low_f32x4
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i32x4.trunc_sat_f32x4_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -562,6 +577,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (f32x4.demote_f64x2_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i16x8.extend_low_i8x16_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -602,6 +622,16 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (i32x4.trunc_sat_f64x2_s_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i32x4.trunc_sat_f64x2_u_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i64x2.extend_low_i32x4_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -2436,6 +2466,21 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (f64x2.convert_low_i32x4_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.convert_low_i32x4_u
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.promote_low_f32x4
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i32x4.trunc_sat_f32x4_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -2456,6 +2501,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (f32x4.demote_f64x2_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i16x8.extend_low_i8x16_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -2496,6 +2546,16 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (i32x4.trunc_sat_f64x2_s_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i32x4.trunc_sat_f64x2_u_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i64x2.extend_low_i32x4_s
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 7e6755f89..3f97fee9d 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -443,6 +443,12 @@ void test_core() {
makeUnary(module, BinaryenExtendHighSVecI32x4ToVecI64x2(), v128),
makeUnary(module, BinaryenExtendLowUVecI32x4ToVecI64x2(), v128),
makeUnary(module, BinaryenExtendHighUVecI32x4ToVecI64x2(), v128),
+ makeUnary(module, BinaryenConvertLowSVecI32x4ToVecF64x2(), v128),
+ makeUnary(module, BinaryenConvertLowUVecI32x4ToVecF64x2(), v128),
+ makeUnary(module, BinaryenTruncSatZeroSVecF64x2ToVecI32x4(), v128),
+ makeUnary(module, BinaryenTruncSatZeroUVecF64x2ToVecI32x4(), v128),
+ makeUnary(module, BinaryenDemoteZeroVecF64x2ToVecF32x4(), v128),
+ makeUnary(module, BinaryenPromoteLowVecF32x4ToVecF64x2(), v128),
// Binary
makeBinary(module, BinaryenAddInt32(), i32),
makeBinary(module, BinaryenSubFloat64(), f64),
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 54845f4cb..6f8eb575a 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -512,6 +512,36 @@ BinaryenFeatureAll: 8191
)
)
(drop
+ (f64x2.convert_low_i32x4_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.convert_low_i32x4_u
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i32x4.trunc_sat_f64x2_s_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i32x4.trunc_sat_f64x2_u_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f32x4.demote_f64x2_zero
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (f64x2.promote_low_f32x4
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i32.add
(i32.const -10)
(i32.const -11)