3 Commits (c017fc16dd1460bfefcbaa39747035003559d3f4)

Author SHA1 Message Date
Andre Richter c004e78e90
Safe implementations of uart::dec() and divisions
The previous implementation of uart::dec() forced the compiler to emit a
software out-of-bounds acces check into the code, bloating it a bit. Prevent
that by using an iterator instead.

Same is true for the ordinary division operator that was used in multiple places
in the benchmark code. Here, the compiler emitted software-checks for divison by
zero. Prevent this by using `checked_div()` where we can implement our own
"panic" handling.
6 years ago
Andre Richter 68de789d15
0D: Instruction caching and better benchmark function.
The previous benchmark function had a few flaws. First of all, it wasn't
idiomatic Rust, because we used a loop construct that you would expect in C.
Revamped that by using an iterator. Also, the previous benchmark got heavily
optimized by the compiler, which unrolled the inner loop it into a huge sequence
of consecutive loads and stores, resulting in lots of instructions that needed
to be fetched from DRAM. Additionally, instruction caching was not turned on.

The new code compiles into two tight loops, fully leveraging the power of the I
and D caches, and providing an great showcase.
6 years ago
Andre Richter c65e2e56cd
Add tutorial 0D_cache_performance 6 years ago