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 }
}
}