Skip to content

Commit

Permalink
Added use of O3 instead of O2 for e2k arch
Browse files Browse the repository at this point in the history
O3 on E2K mcst-lcc approximately equal to O2 at X86/ARM gcc
  • Loading branch information
r-a-sattarov authored and DanielGibson committed Feb 7, 2025
1 parent cc5f1d9 commit a18b9e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions neo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,18 @@ if(D3_COMPILER_IS_GCC_OR_CLANG)
endif ()
endif ()

if(cpu STREQUAL "e2k" AND CMAKE_COMPILER_IS_GNUCC)
# O3 on E2K mcst-lcc approximately equal to O2 at X86/ARM gcc
set(OPT_LEVEL "-O3")
else()
set(OPT_LEVEL "-O2")
endif()

set(CMAKE_C_FLAGS_DEBUG "-g -ggdb -D_DEBUG -O0")
set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG")
set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-math-errno -fno-trapping-math -ffinite-math-only -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -ggdb -O2 -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "${OPT_LEVEL} -fno-math-errno -fno-trapping-math -ffinite-math-only -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -ggdb ${OPT_LEVEL} -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-math-errno -fno-trapping-math -ffinite-math-only -fomit-frame-pointer")

set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL})
Expand Down

0 comments on commit a18b9e6

Please sign in to comment.