message("-- Building type: RELEASE")
endif(BUILD_DEBUG)
+# By default, we compile c intrinsic.
+set(NE10_ASM_OPTIMIZATION off)
+
if(ANDROID_PLATFORM)
if(NE10_ARM_HARD_FLOAT)
set(FLOAT_ABI "hard")
# Refer $NDK/tests/device/hard-float/jni/Android.mk for more details.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--no-warn-mismatch")
endif()
+ # Turn on asm optimization for Android on ARM v7.
+ set(NE10_ASM_OPTIMIZATION on)
endif()
message("-- Loaded toolchain:
${CMAKE_C_COMPILER}
if(${NE10_TARGET_ARCH} STREQUAL "armv7")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
+ # Turn on asm optimization for Linux on ARM v7.
+ set(NE10_ASM_OPTIMIZATION on)
endif()
elseif(IOS_PLATFORM)
#set minimal target ios version.If not provided this option, Xcode
if(NE10_ENABLE_DSP)
#enable NE10_init_dsp
add_definitions(-DNE10_ENABLE_DSP)
+
+ set(NE10_DSP_INTRINSIC_SRCS )
+ set(NE10_DSP_NEON_SRCS )
+
# Add dsp C files.
set(NE10_DSP_C_SRCS
${PROJECT_SOURCE_DIR}/common/NE10_mask_table.c
# Tell CMake these files need to be compiled with "-mfpu=neon"
if(${NE10_TARGET_ARCH} STREQUAL "armv7")
- # Following definition is only available under armv7.
- add_definitions(-DENABLE_NE10_FIR_FLOAT_NEON)
- add_definitions(-DENABLE_NE10_FIR_DECIMATE_FLOAT_NEON)
- add_definitions(-DENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON)
- add_definitions(-DENABLE_NE10_FIR_LATTICE_FLOAT_NEON)
- add_definitions(-DENABLE_NE10_FIR_SPARSE_FLOAT_NEON)
- add_definitions(-DENABLE_NE10_IIR_LATTICE_FLOAT_NEON)
-
- # Add dsp intrinsic NEON files.
- set(NE10_DSP_INTRINSIC_SRCS
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_float32.neon.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int32.neon.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int16.neon.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_generic_int32.neonintrinsic.cpp
- )
-
- foreach(intrinsic_file ${NE10_DSP_INTRINSIC_SRCS})
- set_source_files_properties(${intrinsic_file} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
- endforeach(intrinsic_file)
+ if(IOS_PLATFORM)
+ else()
+ # Following definition is only available under armv7.
+ add_definitions(-DENABLE_NE10_FIR_FLOAT_NEON)
+ add_definitions(-DENABLE_NE10_FIR_DECIMATE_FLOAT_NEON)
+ add_definitions(-DENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON)
+ add_definitions(-DENABLE_NE10_FIR_LATTICE_FLOAT_NEON)
+ add_definitions(-DENABLE_NE10_FIR_SPARSE_FLOAT_NEON)
+ add_definitions(-DENABLE_NE10_IIR_LATTICE_FLOAT_NEON)
+
+ # Add dsp NEON files.
+ set(NE10_DSP_NEON_SRCS
+ ${NE10_DSP_NEON_SRCS}
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fir.neon.s
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_iir.neon.s
+ )
+ endif()
+ endif()
- # Add dsp NEON files.
+ if(NE10_ASM_OPTIMIZATION)
set(NE10_DSP_NEON_SRCS
+ ${NE10_DSP_NEON_SRCS}
${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_float32.neon.s
${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int32.neon.s
${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int16.neon.s
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fir.neon.s
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_iir.neon.s
- )
+ )
+ set(NE10_DSP_INTRINSIC_SRCS
+ ${NE10_DSP_INTRINSIC_SRCS}
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_float32.neon.c
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int32.neon.c
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int16.neon.c
+ )
else()
- # Add dsp intrinsic NEON files.
+ add_definitions(-DNE10_UNROLL_LEVEL=1)
set(NE10_DSP_INTRINSIC_SRCS
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_rfft_float32.neonintrinsic.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_float32.neonintrinsic.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int32.neonintrinsic.c
- ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int16.neonintrinsic.c
+ ${NE10_DSP_INTRINSIC_SRCS}
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_float32.neonintrinsic.c
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int32.neonintrinsic.c
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_int16.neonintrinsic.c
+ ${PROJECT_SOURCE_DIR}/modules/dsp/NE10_rfft_float32.neonintrinsic.c
+ )
+ endif()
+
+ # Add dsp intrinsic NEON files.
+ set(NE10_DSP_INTRINSIC_SRCS
+ ${NE10_DSP_INTRINSIC_SRCS}
${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_generic_float32.neonintrinsic.cpp
${PROJECT_SOURCE_DIR}/modules/dsp/NE10_fft_generic_int32.neonintrinsic.cpp
- )
+ )
+
+ if(${NE10_TARGET_ARCH} STREQUAL "armv7")
+ foreach(intrinsic_file ${NE10_DSP_INTRINSIC_SRCS})
+ set_source_files_properties(${intrinsic_file} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
+ endforeach(intrinsic_file)
endif()
if(IOS_PLATFORM)
- convert_gas(NE10_DSP_NEON_SRCS NE10_DSP_IOS_NEON_SRCS)
- set_file_to_c(NE10_DSP_IOS_NEON_SRCS)
+ set_file_to_c(NE10_DSP_NEON_SRCS)
else(IOS_PLATFORM)
set_file_to_c(NE10_DSP_NEON_SRCS)
endif(IOS_PLATFORM)
VERSION ${NE10_VERSION}
)
+ target_link_libraries(NE10 stdc++)
+
+ set_target_properties(NE10 PROPERTIES
+ LINKER_LANGUAGE C
+ )
+
if(IOS_DEMO)
install(TARGETS NE10
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../ios/NE10Demo/libs/)
inline void operator() (CPLX scratch_out[RADIX])
{
#ifdef NE10_DSP_CFFT_SCALING
- const static int32x4_t one_by_RADIX =
+ const int32x4_t one_by_RADIX =
{
(ne10_int32_t) floor(1.0 / RADIX * NE10_F2I32_MAX + 0.5f),
(ne10_int32_t) floor(1.0 / RADIX * NE10_F2I32_MAX + 0.5f),
inline void operator () (CPLX scratch_out[1])
{
#ifdef NE10_DSP_CFFT_SCALING
- const static int32x4_t one_by_RADIX =
+ const int32x4_t one_by_RADIX =
{
(ne10_int32_t) floor(1.0 / RADIX * NE10_F2I32_MAX + 0.5f),
(ne10_int32_t) floor(1.0 / RADIX * NE10_F2I32_MAX + 0.5f),
inline REAL NE10_HALF (REAL src)
{
- const static int32x4_t CONST_HALF_NEON = { -1, -1, -1, -1};
+ const int32x4_t CONST_HALF_NEON = { -1, -1, -1, -1};
src = vshlq_s32 (src, CONST_HALF_NEON);
return src;
}