Skip to content

Commit df4b51c

Browse files
committed
⚗️ Add fast gcc to benchmark
Fast GCC, is just builtin GCC exceptions except I replace some of the function with my own versions. Mostly just added always inline along with some performance improvements from my talk.
1 parent 8a64d09 commit df4b51c

File tree

7 files changed

+575
-45
lines changed

7 files changed

+575
-45
lines changed

benchmark/CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,41 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/nearpoint.cpp")
143143
else()
144144
message(WARNING "nearpoint.cpp does not exist")
145145
endif()
146+
147+
148+
# Build nearpoint binary if if available
149+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/fast_gcc_unwind.cpp")
150+
message(STATUS "fast_gcc_unwind.cpp exists!")
151+
set(elf fast_gcc_unwind.cpp.elf)
152+
message(STATUS "Generating Demo for \"${elf}\"")
153+
add_executable(${elf} generated_tests/except.cpp fast_gcc_unwind.cpp)
154+
target_include_directories(${elf} PRIVATE .)
155+
target_compile_options(${elf} PRIVATE
156+
${BENCHMARK_COMPILE_OPTIONS}
157+
-fexceptions
158+
-Wno-error=attributes)
159+
160+
target_link_libraries(${elf} PRIVATE
161+
startup_code
162+
libhal::$ENV{LIBHAL_PLATFORM_LIBRARY}
163+
)
164+
target_link_options(${elf} PRIVATE -fno-threadsafe-statics
165+
-L${CMAKE_SOURCE_DIR}/
166+
-Wl,-Map=${CMAKE_BINARY_DIR}/${elf}.map
167+
-Wl,--wrap=__gnu_unwind_execute
168+
-Wl,--wrap=_Unwind_VRS_Pop
169+
-Wl,--wrap=__gnu_unwind_frame
170+
)
171+
if(prebuilt-picolibc_FOUND)
172+
target_link_libraries(${elf} PRIVATE picolibc)
173+
endif()
174+
175+
if(${CMAKE_CROSSCOMPILING})
176+
# Convert elf into .bin, .hex and other formats needed for programming
177+
# devices.
178+
libhal_post_build(${elf})
179+
libhal_disassemble(${elf})
180+
endif()
181+
else()
182+
message(WARNING "nearpoint.cpp does not exist")
183+
endif()

0 commit comments

Comments
 (0)