mirror of
https://github.com/google/brotli.git
synced 2024-11-22 03:30:07 +00:00
decode: fix NEON inclusion (#714)
The macro that checks for NEON support should be __ARM_NEON, not __ARM_NEON__. [1] AArch64 compilers define __ARM_NEON but not __ARM_NEON__. AArch32 compilers currently seem to define both, but could be within their rights to drop __ARM_NEON__ in future versions. This change moves the check into the common/platform.h file, checks for both forms, and sets BROTLI_TARGET_NEON if NEON support is available. [1] Section 6.5.4 of the ARM C Language Extensions. (At the time of writing, the latest version was Release 2.1.)
This commit is contained in:
parent
c94c6f805c
commit
cc7a74f15f
@ -203,6 +203,10 @@ OR:
|
||||
|
||||
#endif /* ARMv8 */
|
||||
|
||||
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
#define BROTLI_TARGET_NEON
|
||||
#endif
|
||||
|
||||
#if defined(__i386) || defined(_M_IX86)
|
||||
#define BROTLI_TARGET_X86
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <brotli/decode.h>
|
||||
|
||||
#if defined(__ARM_NEON__)
|
||||
#if defined(BROTLI_TARGET_NEON)
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
@ -167,7 +167,7 @@ static BrotliDecoderErrorCode DecodeWindowBits(BrotliDecoderState* s,
|
||||
}
|
||||
|
||||
static BROTLI_INLINE void memmove16(uint8_t* dst, uint8_t* src) {
|
||||
#if defined(__ARM_NEON__)
|
||||
#if defined(BROTLI_TARGET_NEON)
|
||||
vst1q_u8(dst, vld1q_u8(src));
|
||||
#else
|
||||
uint32_t buffer[4];
|
||||
|
Loading…
Reference in New Issue
Block a user