diff --git a/DEPENDENCIES b/DEPENDENCIES index b32f0e29..d52cb1e7 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,5 +1,5 @@ vendorpull https://github.com/sourcemeta/vendorpull 70342aaf458e6cb80baeb5b718901075fc42ede6 -noa https://github.com/sourcemeta/noa 517e88aef5981b88ac6bb8caff15d17dffcb4320 +noa https://github.com/sourcemeta/noa 837e1ff981f8df45d9e2977a50f5da61d8affed4 jsontoolkit https://github.com/sourcemeta/jsontoolkit 9abbaee71e9e00e95632858d29c7ebe5c2a723b0 bearssl https://www.bearssl.org/git/BearSSL 8ef7680081c61b486622f2d983c0d3d21e83caad zlib https://github.com/madler/zlib 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf diff --git a/vendor/noa/cmake/noa/compiler/options.cmake b/vendor/noa/cmake/noa/compiler/options.cmake index b1fc6e53..dde90f21 100644 --- a/vendor/noa/cmake/noa/compiler/options.cmake +++ b/vendor/noa/cmake/noa/compiler/options.cmake @@ -42,6 +42,10 @@ function(noa_add_default_options visibility target) -Winvalid-offsetof -funroll-loops -fstrict-aliasing + -ftree-vectorize + + # To improve how much GCC/Clang will vectorize + -fno-math-errno # Assume that signed arithmetic overflow of addition, subtraction and # multiplication wraps around using twos-complement representation @@ -78,10 +82,28 @@ function(noa_add_default_options visibility target) -fslp-vectorize) elseif(NOA_COMPILER_GCC) target_compile_options("${target}" ${visibility} + -fno-trapping-math # Newer versions of GCC (i.e. 14) seem to print a lot of false-positives here -Wno-dangling-reference - + # GCC seems to print a lot of false-positives here + -Wno-free-nonheap-object # Disables runtime type information -fno-rtti) endif() endfunction() + +# For studying failed vectorization results +# - On Clang , seems to only take effect on release shared builds +# - On GCC, seems to only take effect on release shared builds +function(noa_add_vectorization_diagnostics target) + if(NOA_COMPILER_LLVM) + # See https://llvm.org/docs/Vectorizers.html#id6 + target_compile_options("${target}" PRIVATE + -Rpass-analysis=loop-vectorize + -Rpass-missed=loop-vectorize) + elseif(NOA_COMPILER_GCC) + target_compile_options("${target}" PRIVATE + -fopt-info-vec-missed + -fopt-info-loop-missed) + endif() +endfunction() diff --git a/vendor/noa/cmake/noa/library.cmake b/vendor/noa/cmake/noa/library.cmake index 05d57748..9868714d 100644 --- a/vendor/noa/cmake/noa/library.cmake +++ b/vendor/noa/cmake/noa/library.cmake @@ -1,6 +1,6 @@ function(noa_library) cmake_parse_arguments(NOA_LIBRARY "" - "NAMESPACE;PROJECT;NAME;FOLDER" "PRIVATE_HEADERS;SOURCES" ${ARGN}) + "NAMESPACE;PROJECT;NAME;FOLDER;VARIANT" "PRIVATE_HEADERS;SOURCES" ${ARGN}) if(NOT NOA_LIBRARY_PROJECT) message(FATAL_ERROR "You must pass the project name using the PROJECT option") @@ -18,7 +18,11 @@ function(noa_library) set(INCLUDE_PREFIX "include/${NOA_LIBRARY_PROJECT}") endif() - set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + if(NOT NOA_LIBRARY_VARIANT) + set(PUBLIC_HEADER "${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + else() + set(PUBLIC_HEADER "../${INCLUDE_PREFIX}/${NOA_LIBRARY_NAME}.h") + endif() if(NOA_LIBRARY_SOURCES) set(ABSOLUTE_PRIVATE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${NOA_LIBRARY_NAME}_export.h") @@ -38,6 +42,11 @@ function(noa_library) set(ALIAS_NAME "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}") endif() + if(NOA_LIBRARY_VARIANT) + set(TARGET_NAME "${TARGET_NAME}_${NOA_LIBRARY_VARIANT}") + set(ALIAS_NAME "${ALIAS_NAME}::${NOA_LIBRARY_VARIANT}") + endif() + if(NOA_LIBRARY_SOURCES) add_library(${TARGET_NAME} ${PUBLIC_HEADER} ${ABSOLUTE_PRIVATE_HEADERS} ${NOA_LIBRARY_SOURCES}) @@ -50,23 +59,34 @@ function(noa_library) add_library(${ALIAS_NAME} ALIAS ${TARGET_NAME}) + if(NOT NOA_LIBRARY_VARIANT) + set(include_dir "${CMAKE_CURRENT_SOURCE_DIR}/include") + else() + set(include_dir "${CMAKE_CURRENT_SOURCE_DIR}/../include") + endif() if(NOA_LIBRARY_SOURCES) target_include_directories(${TARGET_NAME} PUBLIC - "$" + "$" "$") else() target_include_directories(${TARGET_NAME} INTERFACE - "$" + "$" "$") endif() if(NOA_LIBRARY_SOURCES) + if(NOA_LIBRARY_VARIANT) + set(export_name "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}::${NOA_LIBRARY_VARIANT}") + else() + set(export_name "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}") + endif() + set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME} PUBLIC_HEADER "${PUBLIC_HEADER}" PRIVATE_HEADER "${ABSOLUTE_PRIVATE_HEADERS}" - EXPORT_NAME "${NOA_LIBRARY_PROJECT}::${NOA_LIBRARY_NAME}" + EXPORT_NAME "${export_name}" FOLDER "${NOA_LIBRARY_FOLDER}") else() set_target_properties(${TARGET_NAME} @@ -93,7 +113,7 @@ function(noa_library) endfunction() function(noa_library_install) - cmake_parse_arguments(NOA_LIBRARY "" "NAMESPACE;PROJECT;NAME" "" ${ARGN}) + cmake_parse_arguments(NOA_LIBRARY "" "NAMESPACE;PROJECT;NAME;VARIANT" "" ${ARGN}) if(NOT NOA_LIBRARY_PROJECT) message(FATAL_ERROR "You must pass the project name using the PROJECT option") @@ -114,6 +134,10 @@ function(noa_library_install) set(NAMESPACE_PREFIX "") endif() + if(NOA_LIBRARY_VARIANT) + set(TARGET_NAME "${TARGET_NAME}_${NOA_LIBRARY_VARIANT}") + endif() + include(GNUInstallDirs) install(TARGETS ${TARGET_NAME} EXPORT ${TARGET_NAME}