The PLAtform NEutral Transpiler
Go to file
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
docs aarch64: libc 2020-02-01 21:23:49 +01:00
functions Enabled forgotten cleanup scripts and add logic to catch ?alloc errors 2020-01-25 14:15:45 -05:00
test aarch64: do not generate a wasteful stack anymore 2020-02-08 00:16:54 +01:00
.gitignore Adding support for hardware native and removed unneeded lines in .gitignore 2020-01-31 16:12:34 -05:00
CHANGELOG.org aarch64: do not generate a wasteful stack anymore 2020-02-08 00:16:54 +01:00
HACKING aarch64: do not generate a wasteful stack anymore 2020-02-08 00:16:54 +01:00
INSTALL Fixing of ommissions provided by akkartik 2018-08-31 16:11:00 -04:00
LICENSE Initial commit 2017-11-05 09:01:20 -05:00
README.md correct a perfect typo in README.md 2020-01-24 14:03:07 -05:00
cc-minimal.c Adding support for hardware native and removed unneeded lines in .gitignore 2020-01-31 16:12:34 -05:00
cc.c Release 1.5.0 2020-02-01 16:21:10 -05:00
cc.h aarch64: recognize the new AArch64 target architecture 2020-02-01 21:23:49 +01:00
cc_core.c aarch64: do not generate a wasteful stack anymore 2020-02-08 00:16:54 +01:00
cc_reader.c Enabled forgotten cleanup scripts and add logic to catch ?alloc errors 2020-01-25 14:15:45 -05:00
cc_strings.c Enabled forgotten cleanup scripts and add logic to catch ?alloc errors 2020-01-25 14:15:45 -05:00
cc_types.c aarch64: recognize the new AArch64 target architecture 2020-02-01 21:23:49 +01:00
gcc_req.h Harmonized License headers and added missing license headers 2018-10-17 19:27:06 -04:00
makefile Revised tests to include dwarf stubs 2020-02-01 17:50:26 -05:00
sha256.sh Resolved non-standard behavior across locales thanks to dddddd 2019-04-07 17:11:18 -04:00

README.md

M2-Planet

The PLAtform NEutral Transpiler, when combined with mescc-tools; allows one to compile a subset of the C language into working binaries with introspective steps inbetween.

A lovely set of examples of M2-Planet programs are in tests but the most surprising part of all M2-Planet can self-host M2-Planet.

Further more M2-Planet is cross-platform and self-hosting across platforms with fully deterministic builds enabling perfect reproducibility.

To bootstrap from assembly simple run ./bootstrap-x86.sh after cd into the bootstrap directory (the only requirement is mescc-tools to be installed)

Or if you have no binaries to bootstrap from please use mescc-tools-seed; which will not only bootstrap mescc-tools but also M2-Planet