about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2023-12-17 12:48:17 -0500
committerCaleb Zulawski <caleb.zulawski@gmail.com>2023-12-17 21:17:00 -0500
commit1fd7de062e77cb0464eeb0ad0b07c555151d73d3 (patch)
treed943fdb7e49223245fd9736211b220854df36044
parentef4cf01542f6c693b259427260f8e02a7691ee6c (diff)
downloadrust-1fd7de062e77cb0464eeb0ad0b07c555151d73d3.tar.gz
rust-1fd7de062e77cb0464eeb0ad0b07c555151d73d3.zip
Clarify UB and improve grammar
Co-authored-by: Ralf Jung <post@ralfj.de>
-rw-r--r--library/core/src/intrinsics/simd.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs
index e375e5ba42f..b5edd80df70 100644
--- a/library/core/src/intrinsics/simd.rs
+++ b/library/core/src/intrinsics/simd.rs
@@ -36,7 +36,7 @@ extern "platform-intrinsic" {
     /// Additionally for signed integers, `<int>::MIN / -1` is undefined behavior.
     pub fn simd_rem<T>(lhs: T, rhs: T) -> T;
 
-    /// Elementwise vector left shift.
+    /// Elementwise vector left shift, with UB on overflow.
     ///
     /// Shift `lhs` left by `rhs`, shifting in sign bits for signed types.
     ///
@@ -47,7 +47,7 @@ extern "platform-intrinsic" {
     /// Each element of `rhs` must be less than `<int>::BITS`.
     pub fn simd_shl<T>(lhs: T, rhs: T) -> T;
 
-    /// Elementwise vector right shift.
+    /// Elementwise vector right shift, with UB on overflow.
     ///
     /// Shift `lhs` right by `rhs`, shifting in sign bits for signed types.
     ///
@@ -75,11 +75,11 @@ extern "platform-intrinsic" {
 
     /// Numerically cast a vector, elementwise.
     ///
-    /// When casting floats to integers, the result is truncated.
+    /// When casting floats to integers, the result is truncated. Out-of-bounds result lead to UB.
     /// When casting integers to floats, the result is rounded.
     /// Otherwise, truncates or extends the value, maintaining the sign for signed integers.
     ///
-    /// `T` and `U` be a vectors of integer or floating point primitive types, and must have the
+    /// `T` and `U` must be vectors of integer or floating point primitive types, and must have the
     /// same length.
     ///
     /// # Safety