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