Only set JSIMD_FORCENONE if it is not already set

This commit is contained in:
Chris Young 2016-07-09 23:17:09 +01:00
parent 794f12e4b5
commit d0a1ee7ac0

View File

@ -5548,13 +5548,23 @@ int main(int argc, char** argv)
#ifdef __amigaos4__ #ifdef __amigaos4__
/* Check for AltiVec */ /* Check for AltiVec */
uint32 altivec = 0; uint32 altivec = 0;
GetCPUInfoTags(GCIT_VectorUnit, &altivec); GetCPUInfoTags(GCIT_VectorUnit, &altivec);
if(altivec == VECTORTYPE_ALTIVEC) { if(altivec == VECTORTYPE_ALTIVEC) {
LOG("AltiVec detected"); LOG("AltiVec detected");
} else { } else {
char jsimd_forcenone[10];
LOG("AltiVec NOT detected"); LOG("AltiVec NOT detected");
SetVar("JSIMD_FORCENONE", "1", 1, GVF_GLOBAL_ONLY | GVF_SAVE_VAR); int32 len = GetVar("JSIMD_FORCENONE", jsimd_forcenone, 10, GVF_GLOBAL_ONLY);
if(len == -1) {
LOG("WARNING: JSIMD_FORCENONE NOT SET");
SetVar("JSIMD_FORCENONE", "1", 1, GVF_GLOBAL_ONLY | GVF_SAVE_VAR);
} else {
LOG("JSIMDFORCENONE = %s (NB: Should be '1' for this architecture)", jsimd_forcenone);
}
} }
#endif #endif