Refactor and turn on lowering for extend-add-pairwise

This commit is contained in:
Johnnie Birch
2021-07-29 20:19:38 -07:00
parent e373ddfe1b
commit e519fca61c
8 changed files with 107 additions and 80 deletions

View File

@@ -4114,8 +4114,9 @@ pub(crate) fn define(
Inst::new(
"uwiden_high",
r#"
Lane-wise integer extended pairwise addition producing extended results
(twice wider results than the input)
Widen the high lanes of `x` using unsigned extension.
This will double the lane width and halve the number of lanes.
"#,
&formats.unary,
)
@@ -4123,31 +4124,24 @@ pub(crate) fn define(
.operands_out(vec![a]),
);
ig.push(
Inst::new(
"extended_pairwise_add_signed",
r#"
Widen the high lanes of `x` using signed extension.
This will double the lane width and halve the number of lanes.
"#,
&formats.unary,
)
.operands_in(vec![x])
.operands_out(vec![a]),
);
let x = &Operand::new("x", I8or16or32xN);
let y = &Operand::new("y", I8or16or32xN);
let a = &Operand::new("a", I8or16or32xN);
ig.push(
Inst::new(
"extended_pairwise_add_unsigned",
"iadd_pairwise",
r#"
Widen the high lanes of `x` extending with zeros.
This will double the lane width and halve the number of lanes.
Does lane-wise integer pairwise addition on two operands, putting the
combined results into a single vector result. Here a pair refers to adjacent
lanes in a vector, i.e. i*2 + (i*2+1) for i == num_lanes/2. The first operand
pairwise add results will make up the low half of the resulting vector while
the second operand pairwise add results will make up the upper half of the
resulting vector.
"#,
&formats.unary,
&formats.binary,
)
.operands_in(vec![x])
.operands_in(vec![x, y])
.operands_out(vec![a]),
);