diff options
author | Timothy Arceri <[email protected]> | 2014-06-04 02:57:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-06-06 07:15:00 -0700 |
commit | fc0be88c0f8d3d8887edd2afac915840f4e3f5e4 (patch) | |
tree | dbe626f58eff02c0b34ddaa7ec09fa3de4c10f35 /Alc/helpers.c | |
parent | 3b2fcb3ef6f00d026f06ca154060b29ded3eb3fc (diff) |
Add SSE2 and SSE4.1 linear resamplers
Currently the only way SSE 4.1 is detected is by using __get_cpuid, i.e. with
GCC. Windows' IsProcessorFeaturePresent does not report SSE4.1 capabilities.
Diffstat (limited to 'Alc/helpers.c')
-rw-r--r-- | Alc/helpers.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c index a0230b7c..ff28bf0d 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -139,7 +139,11 @@ void FillCPUCaps(ALuint capfilter) { caps |= CPU_CAP_SSE; if((cpuinf[0].regs[3]&(1<<26))) + { caps |= CPU_CAP_SSE2; + if((cpuinf[0].regs[2]&(1<<19))) + caps |= CPU_CAP_SSE4_1; + } } } } @@ -164,10 +168,13 @@ void FillCPUCaps(ALuint capfilter) caps |= CPU_CAP_NEON; #endif - TRACE("Got caps:%s%s%s%s\n", ((caps&CPU_CAP_SSE)?((capfilter&CPU_CAP_SSE)?" SSE":" (SSE)"):""), - ((caps&CPU_CAP_SSE2)?((capfilter&CPU_CAP_SSE2)?" SSE2":" (SSE2)"):""), - ((caps&CPU_CAP_NEON)?((capfilter&CPU_CAP_NEON)?" Neon":" (Neon)"):""), - ((!caps)?" -none-":"")); + TRACE("Got caps:%s%s%s%s%s\n", + ((caps&CPU_CAP_SSE) ? ((capfilter&CPU_CAP_SSE) ? " SSE" : " (SSE)") : ""), + ((caps&CPU_CAP_SSE2) ? ((capfilter&CPU_CAP_SSE2) ? " SSE2" : " (SSE2)") : ""), + ((caps&CPU_CAP_SSE4_1) ? ((capfilter&CPU_CAP_SSE4_1) ? " SSE4.1" : " (SSE4.1)") : ""), + ((caps&CPU_CAP_NEON) ? ((capfilter&CPU_CAP_NEON) ? " Neon" : " (Neon)") : ""), + ((!caps) ? " -none-" : "") + ); CPUCapFlags = caps & capfilter; } |