From b8ca9108acddfb9fb5d886f5e8a072ebaf436dbb Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Wed, 12 Oct 2022 12:42:09 +0300 Subject: arm: Add a compile-time assertion about PNG_ARM_NEON_CHECK_SUPPORTED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following up on the previous commit by Martin Storsjö: If the availability of ARM Neon is not only known at compile time, but also expected by the compiler's target architecture, there should be no further need for a run-time check. In fact, such a check would be counter-productive. --- arm/arm_init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arm/arm_init.c b/arm/arm_init.c index ab22525b3..84d05556f 100644 --- a/arm/arm_init.c +++ b/arm/arm_init.c @@ -36,7 +36,10 @@ #ifndef PNG_ARM_NEON_FILE # if defined(__aarch64__) || defined(_M_ARM64) /* ARM Neon is expected to be unconditionally available on ARM64. */ -# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this platform" +# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64" +# elif defined(__ARM_NEON__) || defined(__ARM_NEON) + /* ARM Neon is expected to be available on the target CPU architecture. */ +# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch" # elif defined(__linux__) # define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c" # else -- cgit v1.2.1