From 02ca04c348e0ebd5fc1871997d458691149e259c Mon Sep 17 00:00:00 2001 From: "jzern@google.com" Date: Mon, 13 Dec 2021 16:39:23 -0800 Subject: [PATCH] add missing USE_{MSA,NEON} checks in headers msa_macro.h neon.h allows the headers to be built / analyzed under different target configurations Change-Id: Ibbcfada210b54988aa5279674d53af8e21fd4a97 --- src/dsp/msa_macro.h | 5 +++++ src/dsp/neon.h | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dsp/msa_macro.h b/src/dsp/msa_macro.h index de026a1d..51f6c643 100644 --- a/src/dsp/msa_macro.h +++ b/src/dsp/msa_macro.h @@ -14,6 +14,10 @@ #ifndef WEBP_DSP_MSA_MACRO_H_ #define WEBP_DSP_MSA_MACRO_H_ +#include "src/dsp/dsp.h" + +#if defined(WEBP_USE_MSA) + #include #include @@ -1389,4 +1393,5 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { } while (0) #define AVER_UB2_UB(...) AVER_UB2(v16u8, __VA_ARGS__) +#endif // WEBP_USE_MSA #endif // WEBP_DSP_MSA_MACRO_H_ diff --git a/src/dsp/neon.h b/src/dsp/neon.h index aa1dea13..c591f9b9 100644 --- a/src/dsp/neon.h +++ b/src/dsp/neon.h @@ -12,10 +12,12 @@ #ifndef WEBP_DSP_NEON_H_ #define WEBP_DSP_NEON_H_ -#include - #include "src/dsp/dsp.h" +#if defined(WEBP_USE_NEON) + +#include + // Right now, some intrinsics functions seem slower, so we disable them // everywhere except newer clang/gcc or aarch64 where the inline assembly is // incompatible. @@ -98,4 +100,5 @@ static WEBP_INLINE int32x4x4_t Transpose4x4_NEON(const int32x4x4_t rows) { } while (0) #endif +#endif // WEBP_USE_NEON #endif // WEBP_DSP_NEON_H_