Skip to content

Commit f6414e7

Browse files
committed
s390x: use simd_round_ties_even in more places
1 parent 9430936 commit f6414e7

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

crates/core_arch/src/s390x/vector.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ unsafe extern "unadjusted" {
8080
#[link_name = "llvm.umin.v4i32"] fn vmnlf(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
8181
#[link_name = "llvm.umin.v2i64"] fn vmnlg(a: vector_unsigned_long_long, b: vector_unsigned_long_long) -> vector_unsigned_long_long;
8282

83-
#[link_name = "llvm.nearbyint.v4f32"] fn nearbyint_v4f32(a: vector_float) -> vector_float;
84-
#[link_name = "llvm.nearbyint.v2f64"] fn nearbyint_v2f64(a: vector_double) -> vector_double;
85-
86-
#[link_name = "llvm.roundeven.v4f32"] fn roundeven_v4f32(a: vector_float) -> vector_float;
87-
#[link_name = "llvm.roundeven.v2f64"] fn roundeven_v2f64(a: vector_double) -> vector_double;
88-
8983
#[link_name = "llvm.s390.vsra"] fn vsra(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
9084
#[link_name = "llvm.s390.vsrl"] fn vsrl(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
9185
#[link_name = "llvm.s390.vsl"] fn vsl(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
@@ -1181,14 +1175,14 @@ mod sealed {
11811175

11821176
impl_vec_trait! { [VectorOrc vec_orc]+ 2c (orc) }
11831177

1184-
test_impl! { vec_roundc_f32 (a: vector_float) -> vector_float [nearbyint_v4f32, "vector-enhancements-1" vfisb] }
1185-
test_impl! { vec_roundc_f64 (a: vector_double) -> vector_double [nearbyint_v2f64, vfidb] }
1178+
// Technically `llvm.nearbyint`, but it behaves like `llvm.roundeven` on this target.
1179+
test_impl! { vec_roundc_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] }
1180+
test_impl! { vec_roundc_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] }
11861181

1187-
// FIXME(llvm) llvm trunk already lowers roundeven to vfidb, but rust does not use it yet
1188-
// use https://godbolt.org/z/cWq95fexe to check, and enable the instruction test when it works
1189-
test_impl! { vec_round_f32 (a: vector_float) -> vector_float [roundeven_v4f32, _] }
1190-
test_impl! { vec_round_f64 (a: vector_double) -> vector_double [roundeven_v2f64, _] }
1182+
test_impl! { vec_round_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] }
1183+
test_impl! { vec_round_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] }
11911184

1185+
// Technically `llvm.rint`, but it behaves like `llvm.roundeven` on this target.
11921186
test_impl! { vec_rint_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] }
11931187
test_impl! { vec_rint_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] }
11941188

0 commit comments

Comments
 (0)