From f677664f63ca17c0a514c449f62ad958b5f9eb68 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Thu, 15 Mar 2018 12:05:57 +0100 Subject: MPPA - The project compiles. Supports very simple programs that load integer immediates. It starts the main, loads integer in registers, and return correctly. Addition in Mach not yet supported, but should not be hard to add them. Function calls are not yet supported. The ABI for now is the same as the RiscV, with a small twist: $ra is first loaded in a user register, then this user register is pushed (instead of pushing $ra straight away). --- test/mppa/Makefile | 26 ++++++++++++++++++++++++++ test/mppa/simple.c | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 test/mppa/Makefile create mode 100644 test/mppa/simple.c (limited to 'test/mppa') diff --git a/test/mppa/Makefile b/test/mppa/Makefile new file mode 100644 index 00000000..6481af5e --- /dev/null +++ b/test/mppa/Makefile @@ -0,0 +1,26 @@ +ELF=simple.bin +DEBUG:=$(if $(DEBUG),"-dall",) + +all: $(ELF) + +%.bin: %.s + k1-gcc $< -o $@ + +.SECONDARY: +%.s: %.c + ccomp $(DEBUG) -v -S $< -o $@ + +.PHONY: +clean: + rm -f *.alloctrace + rm -f *.cm + rm -f *.compcert.c + rm -f *.i + rm -f *.light.c + rm -f *.ltl + rm -f *.mach + rm -f *.parsed.c + rm -f *.rtl.? + rm -f *.s + rm -rf profile/ + rm -f $(ELF) diff --git a/test/mppa/simple.c b/test/mppa/simple.c new file mode 100644 index 00000000..5a54b3d8 --- /dev/null +++ b/test/mppa/simple.c @@ -0,0 +1,6 @@ +int main(void){ + int a = 4; + int b = 3; + + return (a+b); +} -- cgit