diff options
Diffstat (limited to 'volk')
-rw-r--r-- | volk/gen/machines.xml | 22 | ||||
-rw-r--r-- | volk/gen/volk_machine_defs.py | 2 | ||||
-rw-r--r-- | volk/lib/CMakeLists.txt | 43 |
3 files changed, 42 insertions, 25 deletions
diff --git a/volk/gen/machines.xml b/volk/gen/machines.xml index 6ce077e3c..8e3c9c8c2 100644 --- a/volk/gen/machines.xml +++ b/volk/gen/machines.xml @@ -1,51 +1,51 @@ <grammar> <machine name="generic"> -<archs>generic</archs> +<archs>generic orc|</archs> </machine> <!-- <machine name="mmx"> -<archs>generic 32|64 mmx</archs> +<archs>generic 32|64 mmx orc|</archs> </machine> <machine name="sse"> -<archs>generic 32|64| mmx sse</archs> +<archs>generic 32|64| mmx sse orc|</archs> </machine> --> <machine name="neon"> -<archs>generic neon</archs> +<archs>generic neon orc|</archs> </machine> <!-- trailing | bar means generate without either for MSVC --> <machine name="sse2"> -<archs>generic 32|64| mmx sse sse2</archs> +<archs>generic 32|64| mmx sse sse2 orc|</archs> </machine> <machine name="sse3"> -<archs>generic 32|64 mmx sse sse2 sse3</archs> +<archs>generic 32|64 mmx sse sse2 sse3 orc|</archs> </machine> <machine name="ssse3"> -<archs>generic 32|64 mmx sse sse2 sse3 ssse3</archs> +<archs>generic 32|64 mmx sse sse2 sse3 ssse3 orc|</archs> </machine> <machine name="sse4_a"> -<archs>generic 32|64 mmx sse sse2 sse3 sse4_a popcount</archs> +<archs>generic 32|64 mmx sse sse2 sse3 sse4_a popcount orc|</archs> </machine> <machine name="sse4_1"> -<archs>generic 32|64 mmx sse sse2 sse3 ssse3 sse4_1</archs> +<archs>generic 32|64 mmx sse sse2 sse3 ssse3 sse4_1 orc|</archs> </machine> <machine name="sse4_2"> -<archs>generic 32|64 mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount</archs> +<archs>generic 32|64 mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount orc|</archs> </machine> <!-- trailing | bar means generate without either for MSVC --> <machine name="avx"> -<archs>generic 32|64| mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx</archs> +<archs>generic 32|64| mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx orc|</archs> </machine> <machine name="altivec"> diff --git a/volk/gen/volk_machine_defs.py b/volk/gen/volk_machine_defs.py index 77ebe64f0..b30a480ba 100644 --- a/volk/gen/volk_machine_defs.py +++ b/volk/gen/volk_machine_defs.py @@ -69,7 +69,7 @@ for machine_xml in machines_xml: val = machine_xml.getElementsByTagName(name)[0].firstChild.data kwargs[name] = val except: pass - kwargs['archs'] = kwargs['archs'].split() + ['orc|norc'] + kwargs['archs'] = kwargs['archs'].split() register_machine(**kwargs) if __name__ == '__main__': diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index 742b427d0..5b7e0d256 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -87,10 +87,7 @@ endforeach(line) # implement overruling in the ORC case, # since ORC always passes flag detection ######################################################################## -if(ORC_FOUND) - message(STATUS "Overruled arch !ORC") - list(REMOVE_ITEM available_archs norc) -else() +if(NOT ORC_FOUND) message(STATUS "Overruled arch ORC") list(REMOVE_ITEM available_archs orc) endif() @@ -118,6 +115,9 @@ if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86) endif() endif() +######################################################################## +# done overrules! print the result +######################################################################## message(STATUS "Available architectures: ${available_archs}") ######################################################################## @@ -129,19 +129,24 @@ execute_process( OUTPUT_VARIABLE available_machines OUTPUT_STRIP_TRAILING_WHITESPACE ) -message(STATUS "Available machines: ${available_machines}") - +######################################################################## +# implement machine overruling in the ORC case, +# dont generate not-orc machines if ORC is available +######################################################################## foreach(machine_name ${available_machines}) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/gen/volk_compile_utils.py - --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" - OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(TOUPPER LV_MACHINE_${machine_name} machine_def) - list(APPEND machine_defs ${machine_def}) + string(REPLACE "_orc" "" machine_name_no_orc ${machine_name}) + if (${machine_name} STREQUAL ${machine_name_no_orc}) + else() + list(REMOVE_ITEM available_machines ${machine_name_no_orc}) + endif() endforeach(machine_name) ######################################################################## +# done overrules! print the result +######################################################################## +message(STATUS "Available machines: ${available_machines}") + +######################################################################## # Create rules to run the volk generator ######################################################################## @@ -171,11 +176,23 @@ gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machines.tmpl.h ${CMAKE_BINARY_DI gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machines.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_machines.c) foreach(machine_name ${available_machines}) + #generate machine source set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_machine_${machine_name}.c) gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machine_xxx.tmpl.c ${machine_source} ${machine_name}) + + #determine machine flags + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/gen/volk_compile_utils.py + --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" + OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE + ) if(${machine_name}_flags) set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") endif() + + #add to available machine defs + string(TOUPPER LV_MACHINE_${machine_name} machine_def) + list(APPEND machine_defs ${machine_def}) endforeach(machine_name) ######################################################################## |