Skip to content

Commit

Permalink
⚡ Optimize (#26)
Browse files Browse the repository at this point in the history
* ⚡ 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
  • Loading branch information
kammce authored Jul 24, 2024
1 parent 618a6b1 commit 8ec7e2e
Show file tree
Hide file tree
Showing 8 changed files with 13,114 additions and 499 deletions.
10 changes: 10 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ def package_info(self):
"-Wl,--wrap=__cxa_end_catch",
"-Wl,--wrap=__cxa_begin_catch",
"-Wl,--wrap=__cxa_end_cleanup",
"-Wl,--wrap=__gnu_unwind_pr_common",
"-Wl,--wrap=__aeabi_unwind_cpp_pr0",
"-Wl,--wrap=_sig_func",
"-Wl,--wrap=__gxx_personality_v0",
"-Wl,--wrap=deregister_tm_clones",
"-Wl,--wrap=register_tm_clones",
# Ensure that all symbols are added to the linker's symbol table
"-Wl,--whole-archive",
lib_path,
"-Wl,--no-whole-archive",
])

# Keep this for now, will update this for the runtime select
Expand Down
3 changes: 3 additions & 0 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ cmake_minimum_required(VERSION 3.15)

project(demos LANGUAGES CXX)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --save-temps")

libhal_build_demos(
DEMOS
single_level
multi_levels

PACKAGES
libhal-exceptions
Expand Down
Loading

0 comments on commit 8ec7e2e

Please sign in to comment.