1#include "all.h"
2
3Rv64Op rv64_op[NOp] = {
4#define O(op, t, x) [O##op] =
5#define V(imm) { imm },
6#include "../ops.h"
7};
8
9int rv64_rsave[] = {
10 T0, T1, T2, T3, T4, T5,
11 A0, A1, A2, A3, A4, A5, A6, A7,
12 FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7,
13 FT0, FT1, FT2, FT3, FT4, FT5, FT6, FT7,
14 FT8, FT9, FT10,
15 -1
16};
17int rv64_rclob[] = {
18 S1, S2, S3, S4, S5, S6, S7,
19 S8, S9, S10, S11,
20 FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7,
21 FS8, FS9, FS10, FS11,
22 -1
23};
24
25#define RGLOB (BIT(FP) | BIT(SP) | BIT(GP) | BIT(TP) | BIT(RA))
26
27static int
28rv64_memargs(int op)
29{
30 (void)op;
31 return 0;
32}
33
34Target T_rv64 = {
35 .name = "rv64",
36 .gpr0 = T0,
37 .ngpr = NGPR,
38 .fpr0 = FT0,
39 .nfpr = NFPR,
40 .rglob = RGLOB,
41 .nrglob = 5,
42 .rsave = rv64_rsave,
43 .nrsave = {NGPS, NFPS},
44 .retregs = rv64_retregs,
45 .argregs = rv64_argregs,
46 .memargs = rv64_memargs,
47 .abi = rv64_abi,
48 .isel = rv64_isel,
49 .emitfn = rv64_emitfn,
50};
51
52MAKESURE(rsave_size_ok, sizeof rv64_rsave == (NGPS+NFPS+1) * sizeof(int));
53MAKESURE(rclob_size_ok, sizeof rv64_rclob == (NCLR+1) * sizeof(int));
54