1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
use crate::bind;
#[must_use]
pub fn ram_size() -> usize {
unsafe { bind::SDL_GetSystemRAM() as usize }
}
pub mod simd_alloc;
pub mod cpu {
use crate::bind;
#[must_use]
pub fn count() -> u32 {
unsafe { bind::SDL_GetCPUCount() as u32 }
}
#[must_use]
pub fn cache_line_size() -> usize {
unsafe { bind::SDL_GetCPUCacheLineSize() as usize }
}
#[must_use]
#[allow(clippy::unnecessary_cast)]
pub fn simd_alignment() -> usize {
unsafe { bind::SDL_SIMDGetAlignment() as usize }
}
#[must_use]
pub fn has_rdtsc() -> bool {
unsafe { bind::SDL_HasRDTSC() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_alti_vec() -> bool {
unsafe { bind::SDL_HasAltiVec() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_mmx() -> bool {
unsafe { bind::SDL_HasMMX() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_3d_now() -> bool {
unsafe { bind::SDL_Has3DNow() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_sse() -> bool {
unsafe { bind::SDL_HasSSE() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_sse2() -> bool {
unsafe { bind::SDL_HasSSE2() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_sse3() -> bool {
unsafe { bind::SDL_HasSSE3() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_sse41() -> bool {
unsafe { bind::SDL_HasSSE41() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_sse42() -> bool {
unsafe { bind::SDL_HasSSE42() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_avx() -> bool {
unsafe { bind::SDL_HasAVX() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_avx2() -> bool {
unsafe { bind::SDL_HasAVX2() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_avx512f() -> bool {
unsafe { bind::SDL_HasAVX512F() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_arm_simd() -> bool {
unsafe { bind::SDL_HasARMSIMD() == bind::SDL_TRUE }
}
#[must_use]
pub fn has_neon() -> bool {
unsafe { bind::SDL_HasNEON() == bind::SDL_TRUE }
}
}