Removed the SDL_ALTIVEC_BLIT_FEATURES environment variable.

This code has long since been tested, and none of the developers have an Altivec CPU.
This commit is contained in:
Sam Lantinga
2024-08-03 11:02:29 -07:00
parent 95adcc522f
commit f370e1a645

View File

@@ -36,14 +36,11 @@
/* Functions to blit from N-bit surfaces to other surfaces */ /* Functions to blit from N-bit surfaces to other surfaces */
enum blit_features #define BLIT_FEATURE_NONE 0x00
{ #define BLIT_FEATURE_HAS_MMX 0x01
BLIT_FEATURE_NONE = 0, #define BLIT_FEATURE_HAS_ALTIVEC 0x02
BLIT_FEATURE_HAS_MMX = 1, #define BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH 0x04
BLIT_FEATURE_HAS_ALTIVEC = 2, #define BLIT_FEATURE_HAS_ARM_SIMD 0x08
BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH = 4,
BLIT_FEATURE_HAS_ARM_SIMD = 8
};
#ifdef SDL_ALTIVEC_BLITTERS #ifdef SDL_ALTIVEC_BLITTERS
#ifdef SDL_PLATFORM_MACOS #ifdef SDL_PLATFORM_MACOS
@@ -873,26 +870,18 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info)
vec_dss(DST_CHAN_DEST); vec_dss(DST_CHAN_DEST);
} }
static enum blit_features GetBlitFeatures(void) static Uint32 GetBlitFeatures(void)
{ {
static enum blit_features features = -1; static Uint32 features = ~0u;
if (features == (enum blit_features) - 1) { if (features == ~0u) {
/* Provide an override for testing .. */ features = (0
const char *override = SDL_getenv("SDL_ALTIVEC_BLIT_FEATURES"); /* Feature 1 is has-MMX */
if (override) { | ((SDL_HasMMX()) ? BLIT_FEATURE_HAS_MMX : 0)
unsigned int features_as_uint = 0; /* Feature 2 is has-AltiVec */
SDL_sscanf(override, "%u", &features_as_uint); | ((SDL_HasAltiVec()) ? BLIT_FEATURE_HAS_ALTIVEC : 0)
features = (enum blit_features)features_as_uint; /* Feature 4 is dont-use-prefetch */
} else { /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
features = (0 | ((GetL3CacheSize() == 0) ? BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH : 0));
/* Feature 1 is has-MMX */
| ((SDL_HasMMX()) ? BLIT_FEATURE_HAS_MMX : 0)
/* Feature 2 is has-AltiVec */
| ((SDL_HasAltiVec()) ? BLIT_FEATURE_HAS_ALTIVEC : 0)
/* Feature 4 is dont-use-prefetch */
/* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
| ((GetL3CacheSize() == 0) ? BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH : 0));
}
} }
return features; return features;
} }