diff options
-rw-r--r-- | src/binaryen-c.cpp | 12 | ||||
-rw-r--r-- | src/binaryen-c.h | 4 | ||||
-rw-r--r-- | src/js/binaryen.js-post.js | 16 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 4 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 40 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 4 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 20 |
7 files changed, 100 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 00a907ab4..dfcd425e3 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -698,6 +698,18 @@ BinaryenOp BinaryenExtendLowUVecI16x8ToVecI32x4(void) { BinaryenOp BinaryenExtendHighUVecI16x8ToVecI32x4(void) { return ExtendHighUVecI16x8ToVecI32x4; } +BinaryenOp BinaryenExtendLowSVecI32x4ToVecI64x2(void) { + return ExtendLowSVecI32x4ToVecI64x2; +} +BinaryenOp BinaryenExtendHighSVecI32x4ToVecI64x2(void) { + return ExtendHighSVecI32x4ToVecI64x2; +} +BinaryenOp BinaryenExtendLowUVecI32x4ToVecI64x2(void) { + return ExtendLowUVecI32x4ToVecI64x2; +} +BinaryenOp BinaryenExtendHighUVecI32x4ToVecI64x2(void) { + return ExtendHighUVecI32x4ToVecI64x2; +} 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 33d2438e1..84661b750 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -557,6 +557,10 @@ BINARYEN_API BinaryenOp BinaryenExtendLowSVecI16x8ToVecI32x4(void); BINARYEN_API BinaryenOp BinaryenExtendHighSVecI16x8ToVecI32x4(void); BINARYEN_API BinaryenOp BinaryenExtendLowUVecI16x8ToVecI32x4(void); BINARYEN_API BinaryenOp BinaryenExtendHighUVecI16x8ToVecI32x4(void); +BINARYEN_API BinaryenOp BinaryenExtendLowSVecI32x4ToVecI64x2(void); +BINARYEN_API BinaryenOp BinaryenExtendHighSVecI32x4ToVecI64x2(void); +BINARYEN_API BinaryenOp BinaryenExtendLowUVecI32x4ToVecI64x2(void); +BINARYEN_API BinaryenOp BinaryenExtendHighUVecI32x4ToVecI64x2(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 f5ab04642..80affeefc 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -485,6 +485,10 @@ function initializeConstants() { 'ExtendHighSVecI16x8ToVecI32x4', 'ExtendLowUVecI16x8ToVecI32x4', 'ExtendHighUVecI16x8ToVecI32x4', + 'ExtendLowSVecI32x4ToVecI64x2', + 'ExtendHighSVecI32x4ToVecI64x2', + 'ExtendLowUVecI32x4ToVecI64x2', + 'ExtendHighUVecI32x4ToVecI64x2', 'SwizzleVec8x16', 'RefIsNull', 'RefIsFunc', @@ -1896,6 +1900,18 @@ function wrapModule(module, self = {}) { 'mul'(left, right) { return Module['_BinaryenBinary'](module, Module['MulVecI64x2'], left, right); }, + 'extend_low_i32x4_s'(value) { + return Module['_BinaryenUnary'](module, Module['ExtendLowSVecI32x4ToVecI64x2'], value); + }, + 'extend_high_i32x4_s'(value) { + return Module['_BinaryenUnary'](module, Module['ExtendHighSVecI32x4ToVecI64x2'], value); + }, + 'extend_low_i32x4_u'(value) { + return Module['_BinaryenUnary'](module, Module['ExtendLowUVecI32x4ToVecI64x2'], value); + }, + 'extend_high_i32x4_u'(value) { + return Module['_BinaryenUnary'](module, Module['ExtendHighUVecI32x4ToVecI64x2'], value); + }, }; self['f32x4'] = { diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 5e70b0072..c0301c0d6 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -301,6 +301,10 @@ 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.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)), + module.i64x2.extend_high_i32x4_u(module.v128.const(v128_bytes)), // Binary module.i32.add(module.i32.const(-10), module.i32.const(-11)), module.f64.sub(module.f64.const(-9005.841), module.f64.const(-9007.333)), diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 8d7ccdbca..64ff48426 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -582,6 +582,26 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop + (i64x2.extend_low_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_low_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop (i32.add (i32.const -10) (i32.const -11) @@ -2436,6 +2456,26 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop + (i64x2.extend_low_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_low_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop (i32.add (i32.const -10) (i32.const -11) diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index abc5e1489..887f33b58 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -439,6 +439,10 @@ void test_core() { makeUnary(module, BinaryenExtendHighSVecI16x8ToVecI32x4(), v128), makeUnary(module, BinaryenExtendLowUVecI16x8ToVecI32x4(), v128), makeUnary(module, BinaryenExtendHighUVecI16x8ToVecI32x4(), v128), + makeUnary(module, BinaryenExtendLowSVecI32x4ToVecI64x2(), v128), + makeUnary(module, BinaryenExtendHighSVecI32x4ToVecI64x2(), v128), + makeUnary(module, BinaryenExtendLowUVecI32x4ToVecI64x2(), v128), + makeUnary(module, BinaryenExtendHighUVecI32x4ToVecI64x2(), 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 8bf0c770a..244777478 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -492,6 +492,26 @@ BinaryenFeatureAll: 8191 ) ) (drop + (i64x2.extend_low_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_s + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_low_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop + (i64x2.extend_high_i32x4_u + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop (i32.add (i32.const -10) (i32.const -11) |