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
use crate::sys;
use crate::sys::SDL_bool;

pub const CACHELINESIZE: u8 = 128;

pub fn cpu_count() -> i32 {
    unsafe { sys::SDL_GetCPUCount() }
}

pub fn cpu_cache_line_size() -> i32 {
    unsafe { sys::SDL_GetCPUCacheLineSize() }
}

pub fn has_rdtsc() -> bool {
    unsafe { sys::SDL_HasRDTSC() == SDL_bool::SDL_TRUE }
}

pub fn has_alti_vec() -> bool {
    unsafe { sys::SDL_HasAltiVec() == SDL_bool::SDL_TRUE }
}

pub fn has_mmx() -> bool {
    unsafe { sys::SDL_HasMMX() == SDL_bool::SDL_TRUE }
}

pub fn has_3d_now() -> bool {
    unsafe { sys::SDL_Has3DNow() == SDL_bool::SDL_TRUE }
}

pub fn has_sse() -> bool {
    unsafe { sys::SDL_HasSSE() == SDL_bool::SDL_TRUE }
}

pub fn has_sse2() -> bool {
    unsafe { sys::SDL_HasSSE2() == SDL_bool::SDL_TRUE }
}

pub fn has_sse3() -> bool {
    unsafe { sys::SDL_HasSSE3() == SDL_bool::SDL_TRUE }
}

pub fn has_sse41() -> bool {
    unsafe { sys::SDL_HasSSE41() == SDL_bool::SDL_TRUE }
}

pub fn has_sse42() -> bool {
    unsafe { sys::SDL_HasSSE42() == SDL_bool::SDL_TRUE }
}

pub fn has_avx() -> bool {
    unsafe { sys::SDL_HasAVX() == SDL_bool::SDL_TRUE }
}

pub fn has_avx2() -> bool {
    unsafe { sys::SDL_HasAVX2() == SDL_bool::SDL_TRUE }
}

pub fn has_avx512f() -> bool {
    unsafe { sys::SDL_HasAVX512F() == SDL_bool::SDL_TRUE }
}

pub fn system_ram() -> i32 {
    unsafe { sys::SDL_GetSystemRAM() }
}