Performs the supplied pairwise arithmetic `op` on two SIMD vectors, where pairs are formed from adjacent vector elements and the vectors are concatenated at the end.
(
x: DataValue,
y: DataValue,
vector_type: types::Type,
op: F,
)
| 1589 | /// pairs are formed from adjacent vector elements and the vectors are |
| 1590 | /// concatenated at the end. |
| 1591 | fn binary_pairwise<F>( |
| 1592 | x: DataValue, |
| 1593 | y: DataValue, |
| 1594 | vector_type: types::Type, |
| 1595 | op: F, |
| 1596 | ) -> ValueResult<DataValue> |
| 1597 | where |
| 1598 | F: Fn(DataValue, DataValue) -> ValueResult<DataValue>, |
| 1599 | { |
| 1600 | let arg0 = extractlanes(&x, vector_type)?; |
| 1601 | let arg1 = extractlanes(&y, vector_type)?; |
| 1602 | |
| 1603 | let result = arg0 |
| 1604 | .chunks(2) |
| 1605 | .chain(arg1.chunks(2)) |
| 1606 | .map(|pair| op(pair[0].clone(), pair[1].clone())) |
| 1607 | .collect::<ValueResult<SimdVec<DataValue>>>()?; |
| 1608 | |
| 1609 | vectorizelanes(&result, vector_type) |
| 1610 | } |
| 1611 | |
| 1612 | fn bitselect(c: DataValue, x: DataValue, y: DataValue) -> ValueResult<DataValue> { |
| 1613 | let mask_x = DataValueExt::and(c.clone(), x)?; |
no test coverage detected