From 6a4e78da26f09a3f12081e578881d885158c3a8b Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Wed, 17 May 2023 15:33:24 +0100 Subject: [PATCH] Change NO_INVARIANCE to INVARIANCE option --- CMakeLists.txt | 6 +++--- Docs/Building.md | 2 +- Source/cmake_core.cmake | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98b78a220..e8246953d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ option(ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects option(ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace") option(ASTCENC_ASAN "Enable astcenc builds with address sanitizer") option(ASTCENC_UNITTEST "Enable astcenc builds with unit tests") -option(ASTCENC_NO_INVARIANCE "Enable astcenc builds without floating point invariance") +option(ASTCENC_INVARIANCE "Enable astcenc floating point invariance" ON) option(ASTCENC_CLI "Enable build of astcenc command line tools" ON) set(ASTCENC_UNIVERSAL_BUILD OFF) @@ -204,9 +204,9 @@ printopt("NATIVE backend " ${ASTCENC_ISA_NATIVE}) if("${ASTCENC_MACOS_BUILD}") printopt("Universal bin " ${ASTCENC_UNIVERSAL_BUILD}) endif() -printopt("Decompressor " ${ASTCENC_DECOMPRESSOR}) +printopt("Invariance " ${ASTCENC_INVARIANCE}) printopt("Shared libs " ${ASTCENC_SHAREDLIB}) -printopt("No invariance " ${ASTCENC_NO_INVARIANCE}) +printopt("Decompressor " ${ASTCENC_DECOMPRESSOR}) printopt("Diagnostics " ${ASTCENC_DIAGNOSTICS}) printopt("ASAN " ${ASTCENC_ASAN}) printopt("Unit tests " ${ASTCENC_UNITTEST}) diff --git a/Docs/Building.md b/Docs/Building.md index 44ce54a75..7871ef87b 100644 --- a/Docs/Building.md +++ b/Docs/Building.md @@ -155,7 +155,7 @@ will return the error `ASTCENC_ERR_NOT_IMPLEMENTED` during context creation. All normal builds are designed to be invariant, so any build from the same git revision will produce bit-identical results for all compilers and CPU architectures. To achieve this we sacrifice some performance, so if this is -not required you can specify `-DASTCENC_NO_INVARIANCE=ON` to enable additional +not required you can specify `-DASTCENC_INVARIANCE=OFF` to enable additional optimizations. This has most benefit for AVX2 builds where we are able to enable use of the FMA instruction set extensions. diff --git a/Source/cmake_core.cmake b/Source/cmake_core.cmake index 61e46c4f7..42c6f8fe0 100644 --- a/Source/cmake_core.cmake +++ b/Source/cmake_core.cmake @@ -195,7 +195,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER) $<$:-fsanitize=address>) endif() - if(${ASTCENC_NO_INVARIANCE}) + if(NOT ${ASTCENC_INVARIANCE}) target_compile_definitions(${ASTCENC_TARGET_NAME} PRIVATE ASTCENC_NO_INVARIANCE=1) @@ -330,7 +330,7 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER) # which significantly improve performance. Note that this DOES reduce # image quality by up to 0.2 dB (normally much less), but buys an # average of 10-15% performance improvement ... - if(${ASTCENC_NO_INVARIANCE} AND NOT ${ASTCENC_IS_VENEER}) + if((NOT ${ASTCENC_INVARIANCE}) AND (NOT ${ASTCENC_IS_VENEER})) target_compile_options(${ASTCENC_TARGET_NAME} PRIVATE $<$>:-mfma>)