aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/sdl_cpu_info.c
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-12-25 17:51:20 +0100
committerLoïc Hoguin <[email protected]>2017-12-25 17:51:20 +0100
commit1284144bc49474dc2377047cdd99502247dbded2 (patch)
tree92fe89a878e9021464c64d0603e41ff1efa2fd66 /c_src/sdl_cpu_info.c
parent371bc5f677b3c763407fc79f01cb9d0c598199cc (diff)
downloadesdl2-1284144bc49474dc2377047cdd99502247dbded2.tar.gz
esdl2-1284144bc49474dc2377047cdd99502247dbded2.tar.bz2
esdl2-1284144bc49474dc2377047cdd99502247dbded2.zip
Add the new sdl_cpuinfo.h functions
Diffstat (limited to 'c_src/sdl_cpu_info.c')
-rw-r--r--c_src/sdl_cpu_info.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/c_src/sdl_cpu_info.c b/c_src/sdl_cpu_info.c
index 6285cfe..c616891 100644
--- a/c_src/sdl_cpu_info.c
+++ b/c_src/sdl_cpu_info.c
@@ -45,6 +45,16 @@ NIF_FUNCTION(has_3dnow)
return atom_false;
}
+// has_altivec
+
+NIF_FUNCTION(has_altivec)
+{
+ if (SDL_HasAltiVec())
+ return atom_true;
+
+ return atom_false;
+}
+
// has_avx
NIF_FUNCTION(has_avx)
@@ -55,11 +65,11 @@ NIF_FUNCTION(has_avx)
return atom_false;
}
-// has_altivec
+// has_avx2
-NIF_FUNCTION(has_altivec)
+NIF_FUNCTION(has_avx2)
{
- if (SDL_HasAltiVec())
+ if (SDL_HasAVX2())
return atom_true;
return atom_false;
@@ -75,6 +85,16 @@ NIF_FUNCTION(has_mmx)
return atom_false;
}
+// has_neon
+
+NIF_FUNCTION(has_neon)
+{
+ if (SDL_HasNEON())
+ return atom_true;
+
+ return atom_false;
+}
+
// has_rdtsc
NIF_FUNCTION(has_rdtsc)