Skip to content

Commit 16693f8

Browse files
committed
simplify the vec_abs implementation
1 parent f72a162 commit 16693f8

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

crates/core_arch/src/s390x/vector.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,9 @@ mod sealed {
384384
impl_abs! { vec_abs_i32, i32x4 }
385385
impl_abs! { vec_abs_i64, i64x2 }
386386

387-
#[inline]
388-
#[target_feature(enable = "vector")]
389-
unsafe fn vec_abs_f32(v: vector_float) -> vector_float {
390-
let v: u32x4 = transmute(v);
391-
392-
transmute(simd_and(v, u32x4::splat(0x7FFFFFFF)))
393-
}
394-
395-
#[inline]
396-
#[target_feature(enable = "vector")]
397-
unsafe fn vec_abs_f64(v: vector_double) -> vector_double {
398-
let v: u64x2 = transmute(v);
399-
400-
transmute(simd_and(v, u64x2::splat(0x7FFFFFFF_FFFFFFFF)))
401-
}
387+
// FIXME(vector-enhancements-1)
388+
test_impl! { vec_abs_f32 (v: vector_float) -> vector_float [ simd_fabs, _ ] }
389+
test_impl! { vec_abs_f64 (v: vector_double) -> vector_double [ simd_fabs, vflpdb ] }
402390

403391
impl_vec_trait! { [VectorAbs vec_abs] vec_abs_f32 (vector_float) }
404392
impl_vec_trait! { [VectorAbs vec_abs] vec_abs_f64 (vector_double) }

0 commit comments

Comments
 (0)