Commit Graph

6 Commits

Author SHA1 Message Date
Jeremiah Orians 3bac25a1ac
Fix issues with HACKING document 2021-06-23 20:12:20 -04:00
deesix b2ece54864 aarch64: do not generate a wasteful stack anymore
Until now, each element on the compiled program stack was 128 bits long,
half of them unused because only one 64 bits value was stored.

Now it's 64 bits long, so we don't waste all that memory.

We workaround the architectural alignment restriction of the SP register by
using a free regular register. X18 is for platform use so it seems a good
candidate for this task.

At _start we copy the value of SP into X18. SP is not used anymore. When a
definition refers to SP it doesn't mean it literaly now, because here we
redefine (without renaming) the involved M1 macro definitions to operate
on X18 (easier transition; abstraction). INIT_SP is introduced.

The function arguments are passed via stack, so the offset from the Base
Pointer ("depth") to each of them is different now. Changes both to
compiler code (cc_core.c) and libc reflect that the arguments are 8 bytes
(instead of 16 bytes) apart now. Note that SUB_X0_32 and SUB_X0_48 are
removed, because we only need 8, 16 and 24 bytes subtraction to reach the
arguments from asm libc functions. SUB_X0_8 and SUB_X0_24 are introduced.
2020-02-08 00:16:54 +01:00
deesix 4db378437e aarch64: doc and thanks :)
Thanks to Hagfish for proofreading this documentation.

My deepest thanks to Jeremiah Orians for supporting me during the
development of this patch series. Your wisdom and patience is greatly
appreciated.

Thanks to the rest of the #bootstrappable family.

All errors left are mine.
2020-02-01 21:23:49 +01:00
Jeremiah Orians d711438190
Added useful note about how argument and local stack is arranged 2018-10-13 20:15:35 -04:00
Jeremiah Orians 42914441c3
Fixing of ommissions provided by akkartik 2018-08-31 16:11:00 -04:00
Jeremiah Orians 8bb4145fe0
Improving Documentation to help new programmers get functional 2018-05-25 18:37:53 -04:00