sdl/cpuinfo: Add HasAVX2() for SDL2 2.0.4
@@ -19,6 +19,14 @@ static inline SDL_bool SDL_HasAVX()
}
#endif
+#if !(SDL_VERSION_ATLEAST(2,0,4))
+#pragma message("SDL_HasAVX2 is not supported before SDL 2.0.4")
+static inline SDL_bool SDL_HasAVX2()
+{
+ return SDL_FALSE;
+}
+#endif
+
*/
import "C"
@@ -102,3 +110,9 @@ func GetSystemRAM() int {
func HasAVX() bool {
return C.SDL_HasAVX() > 0
}
+
+// HasAVX2 reports whether the CPU has AVX2 features.
+// (https://wiki.libsdl.org/SDL_HasAVX2)
+func HasAVX2() bool {
+ return C.SDL_HasAVX2() > 0
+}
