Skip to content

Commit 9f127ae

Browse files
committed
s390x: document the different rounding flavors
1 parent 9430936 commit 9f127ae

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

crates/core_arch/src/s390x/vector.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,20 @@ mod sealed {
11811181

11821182
impl_vec_trait! { [VectorOrc vec_orc]+ 2c (orc) }
11831183

1184+
// Z vector intrinsic C23 math.h LLVM IR ISO/IEC 60559 operation inexact vfidb parameters
1185+
//
1186+
// vec_rint rint llvm.rint roundToIntegralExact yes 0, 0
1187+
// vec_roundc nearbyint llvm.nearbyint n/a no 4, 0
1188+
// vec_floor / vec_roundm floor llvm.floor roundToIntegralTowardNegative no 4, 7
1189+
// vec_ceil / vec_roundp ceil llvm.ceil roundToIntegralTowardPositive no 4, 6
1190+
// vec_trunc / vec_roundz trunc llvm.trunc roundToIntegralTowardZero no 4, 5
1191+
// vec_round roundeven llvm.roundeven roundToIntegralTiesToEven no 4, 4
1192+
// n/a round llvm.round roundToIntegralTiesAway no 4, 1
1193+
1194+
// `simd_round_ties_even` is implemented as `llvm.rint`.
1195+
test_impl! { vec_rint_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] }
1196+
test_impl! { vec_rint_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] }
1197+
11841198
test_impl! { vec_roundc_f32 (a: vector_float) -> vector_float [nearbyint_v4f32, "vector-enhancements-1" vfisb] }
11851199
test_impl! { vec_roundc_f64 (a: vector_double) -> vector_double [nearbyint_v2f64, vfidb] }
11861200

@@ -1189,9 +1203,6 @@ mod sealed {
11891203
test_impl! { vec_round_f32 (a: vector_float) -> vector_float [roundeven_v4f32, _] }
11901204
test_impl! { vec_round_f64 (a: vector_double) -> vector_double [roundeven_v2f64, _] }
11911205

1192-
test_impl! { vec_rint_f32 (a: vector_float) -> vector_float [simd_round_ties_even, "vector-enhancements-1" vfisb] }
1193-
test_impl! { vec_rint_f64 (a: vector_double) -> vector_double [simd_round_ties_even, vfidb] }
1194-
11951206
#[unstable(feature = "stdarch_s390x", issue = "135681")]
11961207
pub trait VectorRoundc {
11971208
unsafe fn vec_roundc(self) -> Self;

0 commit comments

Comments
 (0)