Commit | Line | Data |
---|---|---|
4a71579b PC |
1 | /* |
2 | * Copyright (C) 2014-2019 Free Software Foundation, Inc. | |
3 | * | |
4 | * This file is part of GNU lightning. | |
5 | * | |
6 | * GNU lightning is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU Lesser General Public License as published | |
8 | * by the Free Software Foundation; either version 3, or (at your option) | |
9 | * any later version. | |
10 | * | |
11 | * GNU lightning is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
14 | * License for more details. | |
15 | * | |
16 | * Authors: | |
17 | * Paulo Cesar Pereira de Andrade | |
18 | */ | |
19 | ||
20 | #ifndef _jit_alpha_h | |
21 | #define _jit_alpha_h | |
22 | ||
23 | #define JIT_HASH_CONSTS 1 | |
24 | #define JIT_NUM_OPERANDS 3 | |
25 | ||
26 | /* | |
27 | * Types | |
28 | */ | |
29 | #define JIT_FP _FP | |
30 | typedef enum { | |
31 | #define jit_r(i) (_S0 + (i)) | |
32 | #define jit_r_num() 3 | |
33 | #define jit_v(i) (_S3 + (i)) | |
34 | #define jit_v_num() 3 | |
35 | #define jit_f(i) (_F2 + (i)) | |
36 | #define jit_f_num() 8 | |
37 | /* Volatile - Assembly temporary register */ | |
38 | _AT, | |
39 | /* Volatile - Return value register */ | |
40 | _V0, | |
41 | /* Volatile - Temporary registers */ | |
42 | _T0, _T1, _T2, _T3, | |
43 | _T4, _T5, _T6, _T7, | |
44 | _T8, _T9, _T10, _T11, | |
45 | /* FIXME Use callee save register for r0-r2 (instead of 12+ JIT_RN | |
46 | * and 6 JIT_VN because division must call a function) | |
47 | * FIX would be to create proper functions that do not clobber | |
48 | * registers and inject/inline them in the jit */ | |
49 | #define JIT_R0 _S0 | |
50 | #define JIT_R1 _S1 | |
51 | #define JIT_R2 _S2 | |
52 | #define JIT_V0 _S3 | |
53 | #define JIT_V1 _S4 | |
54 | #define JIT_V2 _S5 | |
55 | /* Nonvolatile - Saved registers */ | |
56 | _S0, _S1, _S2, _S3, | |
57 | _S4, _S5, | |
58 | /* Nonvolatile - Frame pointer */ | |
59 | _FP, | |
60 | /* Volatile - Argument registers */ | |
61 | _A5, _A4, _A3, _A2, | |
62 | _A1, _A0, | |
63 | /* Volatile - Return address register */ | |
64 | _RA, | |
65 | /* Volatile - Temporary register */ | |
66 | _PV, | |
67 | /* Nonvolatile - Global pointer */ | |
68 | _GP, | |
69 | /* Nonvolatile - Stack pointer */ | |
70 | _SP, | |
71 | /* Constant RAZ / writes ignored */ | |
72 | _ZERO, | |
73 | #define JIT_F0 _F2 | |
74 | #define JIT_F1 _F3 | |
75 | #define JIT_F2 _F4 | |
76 | #define JIT_F3 _F5 | |
77 | #define JIT_F4 _F6 | |
78 | #define JIT_F5 _F7 | |
79 | #define JIT_F6 _F8 | |
80 | #define JIT_F7 _F9 | |
81 | /* Volatile - Return value register (real part) */ | |
82 | _F0, | |
83 | /* Volatile - Return value register (imaginary part) */ | |
84 | _F1, | |
85 | /* Nonvolatile - Saved registers */ | |
86 | _F2, _F3, _F4, _F5, | |
87 | _F6, _F7, _F8, _F9, | |
88 | /* Volatile - Temporary registers */ | |
89 | _F10, _F11, _F12, _F13, | |
90 | _F14, _F15, | |
91 | /* Volatile - Argument registers */ | |
92 | _F21, _F20, _F19, _F18, | |
93 | _F17, _F16, | |
94 | /* Volatile - Temporary registers */ | |
95 | _F22, _F23, _R24, _F25, | |
96 | _F26, _F27, _F28, _F29, | |
97 | _F30, | |
98 | /* Constant - RAZ / writes ignored */ | |
99 | _F31, | |
100 | /* Lightning internal invalid register identifier */ | |
101 | _NOREG, | |
102 | #define JIT_NOREG _NOREG | |
103 | } jit_reg_t; | |
104 | ||
105 | #endif /* _jit_alpha_h */ |