[Libre-soc-bugs] [Bug 979] Implement C-based Power ISA decoder compiler

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Sep 3 07:20:03 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=979

--- Comment #23 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #19)
> each function call blows a whopping *ten percent* of that available budget.

with tail-call optimization, you can get even better performance than a giant
switch if you do it right...

also modern cpus usually correctly predict exactly where call and return insns
go leaving them as very low cost (maybe 1 cycle each, or less if they overlap
other computation), so, no, calls aren't always expensive.

(In reply to Dmitry Selyutin from comment #21)
> OK, here's a better idea. No functions at all other than one huge function
> which performs the jumps.

i think having separate functions is easier to understand, and with
__attribute__((always_inline)) produces essentially identical code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list