Skip to content

Commit 4284491

Browse files
committed
Translate Wasm swizzle to Cranelift swizzle
1 parent fa7481a commit 4284491

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cranelift/wasm/src/code_translator.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,10 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
12641264
// to WASM using the less specific v128 type for certain operations and more specific
12651265
// types (e.g. i8x16) for others.
12661266
}
1267+
Operator::V8x16Swizzle => {
1268+
let (a, b) = pop2_with_bitcast(state, I8X16, builder);
1269+
state.push1(builder.ins().swizzle(I8X16, a, b))
1270+
}
12671271
Operator::I8x16Add | Operator::I16x8Add | Operator::I32x4Add | Operator::I64x2Add => {
12681272
let (a, b) = pop2_with_bitcast(state, type_of(op), builder);
12691273
state.push1(builder.ins().iadd(a, b))
@@ -1489,7 +1493,6 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
14891493
| Operator::I32x4WidenHighI16x8S { .. }
14901494
| Operator::I32x4WidenLowI16x8U { .. }
14911495
| Operator::I32x4WidenHighI16x8U { .. }
1492-
| Operator::V8x16Swizzle
14931496
| Operator::I16x8Load8x8S { .. }
14941497
| Operator::I16x8Load8x8U { .. }
14951498
| Operator::I32x4Load16x4S { .. }

0 commit comments

Comments
 (0)