From 8376fbe34fef51dca5d42ae58d42ae3afafc91b3 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Sat, 21 Sep 2024 16:35:22 +0200 Subject: [PATCH] Provide link for rounding parameters - SSE --- .../stdarch/crates/core_arch/src/x86/sse41.rs | 116 +++--------------- 1 file changed, 20 insertions(+), 96 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/x86/sse41.rs b/library/stdarch/crates/core_arch/src/x86/sse41.rs index 34aa06d3de7b..d47bf5821b76 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse41.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse41.rs @@ -740,30 +740,11 @@ pub unsafe fn _mm_ceil_ss(a: __m128, b: __m128) -> __m128 { /// double-precision floating-point elements. /// Rounding is done according to the rounding parameter, which can be one of: /// -/// ``` -/// #[cfg(target_arch = "x86")] -/// use std::arch::x86::*; -/// #[cfg(target_arch = "x86_64")] -/// use std::arch::x86_64::*; -/// -/// # fn main() { -/// // round to nearest, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC; -/// // round down, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC; -/// // round up, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC; -/// // truncate, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC; -/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`: -/// # let _x = -/// _MM_FROUND_CUR_DIRECTION; -/// # } -/// ``` +/// * [`_MM_FROUND_TO_NEAREST_INT`] | [`_MM_FROUND_NO_EXC`]: round to nearest and suppress exceptions +/// * [`_MM_FROUND_TO_NEG_INF`] | [`_MM_FROUND_NO_EXC`]: round down and suppress exceptions +/// * [`_MM_FROUND_TO_POS_INF`] | [`_MM_FROUND_NO_EXC`]: round up and suppress exceptions +/// * [`_MM_FROUND_TO_ZERO`] | [`_MM_FROUND_NO_EXC`]: truncate and suppress exceptions +/// * [`_MM_FROUND_CUR_DIRECTION`]: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`] /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_round_pd) #[inline] @@ -781,30 +762,11 @@ pub unsafe fn _mm_round_pd(a: __m128d) -> __m128d { /// single-precision floating-point elements. /// Rounding is done according to the rounding parameter, which can be one of: /// -/// ``` -/// #[cfg(target_arch = "x86")] -/// use std::arch::x86::*; -/// #[cfg(target_arch = "x86_64")] -/// use std::arch::x86_64::*; -/// -/// # fn main() { -/// // round to nearest, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC; -/// // round down, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC; -/// // round up, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC; -/// // truncate, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC; -/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`: -/// # let _x = -/// _MM_FROUND_CUR_DIRECTION; -/// # } -/// ``` +/// * [`_MM_FROUND_TO_NEAREST_INT`] | [`_MM_FROUND_NO_EXC`]: round to nearest and suppress exceptions +/// * [`_MM_FROUND_TO_NEG_INF`] | [`_MM_FROUND_NO_EXC`]: round down and suppress exceptions +/// * [`_MM_FROUND_TO_POS_INF`] | [`_MM_FROUND_NO_EXC`]: round up and suppress exceptions +/// * [`_MM_FROUND_TO_ZERO`] | [`_MM_FROUND_NO_EXC`]: truncate and suppress exceptions +/// * [`_MM_FROUND_CUR_DIRECTION`]: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`] /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_round_ps) #[inline] @@ -824,30 +786,11 @@ pub unsafe fn _mm_round_ps(a: __m128) -> __m128 { /// result. /// Rounding is done according to the rounding parameter, which can be one of: /// -/// ``` -/// #[cfg(target_arch = "x86")] -/// use std::arch::x86::*; -/// #[cfg(target_arch = "x86_64")] -/// use std::arch::x86_64::*; -/// -/// # fn main() { -/// // round to nearest, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC; -/// // round down, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC; -/// // round up, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC; -/// // truncate, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC; -/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`: -/// # let _x = -/// _MM_FROUND_CUR_DIRECTION; -/// # } -/// ``` +/// * [`_MM_FROUND_TO_NEAREST_INT`] | [`_MM_FROUND_NO_EXC`]: round to nearest and suppress exceptions +/// * [`_MM_FROUND_TO_NEG_INF`] | [`_MM_FROUND_NO_EXC`]: round down and suppress exceptions +/// * [`_MM_FROUND_TO_POS_INF`] | [`_MM_FROUND_NO_EXC`]: round up and suppress exceptions +/// * [`_MM_FROUND_TO_ZERO`] | [`_MM_FROUND_NO_EXC`]: truncate and suppress exceptions +/// * [`_MM_FROUND_CUR_DIRECTION`]: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`] /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_round_sd) #[inline] @@ -867,30 +810,11 @@ pub unsafe fn _mm_round_sd(a: __m128d, b: __m128d) -> __m12 /// of the intrinsic result. /// Rounding is done according to the rounding parameter, which can be one of: /// -/// ``` -/// #[cfg(target_arch = "x86")] -/// use std::arch::x86::*; -/// #[cfg(target_arch = "x86_64")] -/// use std::arch::x86_64::*; -/// -/// # fn main() { -/// // round to nearest, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC; -/// // round down, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC; -/// // round up, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC; -/// // truncate, and suppress exceptions: -/// # let _x = -/// _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC; -/// // use MXCSR.RC; see `_MM_SET_ROUNDING_MODE`: -/// # let _x = -/// _MM_FROUND_CUR_DIRECTION; -/// # } -/// ``` +/// * [`_MM_FROUND_TO_NEAREST_INT`] | [`_MM_FROUND_NO_EXC`]: round to nearest and suppress exceptions +/// * [`_MM_FROUND_TO_NEG_INF`] | [`_MM_FROUND_NO_EXC`]: round down and suppress exceptions +/// * [`_MM_FROUND_TO_POS_INF`] | [`_MM_FROUND_NO_EXC`]: round up and suppress exceptions +/// * [`_MM_FROUND_TO_ZERO`] | [`_MM_FROUND_NO_EXC`]: truncate and suppress exceptions +/// * [`_MM_FROUND_CUR_DIRECTION`]: use `MXCSR.RC` - see [`_MM_SET_ROUNDING_MODE`] /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_round_ss) #[inline]