Skip to content

Commit 803899a

Browse files
committed
simplify the vec_abs implementation
1 parent 8f1a215 commit 803899a

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
@@ -366,21 +366,9 @@ mod sealed {
366366
impl_abs! { vec_abs_i32, i32x4 }
367367
impl_abs! { vec_abs_i64, i64x2 }
368368

369-
#[inline]
370-
#[target_feature(enable = "vector")]
371-
unsafe fn vec_abs_f32(v: vector_float) -> vector_float {
372-
let v: u32x4 = transmute(v);
373-
374-
transmute(simd_and(v, u32x4::splat(0x7FFFFFFF)))
375-
}
376-
377-
#[inline]
378-
#[target_feature(enable = "vector")]
379-
unsafe fn vec_abs_f64(v: vector_double) -> vector_double {
380-
let v: u64x2 = transmute(v);
381-
382-
transmute(simd_and(v, u64x2::splat(0x7FFFFFFF_FFFFFFFF)))
383-
}
369+
// FIXME(vector-enhancements-1)
370+
test_impl! { vec_abs_f32 (v: vector_float) -> vector_float [ simd_fabs, _ ] }
371+
test_impl! { vec_abs_f64 (v: vector_double) -> vector_double [ simd_fabs, vflpdb ] }
384372

385373
impl_vec_trait! { [VectorAbs vec_abs] vec_abs_f32 (vector_float) }
386374
impl_vec_trait! { [VectorAbs vec_abs] vec_abs_f64 (vector_double) }

0 commit comments

Comments
 (0)