Skip to content

Commit d83dcc3

Browse files
committed
fmtting and fixing some clippy issues
1 parent 27cd5be commit d83dcc3

File tree

29 files changed

+1293
-692
lines changed

29 files changed

+1293
-692
lines changed

coresimd/src/runtime/cache.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
//! Cache of run-time feature detection
22
33
use core::sync::atomic::{AtomicUsize, Ordering};
4-
use core::usize;
54

65
use super::bit;
76

87
/// This global variable is a bitset used to cache the features supported by
98
/// the
109
/// CPU.
11-
static CACHE: AtomicUsize = AtomicUsize::new(usize::MAX);
10+
static CACHE: AtomicUsize = AtomicUsize::new(usize::max_value());
1211

1312
/// Test the `bit` of the storage. If the storage has not been initialized,
1413
/// initializes it with the result of `f()`.
@@ -24,7 +23,7 @@ pub fn test<F>(bit: u32, f: F) -> bool
2423
where
2524
F: FnOnce() -> usize,
2625
{
27-
if CACHE.load(Ordering::Relaxed) == usize::MAX {
26+
if CACHE.load(Ordering::Relaxed) == usize::max_value() {
2827
CACHE.store(f(), Ordering::Relaxed);
2928
}
3029
bit::test(CACHE.load(Ordering::Relaxed), bit)

coresimd/src/runtime/x86.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ pub enum __Feature {
237237
xsaves,
238238
/// XSAVEC (Save Processor Extended States Compacted)
239239
xsavec,
240-
#[doc(hidden)] __NonExhaustive,
240+
#[doc(hidden)]
241+
__NonExhaustive,
241242
}
242243

243244
/// Run-time feature detection on x86 works by using the CPUID instruction.

coresimd/src/v128.rs

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -42,86 +42,14 @@ define_impl! {
4242
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15
4343
}
4444

45-
define_from!(
46-
u64x2,
47-
i64x2,
48-
u32x4,
49-
i32x4,
50-
u16x8,
51-
i16x8,
52-
u8x16,
53-
i8x16
54-
);
55-
define_from!(
56-
i64x2,
57-
u64x2,
58-
u32x4,
59-
i32x4,
60-
u16x8,
61-
i16x8,
62-
u8x16,
63-
i8x16
64-
);
65-
define_from!(
66-
u32x4,
67-
u64x2,
68-
i64x2,
69-
i32x4,
70-
u16x8,
71-
i16x8,
72-
u8x16,
73-
i8x16
74-
);
75-
define_from!(
76-
i32x4,
77-
u64x2,
78-
i64x2,
79-
u32x4,
80-
u16x8,
81-
i16x8,
82-
u8x16,
83-
i8x16
84-
);
85-
define_from!(
86-
u16x8,
87-
u64x2,
88-
i64x2,
89-
u32x4,
90-
i32x4,
91-
i16x8,
92-
u8x16,
93-
i8x16
94-
);
95-
define_from!(
96-
i16x8,
97-
u64x2,
98-
i64x2,
99-
u32x4,
100-
i32x4,
101-
u16x8,
102-
u8x16,
103-
i8x16
104-
);
105-
define_from!(
106-
u8x16,
107-
u64x2,
108-
i64x2,
109-
u32x4,
110-
i32x4,
111-
u16x8,
112-
i16x8,
113-
i8x16
114-
);
115-
define_from!(
116-
i8x16,
117-
u64x2,
118-
i64x2,
119-
u32x4,
120-
i32x4,
121-
u16x8,
122-
i16x8,
123-
u8x16
124-
);
45+
define_from!(u64x2, i64x2, u32x4, i32x4, u16x8, i16x8, u8x16, i8x16);
46+
define_from!(i64x2, u64x2, u32x4, i32x4, u16x8, i16x8, u8x16, i8x16);
47+
define_from!(u32x4, u64x2, i64x2, i32x4, u16x8, i16x8, u8x16, i8x16);
48+
define_from!(i32x4, u64x2, i64x2, u32x4, u16x8, i16x8, u8x16, i8x16);
49+
define_from!(u16x8, u64x2, i64x2, u32x4, i32x4, i16x8, u8x16, i8x16);
50+
define_from!(i16x8, u64x2, i64x2, u32x4, i32x4, u16x8, u8x16, i8x16);
51+
define_from!(u8x16, u64x2, i64x2, u32x4, i32x4, u16x8, i16x8, i8x16);
52+
define_from!(i8x16, u64x2, i64x2, u32x4, i32x4, u16x8, i16x8, u8x16);
12553

12654
define_common_ops!(
12755
f64x2,

coresimd/src/v256.rs

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -66,86 +66,14 @@ define_impl! {
6666
x24, x25, x26, x27, x28, x29, x30, x31
6767
}
6868

69-
define_from!(
70-
u64x4,
71-
i64x4,
72-
u32x8,
73-
i32x8,
74-
u16x16,
75-
i16x16,
76-
u8x32,
77-
i8x32
78-
);
79-
define_from!(
80-
i64x4,
81-
u64x4,
82-
u32x8,
83-
i32x8,
84-
u16x16,
85-
i16x16,
86-
u8x32,
87-
i8x32
88-
);
89-
define_from!(
90-
u32x8,
91-
u64x4,
92-
i64x4,
93-
i32x8,
94-
u16x16,
95-
i16x16,
96-
u8x32,
97-
i8x32
98-
);
99-
define_from!(
100-
i32x8,
101-
u64x4,
102-
i64x4,
103-
u32x8,
104-
u16x16,
105-
i16x16,
106-
u8x32,
107-
i8x32
108-
);
109-
define_from!(
110-
u16x16,
111-
u64x4,
112-
i64x4,
113-
u32x8,
114-
i32x8,
115-
i16x16,
116-
u8x32,
117-
i8x32
118-
);
119-
define_from!(
120-
i16x16,
121-
u64x4,
122-
i64x4,
123-
u32x8,
124-
i32x8,
125-
u16x16,
126-
u8x32,
127-
i8x32
128-
);
129-
define_from!(
130-
u8x32,
131-
u64x4,
132-
i64x4,
133-
u32x8,
134-
i32x8,
135-
u16x16,
136-
i16x16,
137-
i8x32
138-
);
139-
define_from!(
140-
i8x32,
141-
u64x4,
142-
i64x4,
143-
u32x8,
144-
i32x8,
145-
u16x16,
146-
i16x16,
147-
u8x32
148-
);
69+
define_from!(u64x4, i64x4, u32x8, i32x8, u16x16, i16x16, u8x32, i8x32);
70+
define_from!(i64x4, u64x4, u32x8, i32x8, u16x16, i16x16, u8x32, i8x32);
71+
define_from!(u32x8, u64x4, i64x4, i32x8, u16x16, i16x16, u8x32, i8x32);
72+
define_from!(i32x8, u64x4, i64x4, u32x8, u16x16, i16x16, u8x32, i8x32);
73+
define_from!(u16x16, u64x4, i64x4, u32x8, i32x8, i16x16, u8x32, i8x32);
74+
define_from!(i16x16, u64x4, i64x4, u32x8, i32x8, u16x16, u8x32, i8x32);
75+
define_from!(u8x32, u64x4, i64x4, u32x8, i32x8, u16x16, i16x16, i8x32);
76+
define_from!(i8x32, u64x4, i64x4, u32x8, i32x8, u16x16, i16x16, u8x32);
14977

15078
define_common_ops!(
15179
f64x4,

coresimd/src/x86/i386/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
mod eflags;
44
pub use self::eflags::*;
55

6-
76
#[cfg(dont_compile_me)] // TODO: need to upstream `fxsr` target feature
87
mod fxsr;
98
#[cfg(dont_compile_me)] // TODO: need to upstream `fxsr` target feature

0 commit comments

Comments
 (0)