From 46b9c31646cab283e25ab992c3cdaf2eebcb9119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Fri, 27 Mar 2020 22:28:19 +0100 Subject: [PATCH] Replace module MIN/MAX and min/max_value() with assoc consts --- crates/core_arch/src/wasm32/memory.rs | 2 +- crates/core_arch/src/wasm32/simd128.rs | 12 ++++++------ crates/core_arch/src/x86/sse.rs | 4 ++-- crates/core_arch/src/x86_64/sse.rs | 4 ++-- crates/std_detect/src/detect/cache.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/core_arch/src/wasm32/memory.rs b/crates/core_arch/src/wasm32/memory.rs index f2c7fa54c3..3df8abdee2 100644 --- a/crates/core_arch/src/wasm32/memory.rs +++ b/crates/core_arch/src/wasm32/memory.rs @@ -41,7 +41,7 @@ pub fn memory_size(mem: u32) -> usize { /// by the specified `delta` of pages. The current WebAssembly page size is /// 65536 bytes (64 KB). If memory is successfully grown then the previous size /// of memory, in pages, is returned. If memory cannot be grown then -/// `usize::max_value()` is returned. +/// `usize::MAX` is returned. /// /// The argument `mem` is the numerical index of which memory to return the /// size of. Note that currently the WebAssembly specification only supports one diff --git a/crates/core_arch/src/wasm32/simd128.rs b/crates/core_arch/src/wasm32/simd128.rs index c7377e23a2..ed281f2e74 100644 --- a/crates/core_arch/src/wasm32/simd128.rs +++ b/crates/core_arch/src/wasm32/simd128.rs @@ -1059,7 +1059,7 @@ pub fn i8x16_add(a: v128, b: v128) -> v128 { } /// Adds two 128-bit vectors as if they were two packed sixteen 8-bit signed -/// integers, saturating on overflow to `i8::max_value()`. +/// integers, saturating on overflow to `i8::MAX`. #[inline] #[cfg_attr(test, assert_instr(i8x16.add_saturate_s))] pub fn i8x16_add_saturate_s(a: v128, b: v128) -> v128 { @@ -1067,7 +1067,7 @@ pub fn i8x16_add_saturate_s(a: v128, b: v128) -> v128 { } /// Adds two 128-bit vectors as if they were two packed sixteen 8-bit unsigned -/// integers, saturating on overflow to `u8::max_value()`. +/// integers, saturating on overflow to `u8::MAX`. #[inline] #[cfg_attr(test, assert_instr(i8x16.add_saturate_u))] pub fn i8x16_add_saturate_u(a: v128, b: v128) -> v128 { @@ -1082,7 +1082,7 @@ pub fn i8x16_sub(a: v128, b: v128) -> v128 { } /// Subtracts two 128-bit vectors as if they were two packed sixteen 8-bit -/// signed integers, saturating on overflow to `i8::min_value()`. +/// signed integers, saturating on overflow to `i8::MIN`. #[inline] #[cfg_attr(test, assert_instr(i8x16.sub_saturate_s))] pub fn i8x16_sub_saturate_s(a: v128, b: v128) -> v128 { @@ -1169,7 +1169,7 @@ pub fn i16x8_add(a: v128, b: v128) -> v128 { } /// Adds two 128-bit vectors as if they were two packed eight 16-bit signed -/// integers, saturating on overflow to `i16::max_value()`. +/// integers, saturating on overflow to `i16::MAX`. #[inline] #[cfg_attr(test, assert_instr(i16x8.add_saturate_s))] pub fn i16x8_add_saturate_s(a: v128, b: v128) -> v128 { @@ -1177,7 +1177,7 @@ pub fn i16x8_add_saturate_s(a: v128, b: v128) -> v128 { } /// Adds two 128-bit vectors as if they were two packed eight 16-bit unsigned -/// integers, saturating on overflow to `u16::max_value()`. +/// integers, saturating on overflow to `u16::MAX`. #[inline] #[cfg_attr(test, assert_instr(i16x8.add_saturate_u))] pub fn i16x8_add_saturate_u(a: v128, b: v128) -> v128 { @@ -1192,7 +1192,7 @@ pub fn i16x8_sub(a: v128, b: v128) -> v128 { } /// Subtracts two 128-bit vectors as if they were two packed eight 16-bit -/// signed integers, saturating on overflow to `i16::min_value()`. +/// signed integers, saturating on overflow to `i16::MIN`. #[inline] #[cfg_attr(test, assert_instr(i16x8.sub_saturate_s))] pub fn i16x8_sub_saturate_s(a: v128, b: v128) -> v128 { diff --git a/crates/core_arch/src/x86/sse.rs b/crates/core_arch/src/x86/sse.rs index b07971c500..cf6dfd01a8 100644 --- a/crates/core_arch/src/x86/sse.rs +++ b/crates/core_arch/src/x86/sse.rs @@ -790,7 +790,7 @@ pub unsafe fn _mm_ucomineq_ss(a: __m128, b: __m128) -> i32 { /// /// The result is rounded according to the current rounding mode. If the result /// cannot be represented as a 32 bit integer the result will be `0x8000_0000` -/// (`std::i32::MIN`) or an invalid operation floating point exception if +/// (`i32::MIN`) or an invalid operation floating point exception if /// unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)). /// /// This corresponds to the `CVTSS2SI` instruction (with 32 bit output). @@ -821,7 +821,7 @@ pub unsafe fn _mm_cvt_ss2si(a: __m128) -> i32 { /// /// The result is rounded always using truncation (round towards zero). If the /// result cannot be represented as a 32 bit integer the result will be -/// `0x8000_0000` (`std::i32::MIN`) or an invalid operation floating point +/// `0x8000_0000` (`i32::MIN`) or an invalid operation floating point /// exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)). /// /// This corresponds to the `CVTTSS2SI` instruction (with 32 bit output). diff --git a/crates/core_arch/src/x86_64/sse.rs b/crates/core_arch/src/x86_64/sse.rs index ec09282463..3888da6ebf 100644 --- a/crates/core_arch/src/x86_64/sse.rs +++ b/crates/core_arch/src/x86_64/sse.rs @@ -19,7 +19,7 @@ extern "C" { /// /// The result is rounded according to the current rounding mode. If the result /// cannot be represented as a 64 bit integer the result will be -/// `0x8000_0000_0000_0000` (`std::i64::MIN`) or trigger an invalid operation +/// `0x8000_0000_0000_0000` (`i64::MIN`) or trigger an invalid operation /// floating point exception if unmasked (see /// [`_mm_setcsr`](fn._mm_setcsr.html)). /// @@ -39,7 +39,7 @@ pub unsafe fn _mm_cvtss_si64(a: __m128) -> i64 { /// /// The result is rounded always using truncation (round towards zero). If the /// result cannot be represented as a 64 bit integer the result will be -/// `0x8000_0000_0000_0000` (`std::i64::MIN`) or an invalid operation floating +/// `0x8000_0000_0000_0000` (`i64::MIN`) or an invalid operation floating /// point exception if unmasked (see [`_mm_setcsr`](fn._mm_setcsr.html)). /// /// This corresponds to the `CVTTSS2SI` instruction (with 64 bit output). diff --git a/crates/std_detect/src/detect/cache.rs b/crates/std_detect/src/detect/cache.rs index d421037f69..a9123c2723 100644 --- a/crates/std_detect/src/detect/cache.rs +++ b/crates/std_detect/src/detect/cache.rs @@ -80,7 +80,7 @@ impl Initializer { // Note: on x64, we only use the first slot static CACHE: [Cache; 2] = [Cache::uninitialized(), Cache::uninitialized()]; -/// Feature cache with capacity for `usize::max_value() - 1` features. +/// Feature cache with capacity for `usize::MAX - 1` features. /// /// Note: the last feature bit is used to represent an /// uninitialized cache.