1#include "all.h"
2
3int 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};
12int 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
21static int
22arm64_memargs(int op)
23{
24 (void)op;
25 return 0;
26}
27
28Target T_arm64 = {
29 .name = "arm64",
30 .gpr0 = R0,
31 .ngpr = NGPR,
32 .fpr0 = V0,
33 .nfpr = NFPR,
34 .rglob = RGLOB,
35 .nrglob = 3,
36 .rsave = arm64_rsave,
37 .nrsave = {NGPS, NFPS},
38 .retregs = arm64_retregs,
39 .argregs = arm64_argregs,
40 .memargs = arm64_memargs,
41 .abi = arm64_abi,
42 .isel = arm64_isel,
43 .emitfn = arm64_emitfn,
44};
45
46MAKESURE(globals_are_not_arguments,
47 (RGLOB & (BIT(R8+1) - 1)) == 0
48);
49MAKESURE(arrays_size_ok,
50 sizeof arm64_rsave == (NGPS+NFPS+1) * sizeof(int) &&
51 sizeof arm64_rclob == (NCLR+1) * sizeof(int)
52);
53