mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:08:51 +02:00
Disabled AVX support on Mac. XCode is still missing __builtin_cpu_supports (added to Clang in Jul 2015?)
This commit is contained in:
parent
3d684dd0e7
commit
e2066c7719
1 changed files with 26 additions and 26 deletions
|
@ -141,41 +141,41 @@ static bool cpuSupportsAVX() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cpuSupportsAVX2() {
|
//static bool cpuSupportsAVX2() {
|
||||||
int info[4];
|
// int info[4];
|
||||||
int mask = (1 << 5); // AVX2
|
// int mask = (1 << 5); // AVX2
|
||||||
|
//
|
||||||
|
// bool result = false;
|
||||||
|
// if (cpuSupportsAVX()) {
|
||||||
|
//
|
||||||
|
// __cpuidex(info, 0x7, 0);
|
||||||
|
//
|
||||||
|
// if ((info[1] & mask) == mask) {
|
||||||
|
// result = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return result;
|
||||||
|
//}
|
||||||
|
|
||||||
bool result = false;
|
#elif defined(__GNU__)
|
||||||
if (cpuSupportsAVX()) {
|
|
||||||
|
|
||||||
__cpuidex(info, 0x7, 0);
|
|
||||||
|
|
||||||
if ((info[1] & mask) == mask) {
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(__GNU__) || defined(__clang__)
|
|
||||||
|
|
||||||
static bool cpuSupportsAVX() {
|
static bool cpuSupportsAVX() {
|
||||||
return __builtin_cpu_supports("avx");
|
return __builtin_cpu_supports("avx");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cpuSupportsAVX2() {
|
//static bool cpuSupportsAVX2() {
|
||||||
return __builtin_cpu_supports("avx2");
|
// return __builtin_cpu_supports("avx2");
|
||||||
}
|
//}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static bool cpuSupportsAVX() {
|
static bool cpuSupportsAVX() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cpuSupportsAVX2() {
|
//static bool cpuSupportsAVX2() {
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -188,8 +188,8 @@ FIR_1x4_t FIR_1x4_AVX; // separate compilation with VEX-encoding enabled
|
||||||
|
|
||||||
static void FIR_1x4(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames) {
|
static void FIR_1x4(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames) {
|
||||||
|
|
||||||
static FIR_1x4_t* f = cpuSupportsAVX() ? FIR_1x4_AVX : FIR_1x4_SSE; // init on first call
|
static FIR_1x4_t* f = cpuSupportsAVX() ? FIR_1x4_AVX : FIR_1x4_SSE; // init on first call
|
||||||
(*f)(src, dst0, dst1, dst2, dst3, coef, numFrames); // dispatch
|
(*f)(src, dst0, dst1, dst2, dst3, coef, numFrames); // dispatch
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4 channel planar to interleaved
|
// 4 channel planar to interleaved
|
||||||
|
|
Loading…
Reference in a new issue