Reorg AltiVec detection code
+ advertise that full AltiVec SIMD acceleration is now available on OpenBSD. The relevant compilers probably all support C99 or GNU's variation of C90 that allows variables to be declared anywhere, but our policy is to conform to the C90 standard, if for no other reason than that it improves code readability.
This commit is contained in:
@@ -13,8 +13,8 @@ code in libjpeg-turbo from building.
|
||||
version of TJBench from outputting any reference images (the `-nowrite` switch
|
||||
was accidentally enabled by default.)
|
||||
|
||||
4. libjpeg-turbo should now build and run on AmigaOS 4 (with full AltiVec
|
||||
SIMD acceleration.)
|
||||
4. libjpeg-turbo should now build and run with full AltiVec SIMD acceleration
|
||||
on PowerPC-based AmigaOS 4 and OpenBSD systems.
|
||||
|
||||
|
||||
1.5.1
|
||||
|
||||
@@ -112,6 +112,12 @@ init_simd (void)
|
||||
char *env = NULL;
|
||||
#if !defined(__ALTIVEC__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
|
||||
int bufsize = 1024; /* an initial guess for the line buffer size limit */
|
||||
#elif defined(__amigaos4__)
|
||||
uint32 altivec = 0;
|
||||
#elif defined(__OpenBSD__)
|
||||
int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
|
||||
int altivec;
|
||||
size_t len = sizeof(altivec);
|
||||
#endif
|
||||
|
||||
if (simd_support != ~0U)
|
||||
@@ -128,14 +134,10 @@ init_simd (void)
|
||||
break;
|
||||
}
|
||||
#elif defined(__amigaos4__)
|
||||
uint32 altivec = 0;
|
||||
IExec->GetCPUInfoTags(GCIT_VectorUnit, &altivec, TAG_DONE);
|
||||
if(altivec == VECTORTYPE_ALTIVEC)
|
||||
simd_support |= JSIMD_ALTIVEC;
|
||||
#elif defined(__OpenBSD__)
|
||||
int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
|
||||
int altivec;
|
||||
size_t len = sizeof(altivec);
|
||||
if (sysctl(mib, 2, &altivec, &len, NULL, 0) == 0 && altivec != 0)
|
||||
simd_support |= JSIMD_ALTIVEC;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user