diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_system.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/system.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_system.h b/source/blender/blenlib/BLI_system.h index f4c0399e959..19797ba23bc 100644 --- a/source/blender/blenlib/BLI_system.h +++ b/source/blender/blenlib/BLI_system.h @@ -24,6 +24,7 @@ */ int BLI_cpu_support_sse2(void); +int BLI_cpu_support_sse41(void); void BLI_system_backtrace(FILE *fp); /* Get CPU brand, result is to be MEM_freeN()-ed. */ diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c index 88f2e2625e8..941c2b608e6 100644 --- a/source/blender/blenlib/intern/system.c +++ b/source/blender/blenlib/intern/system.c @@ -179,6 +179,19 @@ char *BLI_cpu_brand_string(void) return NULL; } +int BLI_cpu_support_sse41(void) +{ + int result[4], num; + __cpuid(result, 0); + num = result[0]; + + if (num >= 1) { + __cpuid(result, 0x00000001); + return (result[2] & ((int)1 << 19)) != 0; + } + return 0; +} + void BLI_hostname_get(char *buffer, size_t bufsize) { #ifndef WIN32 |