add rv64 backend
It is mostly complete, but still has a few ABI bugs when passing floats in structs, or when structs are passed partly in register, and partly on stack.
This commit is contained in:
parent
8e040d5861
commit
4e93eeaa3b
13 changed files with 1656 additions and 128 deletions
14
Makefile
14
Makefile
|
@ -7,11 +7,13 @@ SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \
|
|||
fold.c live.c spill.c rega.c gas.c
|
||||
AMD64SRC = amd64/targ.c amd64/sysv.c amd64/isel.c amd64/emit.c
|
||||
ARM64SRC = arm64/targ.c arm64/abi.c arm64/isel.c arm64/emit.c
|
||||
SRCALL = $(SRC) $(AMD64SRC) $(ARM64SRC)
|
||||
RV64SRC = rv64/targ.c rv64/abi.c rv64/isel.c rv64/emit.c
|
||||
SRCALL = $(SRC) $(AMD64SRC) $(ARM64SRC) $(RV64SRC)
|
||||
|
||||
AMD64OBJ = $(AMD64SRC:%.c=$(OBJDIR)/%.o)
|
||||
ARM64OBJ = $(ARM64SRC:%.c=$(OBJDIR)/%.o)
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ)
|
||||
RV64OBJ = $(RV64SRC:%.c=$(OBJDIR)/%.o)
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) $(RV64OBJ)
|
||||
|
||||
CFLAGS += -Wall -Wextra -std=c99 -g -pedantic
|
||||
|
||||
|
@ -27,11 +29,13 @@ $(OBJDIR)/timestamp:
|
|||
@mkdir -p $(OBJDIR)
|
||||
@mkdir -p $(OBJDIR)/amd64
|
||||
@mkdir -p $(OBJDIR)/arm64
|
||||
@mkdir -p $(OBJDIR)/rv64
|
||||
@touch $@
|
||||
|
||||
$(OBJ): all.h ops.h
|
||||
$(AMD64OBJ): amd64/all.h
|
||||
$(ARM64OBJ): arm64/all.h
|
||||
$(RV64OBJ): rv64/all.h
|
||||
$(OBJDIR)/main.o: config.h
|
||||
|
||||
config.h:
|
||||
|
@ -46,6 +50,9 @@ config.h:
|
|||
*aarch64*) \
|
||||
echo "#define Deftgt T_arm64"; \
|
||||
;; \
|
||||
*riscv64*) \
|
||||
echo "#define Deftgt T_rv64"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "#define Deftgt T_amd64_sysv";\
|
||||
;; \
|
||||
|
@ -72,6 +79,9 @@ check: $(OBJDIR)/$(BIN)
|
|||
check-arm64: $(OBJDIR)/$(BIN)
|
||||
TARGET=arm64 tools/test.sh all
|
||||
|
||||
check-rv64: $(OBJDIR)/$(BIN)
|
||||
TARGET=rv64 tools/test.sh all
|
||||
|
||||
src:
|
||||
@echo $(SRCALL)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue