mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-26 16:29:37 -04:00
sh2 drc: add aarch64 backend for A64
This commit is contained in:
parent
d80a5fd2ab
commit
b90e104fc9
5 changed files with 1404 additions and 6 deletions
15
Makefile
15
Makefile
|
|
@ -49,15 +49,18 @@ asm_cdmemory ?= 1
|
||||||
asm_mix ?= 1
|
asm_mix ?= 1
|
||||||
asm_32xdraw ?= 1
|
asm_32xdraw ?= 1
|
||||||
asm_32xmemory ?= 1
|
asm_32xmemory ?= 1
|
||||||
else # if not arm
|
else ifneq (,$(findstring 86,$(ARCH)))
|
||||||
use_fame ?= 1
|
use_fame ?= 1
|
||||||
use_cz80 ?= 1
|
use_cz80 ?= 1
|
||||||
ifneq (,$(findstring 86,$(ARCH)))
|
|
||||||
use_sh2drc ?= 1
|
use_sh2drc ?= 1
|
||||||
endif
|
else ifneq (,$(findstring mips,$(ARCH)))
|
||||||
ifneq (,$(findstring mips,$(ARCH)))
|
use_fame ?= 1
|
||||||
|
use_cz80 ?= 1
|
||||||
|
use_sh2drc ?= 1
|
||||||
|
else ifneq (,$(findstring aarch64,$(ARCH)))
|
||||||
|
use_fame ?= 1
|
||||||
|
use_cz80 ?= 1
|
||||||
use_sh2drc ?= 1
|
use_sh2drc ?= 1
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
-include Makefile.local
|
-include Makefile.local
|
||||||
|
|
@ -247,7 +250,7 @@ pico/carthw_cfg.c: pico/carthw.cfg
|
||||||
|
|
||||||
# random deps
|
# random deps
|
||||||
pico/carthw/svp/compiler.o : cpu/drc/emit_arm.c
|
pico/carthw/svp/compiler.o : cpu/drc/emit_arm.c
|
||||||
cpu/sh2/compiler.o : cpu/drc/emit_arm.c
|
cpu/sh2/compiler.o : cpu/drc/emit_arm.c cpu/drc/emit_arm64.c
|
||||||
cpu/sh2/compiler.o : cpu/drc/emit_x86.c cpu/drc/emit_mips.c
|
cpu/sh2/compiler.o : cpu/drc/emit_x86.c cpu/drc/emit_mips.c
|
||||||
cpu/sh2/mame/sh2pico.o : cpu/sh2/mame/sh2.c
|
cpu/sh2/mame/sh2pico.o : cpu/sh2/mame/sh2.c
|
||||||
pico/pico.o pico/cd/mcd.o pico/32x/32x.o : pico/pico_cmn.c pico/pico_int.h
|
pico/pico.o pico/cd/mcd.o pico/32x/32x.o : pico/pico_cmn.c pico/pico_int.h
|
||||||
|
|
|
||||||
15
config.aarch64
Normal file
15
config.aarch64
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Automatically generated by configure
|
||||||
|
# Configured with: './configure' '--platform=generic'
|
||||||
|
CC = aarch64-linux-gnu-gcc
|
||||||
|
CXX = aarch64-linux-gnu-g++
|
||||||
|
AS = aarch64-linux-gnu-as
|
||||||
|
STRIP = aarch64-linux-gnu-strip
|
||||||
|
CFLAGS += -I/usr/include/SDL
|
||||||
|
CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT -Wno-unused-result -fno-stack-protector
|
||||||
|
ASFLAGS +=
|
||||||
|
LDFLAGS +=
|
||||||
|
LDLIBS += -lSDL -lasound -lpng -lz -lm -lstdc++ -ldl
|
||||||
|
|
||||||
|
ARCH = aarch64
|
||||||
|
PLATFORM = generic
|
||||||
|
SOUND_DRIVERS = alsa
|
||||||
1328
cpu/drc/emit_arm64.c
Normal file
1328
cpu/drc/emit_arm64.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -466,6 +466,56 @@ static cache_reg_t cache_regs[] = {
|
||||||
{ 7, HRF_REG },
|
{ 7, HRF_REG },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
#include "../drc/emit_arm64.c"
|
||||||
|
|
||||||
|
static guest_reg_t guest_regs[] = {
|
||||||
|
// SHR_R0 .. SHR_SP
|
||||||
|
{ GRF_STATIC,20 }, { GRF_STATIC,21 }, { 0 } , { 0 } ,
|
||||||
|
{ 0 } , { 0 } , { 0 } , { 0 } ,
|
||||||
|
{ 0 } , { 0 } , { 0 } , { 0 } ,
|
||||||
|
{ 0 } , { 0 } , { 0 } , { 0 } ,
|
||||||
|
// SHR_PC, SHR_PPC, SHR_PR, SHR_SR,
|
||||||
|
// SHR_GBR, SHR_VBR, SHR_MACH, SHR_MACL,
|
||||||
|
{ 0 } , { 0 } , { 0 } , { GRF_STATIC, 22 },
|
||||||
|
{ 0 } , { 0 } , { 0 } , { 0 } ,
|
||||||
|
};
|
||||||
|
|
||||||
|
// AAPCS64: params: r0-r7, return: r0-r1, temp: r8-r17, saved: r19-r29
|
||||||
|
// saved: r18 (for platform use)
|
||||||
|
// since drc never needs more than 4 parameters, r4-r7 are treated as temp.
|
||||||
|
static cache_reg_t cache_regs[] = {
|
||||||
|
{ 17, HRF_TEMP }, // temps
|
||||||
|
{ 16, HRF_TEMP },
|
||||||
|
{ 15, HRF_TEMP },
|
||||||
|
{ 14, HRF_TEMP },
|
||||||
|
{ 13, HRF_TEMP },
|
||||||
|
{ 12, HRF_TEMP },
|
||||||
|
{ 11, HRF_TEMP },
|
||||||
|
{ 10, HRF_TEMP },
|
||||||
|
{ 9, HRF_TEMP },
|
||||||
|
{ 8, HRF_TEMP },
|
||||||
|
{ 7, HRF_TEMP },
|
||||||
|
{ 6, HRF_TEMP },
|
||||||
|
{ 5, HRF_TEMP },
|
||||||
|
{ 4, HRF_TEMP },
|
||||||
|
{ 3, HRF_TEMP }, // params
|
||||||
|
{ 2, HRF_TEMP },
|
||||||
|
{ 1, HRF_TEMP },
|
||||||
|
{ 0, HRF_TEMP }, // RET_REG
|
||||||
|
{ 22, HRF_LOCKED }, // statics
|
||||||
|
{ 21, HRF_LOCKED },
|
||||||
|
{ 20, HRF_LOCKED },
|
||||||
|
{ 29, HRF_REG }, // other regs
|
||||||
|
{ 28, HRF_REG },
|
||||||
|
{ 27, HRF_REG },
|
||||||
|
{ 26, HRF_REG },
|
||||||
|
{ 25, HRF_REG },
|
||||||
|
{ 24, HRF_REG },
|
||||||
|
{ 23, HRF_REG },
|
||||||
|
{ 22, HRF_REG },
|
||||||
|
};
|
||||||
|
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
#include "../drc/emit_mips.c"
|
#include "../drc/emit_mips.c"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ unsigned short scan_block(unsigned int base_pc, int is_slave,
|
||||||
// XXX MUST match definitions in cpu/sh2/compiler.c
|
// XXX MUST match definitions in cpu/sh2/compiler.c
|
||||||
#if defined(__arm__)
|
#if defined(__arm__)
|
||||||
#define DRC_SR_REG r10
|
#define DRC_SR_REG r10
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
#define DRC_SR_REG r22
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
#define DRC_SR_REG s6
|
#define DRC_SR_REG s6
|
||||||
#elif defined(__i386__)
|
#elif defined(__i386__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue