Skip to content

Commit

Permalink
Introduce an -fpeel-loops flag for GCC build.
Browse files Browse the repository at this point in the history
This improves performance of scalar-optimized code by 1.5 times as well as fixes gost-engine#433.
  • Loading branch information
marcfedorow committed May 24, 2024
1 parent ede3886 commit ef9c2d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ include_directories(${OPENSSL_INCLUDE_DIR})
set(OPENSSL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/ossl-modules)

if (CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS_RELEASE -O2)
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb")
add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Qunused-arguments -Wno-deprecated-declarations)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_RELEASE -O2)
set(CMAKE_C_FLAGS_RELEASE "-O2 -fpeel-loops")
set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -fpeel-loops -ggdb")
add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations)
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Expand Down

0 comments on commit ef9c2d8

Please sign in to comment.