Skip to content

Commit 8ec7e2e

Browse files
authored
⚡ Optimize (#26)
* ⚡ Add the folowing optimizations (1) - ♻️ Simplify `restore_cpu_core` assembly a bit - ⚡ Unwind becomes a jump table * ⚡ Jump table working. May have bugs * ⚡ [[gnu::always_inline]] Many functions - ⚡ Carve out a branch for decoding uleb128 call-site information, the most common and encouraged encoding. - 🐛 Add `lr` and `pc` to clobber list to ensure that the compiler does not attempt to use the `lr` register to hold the pointer to the virtual_cpu structure - ⚡ Move index entry definitions to the header * 🐛 Get multi levels demo to work * ⚡ Many fixes and improvements * 🚧 Turn on destructors (currently broken) * About this code I was trying to make a version of the `enter_function()` function that has less branches. Trading space for speed. * ⚡ Add enter_function2() `enter_function2()` will be a replacement for `enter_function()`. This function correctly decodes the call sites using their encoding values and decodes the action table and type table correctly as well. Although the type table parsing is still assumed to be pcrel. This should be fixed at some point. * 💩 unwind_frame2 The idea of unwind_frame2 was to evaluate the instructions in place vs putting them into order in the instruction_t. The problem is word boundaries which requires logic to determine if we are at the end of the instructions. * 🔥 Remove some uneeded unwind code * ⚡ Cache & Use the personality pointer * 🗑️ Remove old unneeded code * ⚡ Remove usage of personality in create_instructions_from_entry * 📝 Add todo w/ github issues everywhere in the code - Remove a few `#if 0` code - Slightly fix up issues with CI
1 parent 618a6b1 commit 8ec7e2e

File tree

8 files changed

+13114
-499
lines changed

8 files changed

+13114
-499
lines changed

conanfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ def package_info(self):
131131
"-Wl,--wrap=__cxa_end_catch",
132132
"-Wl,--wrap=__cxa_begin_catch",
133133
"-Wl,--wrap=__cxa_end_cleanup",
134+
"-Wl,--wrap=__gnu_unwind_pr_common",
135+
"-Wl,--wrap=__aeabi_unwind_cpp_pr0",
136+
"-Wl,--wrap=_sig_func",
137+
"-Wl,--wrap=__gxx_personality_v0",
138+
"-Wl,--wrap=deregister_tm_clones",
139+
"-Wl,--wrap=register_tm_clones",
140+
# Ensure that all symbols are added to the linker's symbol table
141+
"-Wl,--whole-archive",
142+
lib_path,
143+
"-Wl,--no-whole-archive",
134144
])
135145

136146
# Keep this for now, will update this for the runtime select

demos/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ cmake_minimum_required(VERSION 3.15)
1616

1717
project(demos LANGUAGES CXX)
1818

19+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --save-temps")
20+
1921
libhal_build_demos(
2022
DEMOS
2123
single_level
24+
multi_levels
2225

2326
PACKAGES
2427
libhal-exceptions

0 commit comments

Comments
 (0)