mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
[cmake] CPUInstructionSetFlags.cmake: Set NEON_FLAGS to "-marm -mfpu=neon" on 32-bit ARM.
[librpbyteswap,librptexture] Apply NEON_FLAGS on 32-bit ARM. The Ubuntu 18.04 armhf build failed to compile: /<<PKGBUILDDIR>>/src/librpbyteswap/byteswap_neon.c: In function ‘rp_byte_swap_16_array_neon’: /usr/lib/gcc/arm-linux-gnueabihf/7/include/arm_neon.h:11880:1: error: inlining failed in call to always_inline ‘vst2q_u16’: target specific option mismatch vst2q_u16 (uint16_t * __a, uint16x8x2_t __b) ^~~~~~~~~ /<<PKGBUILDDIR>>/src/librpbyteswap/byteswap_neon.c:48:3: note: called from here vst2q_u16(ptr, vec); ^~~~~~~~~~~~~~~~~~~ It seems NEON is disabled by default on armhf. NOTE: Not rebuilding for armhf on Ubuntu 18.04.
This commit is contained in:
parent
db5e91906b
commit
66c43ccb4a
@ -116,4 +116,8 @@ IF(CPU_arm OR CPU_arm64 OR CPU_arm64ec)
|
||||
# NOTE: Should always be present for arm64, but check anyway.
|
||||
INCLUDE(CheckIncludeFile)
|
||||
CHECK_INCLUDE_FILE("arm_neon.h" HAVE_ARM_NEON_H)
|
||||
|
||||
IF(CPU_arm AND NOT MSVC)
|
||||
SET(NEON_FLAG "-marm -mfpu=neon")
|
||||
ENDIF(CPU_arm ANDNOT MSVC)
|
||||
ENDIF(CPU_arm OR CPU_arm64 OR CPU_arm64ec)
|
||||
|
@ -49,7 +49,14 @@ IF(CPU_i386 OR CPU_amd64)
|
||||
SET(${PROJECT_NAME}_CPU_SRCS ${${PROJECT_NAME}_MMX_SRCS} ${${PROJECT_NAME}_SSE2_SRCS} ${${PROJECT_NAME}_SSSE3_SRCS})
|
||||
ELSEIF(CPU_arm OR CPU_arm64)
|
||||
IF(HAVE_ARM_NEON_H)
|
||||
SET(${PROJECT_NAME}_CPU_SRCS byteswap_neon.c)
|
||||
SET(${PROJECT_NAME}_NEON_SRCS byteswap_neon.c)
|
||||
|
||||
IF(NEON_FLAG)
|
||||
SET_SOURCE_FILES_PROPERTIES(${${PROJECT_NAME}_NEON_SRCS}
|
||||
APPEND_STRING PROPERTIES COMPILE_FLAGS " ${NEON_FLAG} ")
|
||||
ENDIF(NEON_FLAG)
|
||||
|
||||
SET(${PROJECT_NAME}_CPU_SRCS ${${PROJECT_NAME}_NEON_SRCS})
|
||||
ENDIF(HAVE_ARM_NEON_H)
|
||||
ENDIF()
|
||||
UNSET(arch)
|
||||
|
@ -200,10 +200,17 @@ IF(CPU_i386 OR CPU_amd64)
|
||||
)
|
||||
ELSEIF(CPU_arm OR CPU_arm64)
|
||||
IF(HAVE_ARM_NEON_H)
|
||||
SET(${PROJECT_NAME}_CPU_SRCS
|
||||
SET(${PROJECT_NAME}_NEON_SRCS
|
||||
img/rp_image_ops_neon.cpp
|
||||
decoder/ImageDecoder_Linear_neon.cpp
|
||||
)
|
||||
|
||||
IF(NEON_FLAG)
|
||||
SET_SOURCE_FILES_PROPERTIES(${${PROJECT_NAME}_NEON_SRCS}
|
||||
APPEND_STRING PROPERTIES COMPILE_FLAGS " ${NEON_FLAG} ")
|
||||
ENDIF(NEON_FLAG)
|
||||
|
||||
SET(${PROJECT_NAME}_CPU_SRCS ${${PROJECT_NAME}_NEON_SRCS})
|
||||
ENDIF(HAVE_ARM_NEON_H)
|
||||
ENDIF()
|
||||
UNSET(arch)
|
||||
|
Loading…
Reference in New Issue
Block a user