[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/07: volk: dekludging asm setup, round 1
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/07: volk: dekludging asm setup, round 1 |
Date: |
Sun, 27 Jul 2014 18:06:28 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit b04498ff90d09a2408c7d990ecf9e4a3a244b9eb
Author: Nathan West <address@hidden>
Date: Sat Jul 19 00:50:38 2014 -0400
volk: dekludging asm setup, round 1
---
cmake/Toolchains/oe-sdk_cross.cmake | 2 ++
volk/lib/CMakeLists.txt | 46 ++++++++++++++++++++++---------------
2 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/cmake/Toolchains/oe-sdk_cross.cmake
b/cmake/Toolchains/oe-sdk_cross.cmake
index 2a01d8f..788a22b 100644
--- a/cmake/Toolchains/oe-sdk_cross.cmake
+++ b/cmake/Toolchains/oe-sdk_cross.cmake
@@ -1,6 +1,8 @@
set( CMAKE_SYSTEM_NAME Linux )
#set( CMAKE_C_COMPILER $ENV{CC} )
#set( CMAKE_CXX_COMPILER $ENV{CXX} )
+string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR
$ENV{SDKTARGETSYSROOT})
+string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR
${CMAKE_SYSTEM_PROCESSOR})
set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE )
set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) #same flags for C
sources
set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) #same
flags for C sources
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 86b2c6a..90a8262 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -101,7 +101,7 @@ macro(check_arch arch_name)
if (NOT ${have_flag})
set(have_${arch_name} FALSE)
endif()
- endforeach(flag)
+ endforeach()
if (have_${arch_name})
list(APPEND available_archs ${arch_name})
endif()
@@ -382,26 +382,36 @@ include_directories(
)
########################################################################
-# Handle ASM (for ARM) support
+# Handle ASM support
# on by default, but let users turn it off
########################################################################
-if( NOT DEFINED ENABLE_ARM_ASM OR ENABLE_ARM_ASM )
- message("---- Adding ARM ASM files")
- set(ASM-ATT $ENV{ASM})
- #set(_CMAKE_TOOLCHAIN_PREFIX $ENV{TARGET_PREFIX}) # Gah - wtf, this
shouldn't be needed
- enable_language(ASM-ATT)
- # what would make this OK, appending?
- set(ASM-ATT_FLAGS "-mfpu=neon -g") # Horrid horrid hack to assemble for
ARM neon
- set(CMAKE_ASM-ATT_FLAGS ${ASM-ATT_FLAGS})
- message("DEBUG: looking for ASM files in
${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon")
- include_directories(${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon)
- file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon/*.s)
- foreach(asm_file ${asm_files})
- list(APPEND volk_sources ${asm_file})
- message(STATUS "Adding source file: ${asm_file}")
- endforeach(asm_file)
+set(ASM_ARCHS_AVAILABLE "armv7")
+if( NOT DEFINED ENABLE_ASM OR ENABLE_ASM )
+ # sort through a list of all architectures we have ASM for
+ # if we find one that matches our current system architecture
+ # set up the assembler flags and include the source files
+ foreach(ARCH ${ASM_ARCHS_AVAILABLE})
+ string(REGEX MATCH "^${ARCH}" ASM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+ if( ASM_ARCH STREQUAL "armv7" )
+ set(ASM-ATT $ENV{ASM})
+ message("---- Adding ASM files") # we always use ATT syntax
+ message("-- Detected armv7 architecture; enabling ASM")
+ # setup architecture specific assembler flags
+ set(ARCH_ASM_FLAGS "-mfpu=neon -g")
+ # then add the files
+ include_directories(${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon)
+ file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon/*.s)
+ foreach(asm_file ${asm_files})
+ list(APPEND volk_sources ${asm_file})
+ message(STATUS "Adding source file: ${asm_file}")
+ endforeach(asm_file)
+ endif()
+ set(CMAKE_ASM-ATT_FLAGS_INIT ${ARCH_ASM_FLAGS})
+ enable_language(ASM-ATT) # this must be after flags_init
+ message("asm flags are ${CMAKE_ASM-ATT_FLAGS}")
+ endforeach(ARCH)
else()
- message("---- NOT Adding ARM ASM files")
+ message("---- NOT Adding ASM files")
endif()
########################################################################
- [Commit-gnuradio] [gnuradio] branch master updated (fd0db71 -> 67ab045), git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 04/07: Merge branch 'maint', git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 02/07: volk: dekludging asm setup, round 1,
git <=
- [Commit-gnuradio] [gnuradio] 05/07: Merge remote-tracking branch 'nwest/neon', git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 06/07: cmake: fixes to cmake for setting flags properly and removing dups., git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 07/07: Merge branch 'maint', git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 03/07: volk: removing unused variables in neon, git, 2014/07/27
- [Commit-gnuradio] [gnuradio] 01/07: volk: add NEON protokernels, git, 2014/07/27