1#include "../all.h"
2
3typedef struct Rv64Op Rv64Op;
4
5enum Rv64Reg {
6 /* caller-save */
7 T0 = RXX + 1, T1, T2, T3, T4, T5,
8 A0, A1, A2, A3, A4, A5, A6, A7,
9
10 /* callee-save */
11 S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11,
12
13 /* globally live */
14 FP, SP, GP, TP, RA,
15
16 /* FP caller-save */
17 FT0, FT1, FT2, FT3, FT4, FT5, FT6, FT7, FT8, FT9, FT10,
18 FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7,
19
20 /* FP callee-save */
21 FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7, FS8, FS9, FS10, FS11,
22
23 /* reserved (see rv64/emit.c) */
24 T6, FT11,
25
26 NFPR = FS11 - FT0 + 1,
27 NGPR = RA - T0 + 1,
28 NGPS = A7 - T0 + 1,
29 NFPS = FA7 - FT0 + 1,
30 NCLR = (S11 - S1 + 1) + (FS11 - FS0 + 1),
31};
32MAKESURE(reg_not_tmp, FT11 < (int)Tmp0);
33
34struct Rv64Op {
35 char imm;
36};
37
38/* targ.c */
39extern int rv64_rsave[];
40extern int rv64_rclob[];
41extern Rv64Op rv64_op[];
42
43/* abi.c */
44bits rv64_retregs(Ref, int[2]);
45bits rv64_argregs(Ref, int[2]);
46void rv64_abi(Fn *);
47
48/* isel.c */
49void rv64_isel(Fn *);
50
51/* emit.c */
52void rv64_emitfn(Fn *, FILE *);
53