mirror of
https://github.com/nothings/stb
synced 2024-12-15 04:22:35 +03:00
stb_image: First-pass stbi__sse2_available for GCC
This commit is contained in:
parent
aabf2c5c49
commit
c625d24197
12
stb_image.h
12
stb_image.h
@ -419,6 +419,18 @@ static int stbi__sse2_available()
|
||||
|
||||
#ifndef STBI_SIMD_ALIGN
|
||||
#define STBI_SIMD_ALIGN(type, name) type name
|
||||
|
||||
static int stbi__sse2_available()
|
||||
{
|
||||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
|
||||
// GCC 4.8+ has a nice way to do this
|
||||
return __builtin_cpu_supports("sse2");
|
||||
#else
|
||||
// portable way to do this, preferably without using GCC inline ASM?
|
||||
// just bail for now.
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user