clif: Remove the type variable from swizzle (#5897)

This instruction is only defined with i8x16 inputs and outputs so
there's no need for a type variable, so shadow the otherwise-generic `a`
result with a concrete i8x16 type.
This commit is contained in:
Alex Crichton
2023-02-28 18:38:53 -06:00
committed by GitHub
parent e0ef0b7c72
commit c4a2c1e818
9 changed files with 10 additions and 8 deletions

View File

@@ -367,6 +367,7 @@ fn define_simd_lane_access(
); );
let x = &Operand::new("x", I8x16).with_doc("Vector to modify by re-arranging lanes"); let x = &Operand::new("x", I8x16).with_doc("Vector to modify by re-arranging lanes");
let y = &Operand::new("y", I8x16).with_doc("Mask for re-arranging lanes"); let y = &Operand::new("y", I8x16).with_doc("Mask for re-arranging lanes");
let a = &Operand::new("a", I8x16);
ig.push( ig.push(
Inst::new( Inst::new(
@@ -388,6 +389,7 @@ fn define_simd_lane_access(
let x = &Operand::new("x", TxN).with_doc("The vector to modify"); let x = &Operand::new("x", TxN).with_doc("The vector to modify");
let y = &Operand::new("y", &TxN.lane_of()).with_doc("New lane value"); let y = &Operand::new("y", &TxN.lane_of()).with_doc("New lane value");
let Idx = &Operand::new("Idx", &imm.uimm8).with_doc("Lane index"); let Idx = &Operand::new("Idx", &imm.uimm8).with_doc("Lane index");
let a = &Operand::new("a", TxN);
ig.push( ig.push(
Inst::new( Inst::new(

View File

@@ -69,7 +69,7 @@ function %swizzle() -> i8x16 {
block0: block0:
v0 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] v0 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }

View File

@@ -3,7 +3,7 @@ target s390x
function %swizzle(i8x16, i8x16) -> i8x16 wasmtime_system_v { function %swizzle(i8x16, i8x16) -> i8x16 wasmtime_system_v {
block0(v0: i8x16, v1: i8x16): block0(v0: i8x16, v1: i8x16):
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }

View File

@@ -3,7 +3,7 @@ target s390x
function %swizzle(i8x16, i8x16) -> i8x16 { function %swizzle(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16): block0(v0: i8x16, v1: i8x16):
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }

View File

@@ -114,7 +114,7 @@ function %swizzle() -> i8x16 {
block0: block0:
v0 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] v0 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }

View File

@@ -52,7 +52,7 @@ block0:
function %swizzle(i8x16, i8x16) -> i8x16 { function %swizzle(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16): block0(v0: i8x16, v1: i8x16):
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }
; reverse the lanes, with over-large index 42 using lane 0 ; reverse the lanes, with over-large index 42 using lane 0

View File

@@ -7,7 +7,7 @@ target x86_64 has_sse3 has_ssse3 has_sse41
function %swizzle_i8x16(i8x16, i8x16) -> i8x16 { function %swizzle_i8x16(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16): block0(v0: i8x16, v1: i8x16):
v2 = swizzle.i8x16 v0, v1 v2 = swizzle v0, v1
return v2 return v2
} }
; run: %swizzle_i8x16([1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16], [0 9 15 1 6 13 7 11 10 8 100 12 4 2 3 5]) == [1 10 16 2 7 14 8 12 11 9 0 13 5 3 4 6] ; run: %swizzle_i8x16([1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16], [0 9 15 1 6 13 7 11 10 8 100 12 4 2 3 5]) == [1 10 16 2 7 14 8 12 11 9 0 13 5 3 4 6]

View File

@@ -1027,7 +1027,7 @@ where
new[i] = x[s[i] as usize]; new[i] = x[s[i] as usize];
} // else leave as 0 } // else leave as 0
} }
assign(Value::vector(new, ctrl_ty)?) assign(Value::vector(new, types::I8X16)?)
} }
Opcode::Splat => { Opcode::Splat => {
let mut new_vector = SimdVec::new(); let mut new_vector = SimdVec::new();

View File

@@ -1678,7 +1678,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
} }
Operator::I8x16Swizzle => { Operator::I8x16Swizzle => {
let (a, b) = pop2_with_bitcast(state, I8X16, builder); let (a, b) = pop2_with_bitcast(state, I8X16, builder);
state.push1(builder.ins().swizzle(I8X16, a, b)) state.push1(builder.ins().swizzle(a, b))
} }
Operator::I8x16Add | Operator::I16x8Add | Operator::I32x4Add | Operator::I64x2Add => { Operator::I8x16Add | Operator::I16x8Add | Operator::I32x4Add | Operator::I64x2Add => {
let (a, b) = pop2_with_bitcast(state, type_of(op), builder); let (a, b) = pop2_with_bitcast(state, type_of(op), builder);