qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

targ.c (1299B)


      1 #include "all.h"
      2 
      3 int arm64_rsave[] = {
      4 	R0,  R1,  R2,  R3,  R4,  R5,  R6,  R7,
      5 	R8,  R9,  R10, R11, R12, R13, R14, R15,
      6 	IP0, IP1, R18, LR,
      7 	V0,  V1,  V2,  V3,  V4,  V5,  V6,  V7,
      8 	V16, V17, V18, V19, V20, V21, V22, V23,
      9 	V24, V25, V26, V27, V28, V29, V30,
     10 	-1
     11 };
     12 int arm64_rclob[] = {
     13 	R19, R20, R21, R22, R23, R24, R25, R26,
     14 	R27, R28,
     15 	V8,  V9,  V10, V11, V12, V13, V14, V15,
     16 	-1
     17 };
     18 
     19 #define RGLOB (BIT(FP) | BIT(SP) | BIT(R18))
     20 
     21 static int
     22 arm64_memargs(int op)
     23 {
     24 	(void)op;
     25 	return 0;
     26 }
     27 
     28 #define ARM64_COMMON \
     29 	.gpr0 = R0, \
     30 	.ngpr = NGPR, \
     31 	.fpr0 = V0, \
     32 	.nfpr = NFPR, \
     33 	.rglob = RGLOB, \
     34 	.nrglob = 3, \
     35 	.rsave = arm64_rsave, \
     36 	.nrsave = {NGPS, NFPS}, \
     37 	.retregs = arm64_retregs, \
     38 	.argregs = arm64_argregs, \
     39 	.memargs = arm64_memargs, \
     40 	.isel = arm64_isel, \
     41 	.abi1 = arm64_abi, \
     42 	.emitfn = arm64_emitfn, \
     43 
     44 Target T_arm64 = {
     45 	.name = "arm64",
     46 	.abi0 = elimsb,
     47 	.emitfin = elf_emitfin,
     48 	.asloc = ".L",
     49 	ARM64_COMMON
     50 };
     51 
     52 Target T_arm64_apple = {
     53 	.name = "arm64_apple",
     54 	.apple = 1,
     55 	.abi0 = apple_extsb,
     56 	.emitfin = macho_emitfin,
     57 	.asloc = "L",
     58 	.assym = "_",
     59 	ARM64_COMMON
     60 };
     61 
     62 MAKESURE(globals_are_not_arguments,
     63 	(RGLOB & (BIT(R8+1) - 1)) == 0
     64 );
     65 MAKESURE(arrays_size_ok,
     66 	sizeof arm64_rsave == (NGPS+NFPS+1) * sizeof(int) &&
     67 	sizeof arm64_rclob == (NCLR+1) * sizeof(int)
     68 );