mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-21 08:16:46 +02:00
dsp/cpu: correct wasmCPUInfo placement
WASM needs to precede platform specific architecture checks as the defines will still be present when building this target. Change-Id: If25467ea286e582b928e26e716e41aff72898c50
This commit is contained in:
parent
4b21971337
commit
4026e34e3f
@ -22,12 +22,17 @@
|
|||||||
#include <cpu-features.h>
|
#include <cpu-features.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
// WASM needs to precede platform specific architecture checks as the defines
|
||||||
// SSE2 detection.
|
// will still be present when building this target.
|
||||||
//
|
#if defined(WEBP_USE_WASM)
|
||||||
|
static int wasmCPUInfo(CPUFeature feature) {
|
||||||
|
if (feature != kWASM) return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
VP8CPUInfo VP8GetCPUInfo = wasmCPUInfo;
|
||||||
|
|
||||||
// apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC.
|
// apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC.
|
||||||
#if (defined(__pic__) || defined(__PIC__)) && defined(__i386__)
|
#elif (defined(__pic__) || defined(__PIC__)) && defined(__i386__)
|
||||||
static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {
|
static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {
|
||||||
__asm__ volatile (
|
__asm__ volatile (
|
||||||
"mov %%ebx, %%edi\n"
|
"mov %%ebx, %%edi\n"
|
||||||
@ -217,12 +222,6 @@ static int mipsCPUInfo(CPUFeature feature) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
VP8CPUInfo VP8GetCPUInfo = mipsCPUInfo;
|
VP8CPUInfo VP8GetCPUInfo = mipsCPUInfo;
|
||||||
#elif defined(WEBP_USE_WASM)
|
|
||||||
static int wasmCPUInfo(CPUFeature feature) {
|
|
||||||
if (feature != kWASM) return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
VP8CPUInfo VP8GetCPUInfo = wasmCPUInfo;
|
|
||||||
#else
|
#else
|
||||||
VP8CPUInfo VP8GetCPUInfo = NULL;
|
VP8CPUInfo VP8GetCPUInfo = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user