From 59b5620bd5f8cd5cf3162870e542e828d2d20c25 Mon Sep 17 00:00:00 2001 From: "James J. Kelly Jr" Date: Mon, 21 Oct 2019 15:37:53 -0400 Subject: [PATCH] Added various CPU capability calls from SDL_cpuinfo.h --- src/SDL2.cs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index 24270b2..850fc25 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -7245,6 +7245,48 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetCPUCount(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_GetCPUCacheLineSize(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasRDTSC(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasAltiVec(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasMMX(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_Has3DNow(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasSSE(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasSSE2(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasSSE3(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasSSE41(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasSSE42(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasAVX(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasAVX2(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasAVX512F(); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_HasNEON(); /* Only available in 2.0.1 */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]