qbe

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

targ.c (997B)


      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 Target T_arm64 = {
     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 	.abi = arm64_abi,
     41 	.isel = arm64_isel,
     42 	.emitfn = arm64_emitfn,
     43 };
     44 
     45 MAKESURE(globals_are_not_arguments,
     46 	(RGLOB & (BIT(R8+1) - 1)) == 0
     47 );
     48 MAKESURE(arrays_size_ok,
     49 	sizeof arm64_rsave == (NGPS+NFPS+1) * sizeof(int) &&
     50 	sizeof arm64_rclob == (NCLR+1) * sizeof(int)
     51 );