From 24a99042591293a23ee26ead0f2130bc88f08139 Mon Sep 17 00:00:00 2001 From: gilzoide Date: Tue, 27 Feb 2024 09:20:22 -0300 Subject: [PATCH 1/2] Fix use arm neon instructions if targeting 32-bit arm architectures only This fixes compilation for arm64 platforms, like Apple Silicon, because the assembly code contained in `pixman-arm-neon-asm.S` is armv7 assembly, which is not supported by arm64 compilers. --- src/lottie/lottieanimation.cpp | 2 +- src/vector/vdrawhelper.cpp | 2 +- src/vector/vdrawhelper_common.cpp | 2 +- src/vector/vdrawhelper_neon.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index afcc400b..d66b9c39 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -483,7 +483,7 @@ void lottie_shutdown_impl() #ifdef LOTTIE_LOGGING_SUPPORT void initLogging() { -#if defined(__ARM_NEON__) +#if defined(__ARM_NEON__) && defined(__arm__) set_log_level(LogLevel::OFF); #else initialize(GuaranteedLogger(), "/tmp/", "rlottie", 1); diff --git a/src/vector/vdrawhelper.cpp b/src/vector/vdrawhelper.cpp index 41593c86..3f9f1f54 100644 --- a/src/vector/vdrawhelper.cpp +++ b/src/vector/vdrawhelper.cpp @@ -754,7 +754,7 @@ void VSpanData::updateSpanFunc() } } -#if !defined(__SSE2__) && !defined(__ARM_NEON__) +#if !defined(__SSE2__) && !(defined(__ARM_NEON__) && defined(__arm__)) void memfill32(uint32_t *dest, uint32_t value, int length) { // let compiler do the auto vectorization. diff --git a/src/vector/vdrawhelper_common.cpp b/src/vector/vdrawhelper_common.cpp index 8a91b0f3..23f46033 100644 --- a/src/vector/vdrawhelper_common.cpp +++ b/src/vector/vdrawhelper_common.cpp @@ -180,7 +180,7 @@ RenderFuncTable::RenderFuncTable() updateSrc(BlendMode::DestIn, src_DestinationIn); updateSrc(BlendMode::DestOut, src_DestinationOut); -#if defined(__ARM_NEON__) +#if defined(__ARM_NEON__) && defined(__arm__) neon(); #endif #if defined(__SSE2__) diff --git a/src/vector/vdrawhelper_neon.cpp b/src/vector/vdrawhelper_neon.cpp index 681eabbc..684e82b3 100644 --- a/src/vector/vdrawhelper_neon.cpp +++ b/src/vector/vdrawhelper_neon.cpp @@ -1,4 +1,4 @@ -#if defined(__ARM_NEON__) +#if defined(__ARM_NEON__) && defined(__arm__) #include "vdrawhelper.h" From 7b5afff667a6ae850e4b037f55b39e4b5a11c217 Mon Sep 17 00:00:00 2001 From: gilzoide Date: Sat, 7 Sep 2024 09:07:21 -0300 Subject: [PATCH 2/2] Fix don't include pixman arm neon code when compiling with clang Newer versions of the Android NDK use clang for compiling, which cannot compile the code contained in `pixman-arm-neon-asm.S`. --- src/lottie/lottieanimation.cpp | 2 +- src/vector/vdrawhelper.cpp | 2 +- src/vector/vdrawhelper_common.cpp | 2 +- src/vector/vdrawhelper_neon.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index d66b9c39..ca8fb653 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -483,7 +483,7 @@ void lottie_shutdown_impl() #ifdef LOTTIE_LOGGING_SUPPORT void initLogging() { -#if defined(__ARM_NEON__) && defined(__arm__) +#if defined(__ARM_NEON__) && defined(__arm__) && !defined(__clang__) set_log_level(LogLevel::OFF); #else initialize(GuaranteedLogger(), "/tmp/", "rlottie", 1); diff --git a/src/vector/vdrawhelper.cpp b/src/vector/vdrawhelper.cpp index 3f9f1f54..2595f934 100644 --- a/src/vector/vdrawhelper.cpp +++ b/src/vector/vdrawhelper.cpp @@ -754,7 +754,7 @@ void VSpanData::updateSpanFunc() } } -#if !defined(__SSE2__) && !(defined(__ARM_NEON__) && defined(__arm__)) +#if !defined(__SSE2__) && !(defined(__ARM_NEON__) && defined(__arm__) && !defined(__clang__)) void memfill32(uint32_t *dest, uint32_t value, int length) { // let compiler do the auto vectorization. diff --git a/src/vector/vdrawhelper_common.cpp b/src/vector/vdrawhelper_common.cpp index 23f46033..66579484 100644 --- a/src/vector/vdrawhelper_common.cpp +++ b/src/vector/vdrawhelper_common.cpp @@ -180,7 +180,7 @@ RenderFuncTable::RenderFuncTable() updateSrc(BlendMode::DestIn, src_DestinationIn); updateSrc(BlendMode::DestOut, src_DestinationOut); -#if defined(__ARM_NEON__) && defined(__arm__) +#if defined(__ARM_NEON__) && defined(__arm__) && !defined(__clang__) neon(); #endif #if defined(__SSE2__) diff --git a/src/vector/vdrawhelper_neon.cpp b/src/vector/vdrawhelper_neon.cpp index 684e82b3..844723c8 100644 --- a/src/vector/vdrawhelper_neon.cpp +++ b/src/vector/vdrawhelper_neon.cpp @@ -1,4 +1,4 @@ -#if defined(__ARM_NEON__) && defined(__arm__) +#if defined(__ARM_NEON__) && defined(__arm__) && !defined(__clang__) #include "vdrawhelper.h"