summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c65
1 files changed, 40 insertions, 25 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 95bc398b5..ad61ca528 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -109,11 +109,11 @@ BinaryenExpressionRef makeSIMDShuffle(BinaryenModuleRef module) {
return BinaryenSIMDShuffle(module, left, right, (uint8_t[16]) {});
}
-BinaryenExpressionRef makeSIMDBitselect(BinaryenModuleRef module) {
- BinaryenExpressionRef left = makeVec128(module, v128_bytes);
- BinaryenExpressionRef right = makeVec128(module, v128_bytes);
- BinaryenExpressionRef cond = makeVec128(module, v128_bytes);
- return BinaryenSIMDBitselect(module, left, right, cond);
+BinaryenExpressionRef makeSIMDTernary(BinaryenModuleRef module, BinaryenOp op) {
+ BinaryenExpressionRef a = makeVec128(module, v128_bytes);
+ BinaryenExpressionRef b = makeVec128(module, v128_bytes);
+ BinaryenExpressionRef c = makeVec128(module, v128_bytes);
+ return BinaryenSIMDTernary(module, op, a, b, c);
}
BinaryenExpressionRef makeSIMDShift(BinaryenModuleRef module, BinaryenOp op) {
@@ -472,7 +472,11 @@ void test_core() {
makeSIMDShift(module, BinaryenShrUVecI64x2()),
// Other SIMD
makeSIMDShuffle(module),
- makeSIMDBitselect(module),
+ makeSIMDTernary(module, BinaryenBitselectVec128()),
+ makeSIMDTernary(module, BinaryenQFMAVecF32x4()),
+ makeSIMDTernary(module, BinaryenQFMSVecF32x4()),
+ makeSIMDTernary(module, BinaryenQFMAVecF64x2()),
+ makeSIMDTernary(module, BinaryenQFMSVecF64x2()),
// Bulk memory
makeMemoryInit(module),
makeDataDrop(module),
@@ -489,19 +493,27 @@ void test_core() {
BinaryenBreak(module, "the-value", NULL, makeInt32(module, 3)),
BinaryenBreak(module, "the-nothing", NULL, NULL),
BinaryenSwitch(module, switchValueNames, 1, "the-value", temp8, temp9),
- BinaryenSwitch(module, switchBodyNames, 1, "the-nothing", makeInt32(module, 2), NULL),
- BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node
- BinaryenCall(module, "kitchen()sinker", callOperands4, 4, BinaryenTypeInt32())
- ),
- BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node
- BinaryenUnary(module,
- BinaryenTruncSFloat32ToInt32(),
- BinaryenCall(module, "an-imported", callOperands2, 2, BinaryenTypeFloat32())
- )
- ),
- BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node
- BinaryenCallIndirect(module, makeInt32(module, 2449), callOperands4b, 4, "iiIfF")
- ),
+ BinaryenSwitch(
+ module, switchBodyNames, 1, "the-nothing", makeInt32(module, 2), NULL),
+ BinaryenUnary(
+ module,
+ BinaryenEqZInt32(), // check the output type of the call node
+ BinaryenCall(
+ module, "kitchen()sinker", callOperands4, 4, BinaryenTypeInt32())),
+ BinaryenUnary(module,
+ BinaryenEqZInt32(), // check the output type of the call node
+ BinaryenUnary(module,
+ BinaryenTruncSFloat32ToInt32(),
+ BinaryenCall(module,
+ "an-imported",
+ callOperands2,
+ 2,
+ BinaryenTypeFloat32()))),
+ BinaryenUnary(
+ module,
+ BinaryenEqZInt32(), // check the output type of the call node
+ BinaryenCallIndirect(
+ module, makeInt32(module, 2449), callOperands4b, 4, "iiIfF")),
BinaryenDrop(module, BinaryenLocalGet(module, 0, BinaryenTypeInt32())),
BinaryenLocalSet(module, 0, makeInt32(module, 101)),
BinaryenDrop(module, BinaryenLocalTee(module, 0, makeInt32(module, 102))),
@@ -523,13 +535,16 @@ void test_core() {
// Exception handling
BinaryenTry(module, tryBody, catchBody),
// Atomics
- BinaryenAtomicStore(module, 4, 0, temp6,
+ BinaryenAtomicStore(
+ module,
+ 4,
+ 0,
+ temp6,
BinaryenAtomicLoad(module, 4, 0, BinaryenTypeInt32(), temp6),
- BinaryenTypeInt32()
- ),
- BinaryenDrop(module,
- BinaryenAtomicWait(module, temp6, temp6, temp16, BinaryenTypeInt32())
- ),
+ BinaryenTypeInt32()),
+ BinaryenDrop(
+ module,
+ BinaryenAtomicWait(module, temp6, temp6, temp16, BinaryenTypeInt32())),
BinaryenDrop(module, BinaryenAtomicNotify(module, temp6, temp6)),
BinaryenAtomicFence(module),