Skip to content

Commit

Permalink
Replace all std::<primitive>::MIN/MAX with just <primitive>::MIN/MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
faern authored and dtolnay committed Apr 4, 2020
1 parent 3bd56ed commit 1a577bd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
20 changes: 10 additions & 10 deletions crates/core_arch/src/x86/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4046,14 +4046,14 @@ mod tests {
unsafe fn test_mm256_abs_epi32() {
#[rustfmt::skip]
let a = _mm256_setr_epi32(
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
);
let r = _mm256_abs_epi32(a);
#[rustfmt::skip]
let e = _mm256_setr_epi32(
0, 1, 1, std::i32::MAX,
std::i32::MAX.wrapping_add(1), 100, 100, 32,
0, 1, 1, i32::MAX,
i32::MAX.wrapping_add(1), 100, 100, 32,
);
assert_eq_m256i(r, e);
}
Expand All @@ -4063,13 +4063,13 @@ mod tests {
#[rustfmt::skip]
let a = _mm256_setr_epi16(
0, 1, -1, 2, -2, 3, -3, 4,
-4, 5, -5, std::i16::MAX, std::i16::MIN, 100, -100, -32,
-4, 5, -5, i16::MAX, i16::MIN, 100, -100, -32,
);
let r = _mm256_abs_epi16(a);
#[rustfmt::skip]
let e = _mm256_setr_epi16(
0, 1, 1, 2, 2, 3, 3, 4,
4, 5, 5, std::i16::MAX, std::i16::MAX.wrapping_add(1), 100, 100, 32,
4, 5, 5, i16::MAX, i16::MAX.wrapping_add(1), 100, 100, 32,
);
assert_eq_m256i(r, e);
}
Expand All @@ -4079,17 +4079,17 @@ mod tests {
#[rustfmt::skip]
let a = _mm256_setr_epi8(
0, 1, -1, 2, -2, 3, -3, 4,
-4, 5, -5, std::i8::MAX, std::i8::MIN, 100, -100, -32,
-4, 5, -5, i8::MAX, i8::MIN, 100, -100, -32,
0, 1, -1, 2, -2, 3, -3, 4,
-4, 5, -5, std::i8::MAX, std::i8::MIN, 100, -100, -32,
-4, 5, -5, i8::MAX, i8::MIN, 100, -100, -32,
);
let r = _mm256_abs_epi8(a);
#[rustfmt::skip]
let e = _mm256_setr_epi8(
0, 1, 1, 2, 2, 3, 3, 4,
4, 5, 5, std::i8::MAX, std::i8::MAX.wrapping_add(1), 100, 100, 32,
4, 5, 5, i8::MAX, i8::MAX.wrapping_add(1), 100, 100, 32,
0, 1, 1, 2, 2, 3, 3, 4,
4, 5, 5, std::i8::MAX, std::i8::MAX.wrapping_add(1), 100, 100, 32,
4, 5, 5, i8::MAX, i8::MAX.wrapping_add(1), 100, 100, 32,
);
assert_eq_m256i(r, e);
}
Expand Down
44 changes: 22 additions & 22 deletions crates/core_arch/src/x86/avx512f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,26 @@ mod tests {
unsafe fn test_mm512_abs_epi32() {
#[rustfmt::skip]
let a = _mm512_setr_epi32(
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
);
let r = _mm512_abs_epi32(a);
let e = _mm512_setr_epi32(
0,
1,
1,
std::i32::MAX,
std::i32::MAX.wrapping_add(1),
i32::MAX,
i32::MAX.wrapping_add(1),
100,
100,
32,
0,
1,
1,
std::i32::MAX,
std::i32::MAX.wrapping_add(1),
i32::MAX,
i32::MAX.wrapping_add(1),
100,
100,
32,
Expand All @@ -136,10 +136,10 @@ mod tests {
unsafe fn test_mm512_mask_abs_epi32() {
#[rustfmt::skip]
let a = _mm512_setr_epi32(
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
);
let r = _mm512_mask_abs_epi32(a, 0, a);
assert_eq_m512i(r, a);
Expand All @@ -148,16 +148,16 @@ mod tests {
0,
1,
1,
std::i32::MAX,
std::i32::MAX.wrapping_add(1),
i32::MAX,
i32::MAX.wrapping_add(1),
100,
100,
32,
0,
1,
-1,
std::i32::MAX,
std::i32::MIN,
i32::MAX,
i32::MIN,
100,
-100,
-32,
Expand All @@ -169,10 +169,10 @@ mod tests {
unsafe fn test_mm512_maskz_abs_epi32() {
#[rustfmt::skip]
let a = _mm512_setr_epi32(
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, std::i32::MAX,
std::i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
0, 1, -1, i32::MAX,
i32::MIN, 100, -100, -32,
);
let r = _mm512_maskz_abs_epi32(0, a);
assert_eq_m512i(r, _mm512_setzero_si512());
Expand All @@ -181,8 +181,8 @@ mod tests {
0,
1,
1,
std::i32::MAX,
std::i32::MAX.wrapping_add(1),
i32::MAX,
i32::MAX.wrapping_add(1),
100,
100,
32,
Expand Down

0 comments on commit 1a577bd

Please sign in to comment.