Performs the supplied unary arithmetic `op` on a Value, either Vector or Scalar.
(x: DataValue, vector_type: types::Type, op: F)
| 1550 | |
| 1551 | /// Performs the supplied unary arithmetic `op` on a Value, either Vector or Scalar. |
| 1552 | fn unary_arith<F>(x: DataValue, vector_type: types::Type, op: F) -> ValueResult<DataValue> |
| 1553 | where |
| 1554 | F: Fn(DataValue) -> ValueResult<DataValue>, |
| 1555 | { |
| 1556 | let arg = extractlanes(&x, vector_type)?; |
| 1557 | |
| 1558 | let result = arg |
| 1559 | .into_iter() |
| 1560 | .map(|arg| Ok(op(arg)?)) |
| 1561 | .collect::<ValueResult<SimdVec<DataValue>>>()?; |
| 1562 | |
| 1563 | vectorizelanes(&result, vector_type) |
| 1564 | } |
| 1565 | |
| 1566 | /// Performs the supplied binary arithmetic `op` on two values, either vector or scalar. |
| 1567 | fn binary_arith<F>( |
no test coverage detected