Skip to content

Commit 5ef22a7

Browse files
RalfJungAmanieu
authored andcommitted
use consistent wording around the 'undefined' intrinsics, and slightly expand their docs
1 parent daeccc4 commit 5ef22a7

File tree

5 files changed

+45
-29
lines changed

5 files changed

+45
-29
lines changed

crates/core_arch/src/x86/avx.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -2815,8 +2815,9 @@ pub fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d {
28152815
}
28162816

28172817
/// Returns vector of type `__m256` with indeterminate elements.
2818-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
2819-
/// In practice, this is equivalent to [`mem::zeroed`].
2818+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
2819+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
2820+
/// In practice, this is typically equivalent to [`mem::zeroed`].
28202821
///
28212822
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_undefined_ps)
28222823
#[inline]
@@ -2828,8 +2829,9 @@ pub fn _mm256_undefined_ps() -> __m256 {
28282829
}
28292830

28302831
/// Returns vector of type `__m256d` with indeterminate elements.
2831-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
2832-
/// In practice, this is equivalent to [`mem::zeroed`].
2832+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
2833+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
2834+
/// In practice, this is typically equivalent to [`mem::zeroed`].
28332835
///
28342836
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_undefined_pd)
28352837
#[inline]
@@ -2841,8 +2843,9 @@ pub fn _mm256_undefined_pd() -> __m256d {
28412843
}
28422844

28432845
/// Returns vector of type __m256i with with indeterminate elements.
2844-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
2845-
/// In practice, this is equivalent to [`mem::zeroed`].
2846+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
2847+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
2848+
/// In practice, this is typically equivalent to [`mem::zeroed`].
28462849
///
28472850
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_undefined_si256)
28482851
#[inline]

crates/core_arch/src/x86/avx512f.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -33746,8 +33746,9 @@ pub fn _mm512_mask_reduce_or_epi64(k: __mmask8, a: __m512i) -> i64 {
3374633746
}
3374733747

3374833748
/// Returns vector of type `__m512d` with indeterminate elements.
33749-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
33750-
/// In practice, this is equivalent to [`mem::zeroed`].
33749+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
33750+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
33751+
/// In practice, this is typically equivalent to [`mem::zeroed`].
3375133752
///
3375233753
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_undefined_pd)
3375333754
#[inline]
@@ -33759,8 +33760,9 @@ pub fn _mm512_undefined_pd() -> __m512d {
3375933760
}
3376033761

3376133762
/// Returns vector of type `__m512` with indeterminate elements.
33762-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
33763-
/// In practice, this is equivalent to [`mem::zeroed`].
33763+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
33764+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
33765+
/// In practice, this is typically equivalent to [`mem::zeroed`].
3376433766
///
3376533767
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_undefined_ps)
3376633768
#[inline]
@@ -33772,8 +33774,9 @@ pub fn _mm512_undefined_ps() -> __m512 {
3377233774
}
3377333775

3377433776
/// Return vector of type __m512i with indeterminate elements.
33775-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
33776-
/// In practice, this is equivalent to [`mem::zeroed`].
33777+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
33778+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
33779+
/// In practice, this is typically equivalent to [`mem::zeroed`].
3377733780
///
3377833781
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_undefined_epi32&expand=5995)
3377933782
#[inline]
@@ -33785,8 +33788,9 @@ pub fn _mm512_undefined_epi32() -> __m512i {
3378533788
}
3378633789

3378733790
/// Return vector of type __m512 with indeterminate elements.
33788-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
33789-
/// In practice, this is equivalent to [`mem::zeroed`].
33791+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
33792+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
33793+
/// In practice, this is typically equivalent to [`mem::zeroed`].
3379033794
///
3379133795
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_undefined&expand=5994)
3379233796
#[inline]

crates/core_arch/src/x86/avx512fp16.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ pub fn _mm512_setzero_ph() -> __m512h {
262262
unsafe { transmute(f16x32::ZERO) }
263263
}
264264

265-
/// Return vector of type `__m128h` with undefined elements. In practice, this returns the all-zero
266-
/// vector.
265+
/// Return vector of type `__m128h` with indetermination elements.
266+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
267+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
268+
/// In practice, this is typically equivalent to [`mem::zeroed`].
267269
///
268270
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_ph)
269271
#[inline]
@@ -273,8 +275,10 @@ pub fn _mm_undefined_ph() -> __m128h {
273275
unsafe { transmute(f16x8::ZERO) }
274276
}
275277

276-
/// Return vector of type `__m256h` with undefined elements. In practice, this returns the all-zero
277-
/// vector.
278+
/// Return vector of type `__m256h` with indetermination elements.
279+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
280+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
281+
/// In practice, this is typically equivalent to [`mem::zeroed`].
278282
///
279283
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_ph)
280284
#[inline]
@@ -284,8 +288,10 @@ pub fn _mm256_undefined_ph() -> __m256h {
284288
unsafe { transmute(f16x16::ZERO) }
285289
}
286290

287-
/// Return vector of type `__m512h` with undefined elements. In practice, this returns the all-zero
288-
/// vector.
291+
/// Return vector of type `__m512h` with indetermination elements.
292+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
293+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
294+
/// In practice, this is typically equivalent to [`mem::zeroed`].
289295
///
290296
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_ph)
291297
#[inline]

crates/core_arch/src/x86/sse.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1884,9 +1884,10 @@ pub unsafe fn _mm_prefetch<const STRATEGY: i32>(p: *const i8) {
18841884
prefetch(p, (STRATEGY >> 2) & 1, STRATEGY & 3, 1);
18851885
}
18861886

1887-
/// Returns vector of type __m128 with indeterminate elements.
1888-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
1889-
/// In practice, this is equivalent to [`mem::zeroed`].
1887+
/// Returns vector of type __m128 with indeterminate elements.with indetermination elements.
1888+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
1889+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
1890+
/// In practice, this is typically equivalent to [`mem::zeroed`].
18901891
///
18911892
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_undefined_ps)
18921893
#[inline]

crates/core_arch/src/x86/sse2.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -2956,9 +2956,10 @@ pub fn _mm_castsi128_ps(a: __m128i) -> __m128 {
29562956
unsafe { transmute(a) }
29572957
}
29582958

2959-
/// Returns vector of type __m128d with indeterminate elements.
2960-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
2961-
/// In practice, this is equivalent to [`mem::zeroed`].
2959+
/// Returns vector of type __m128d with indeterminate elements.with indetermination elements.
2960+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
2961+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
2962+
/// In practice, this is typically equivalent to [`mem::zeroed`].
29622963
///
29632964
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_undefined_pd)
29642965
#[inline]
@@ -2968,9 +2969,10 @@ pub fn _mm_undefined_pd() -> __m128d {
29682969
const { unsafe { mem::zeroed() } }
29692970
}
29702971

2971-
/// Returns vector of type __m128i with indeterminate elements.
2972-
/// Despite being "undefined", this is some valid value and not equivalent to [`mem::MaybeUninit`].
2973-
/// In practice, this is equivalent to [`mem::zeroed`].
2972+
/// Returns vector of type __m128i with indeterminate elements.with indetermination elements.
2973+
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
2974+
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
2975+
/// In practice, this is typically equivalent to [`mem::zeroed`].
29742976
///
29752977
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_undefined_si128)
29762978
#[inline]

0 commit comments

Comments
 (0)