Android: Enable armeabi-v7a builds

This commit is contained in:
Connor McLaughlin 2020-11-21 22:44:35 +10:00
parent 497759b4d6
commit a6529a9537
3 changed files with 15 additions and 4 deletions

View File

@ -196,6 +196,15 @@ elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CPU_ARCH "aarch64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7-a" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
set(CPU_ARCH "aarch32")
if(ANDROID)
# Force ARM mode, since apparently ANDROID_ARM_MODE isn't working..
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -marm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -marm")
else()
# Enable NEON.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -marm -march=armv7-a+simd -mfpu=neon-vfpv3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -marm -march=armv7-a+simd -mfpu=neon-vfpv3")
endif()
else()
message(FATAL_ERROR "Unknown system processor: " ${CMAKE_SYSTEM_PROCESSOR})
endif()

View File

@ -30,8 +30,8 @@ android {
defaultConfig {
externalNativeBuild {
cmake {
arguments "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
abiFilters "arm64-v8a"
arguments "-DCMAKE_BUILD_TYPE=Release -DANDROID_ARM_NEON=ON"
abiFilters "arm64-v8a", "armeabi-v7a"
}
}
}

View File

@ -11,6 +11,8 @@ Log_SetChannel(GPU_SW);
#if defined(CPU_X64)
#include <emmintrin.h>
#elif defined(CPU_AARCH32)
#include <arm_neon.h>
#elif defined(CPU_AARCH64)
#ifdef _MSC_VER
#include <arm64_neon.h>
@ -155,7 +157,7 @@ ALWAYS_INLINE void CopyOutRow16<HostDisplayPixelFormat::RGBA5551, u16>(const u16
_mm_storeu_si128(reinterpret_cast<__m128i*>(dst_ptr), value);
dst_ptr += 8;
}
#elif defined(CPU_AARCH64)
#elif defined(CPU_AARCH32) || defined(CPU_AARCH64)
const u32 aligned_width = Common::AlignDownPow2(width, 8);
for (; col < aligned_width; col += 8)
{
@ -195,7 +197,7 @@ ALWAYS_INLINE void CopyOutRow16<HostDisplayPixelFormat::RGB565, u16>(const u16*
_mm_storeu_si128(reinterpret_cast<__m128i*>(dst_ptr), value);
dst_ptr += 8;
}
#elif defined(CPU_AARCH64)
#elif defined(CPU_AARCH32) || defined(CPU_AARCH64)
const u32 aligned_width = Common::AlignDownPow2(width, 8);
const uint16x8_t single_mask = vdupq_n_u16(0x1F);
for (; col < aligned_width; col += 8)