diff options
Diffstat (limited to 'src/lj_target_arm.h')
-rw-r--r-- | src/lj_target_arm.h | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/src/lj_target_arm.h b/src/lj_target_arm.h index 20e8ad36..ee920f0b 100644 --- a/src/lj_target_arm.h +++ b/src/lj_target_arm.h | |||
@@ -32,7 +32,11 @@ enum { | |||
32 | RID_RET = RID_R0, | 32 | RID_RET = RID_R0, |
33 | RID_RETLO = RID_R0, | 33 | RID_RETLO = RID_R0, |
34 | RID_RETHI = RID_R1, | 34 | RID_RETHI = RID_R1, |
35 | #if LJ_SOFTFP | ||
35 | RID_FPRET = RID_R0, | 36 | RID_FPRET = RID_R0, |
37 | #else | ||
38 | RID_FPRET = RID_D0, | ||
39 | #endif | ||
36 | 40 | ||
37 | /* These definitions must match with the *.dasc file(s): */ | 41 | /* These definitions must match with the *.dasc file(s): */ |
38 | RID_BASE = RID_R9, /* Interpreter BASE. */ | 42 | RID_BASE = RID_R9, /* Interpreter BASE. */ |
@@ -68,11 +72,10 @@ enum { | |||
68 | RID2RSET(RID_R9)|RID2RSET(RID_R11)) | 72 | RID2RSET(RID_R9)|RID2RSET(RID_R11)) |
69 | #if LJ_SOFTFP | 73 | #if LJ_SOFTFP |
70 | #define RSET_FPR 0 | 74 | #define RSET_FPR 0 |
71 | #define RSET_ALL RSET_GPR | ||
72 | #else | 75 | #else |
73 | #define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) | 76 | #define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) |
74 | #define RSET_ALL (RSET_GPR|RSET_FPR) | ||
75 | #endif | 77 | #endif |
78 | #define RSET_ALL (RSET_GPR|RSET_FPR) | ||
76 | #define RSET_INIT RSET_ALL | 79 | #define RSET_INIT RSET_ALL |
77 | 80 | ||
78 | /* ABI-specific register sets. lr is an implicit scratch register. */ | 81 | /* ABI-specific register sets. lr is an implicit scratch register. */ |
@@ -91,6 +94,15 @@ enum { | |||
91 | #define REGARG_FIRSTGPR RID_R0 | 94 | #define REGARG_FIRSTGPR RID_R0 |
92 | #define REGARG_LASTGPR RID_R3 | 95 | #define REGARG_LASTGPR RID_R3 |
93 | #define REGARG_NUMGPR 4 | 96 | #define REGARG_NUMGPR 4 |
97 | #if LJ_ABI_SOFTFP | ||
98 | #define REGARG_FIRSTFPR 0 | ||
99 | #define REGARG_LASTFPR 0 | ||
100 | #define REGARG_NUMFPR 0 | ||
101 | #else | ||
102 | #define REGARG_FIRSTFPR RID_D0 | ||
103 | #define REGARG_LASTFPR RID_D7 | ||
104 | #define REGARG_NUMFPR 8 | ||
105 | #endif | ||
94 | 106 | ||
95 | /* -- Spill slots --------------------------------------------------------- */ | 107 | /* -- Spill slots --------------------------------------------------------- */ |
96 | 108 | ||
@@ -199,6 +211,53 @@ typedef enum ARMIns { | |||
199 | /* ARMv6T2 */ | 211 | /* ARMv6T2 */ |
200 | ARMI_MOVW = 0xe3000000, | 212 | ARMI_MOVW = 0xe3000000, |
201 | ARMI_MOVT = 0xe3400000, | 213 | ARMI_MOVT = 0xe3400000, |
214 | |||
215 | /* VFP */ | ||
216 | ARMI_VMOV_D = 0xeeb00b40, | ||
217 | ARMI_VMOV_S = 0xeeb00a40, | ||
218 | ARMI_VMOVI_D = 0xeeb00b00, | ||
219 | |||
220 | ARMI_VMOV_R_S = 0xee100a10, | ||
221 | ARMI_VMOV_S_R = 0xee000a10, | ||
222 | ARMI_VMOV_RR_D = 0xec500b10, | ||
223 | ARMI_VMOV_D_RR = 0xec400b10, | ||
224 | |||
225 | ARMI_VADD_D = 0xee300b00, | ||
226 | ARMI_VSUB_D = 0xee300b40, | ||
227 | ARMI_VMUL_D = 0xee200b00, | ||
228 | ARMI_VMLA_D = 0xee000b00, | ||
229 | ARMI_VMLS_D = 0xee000b40, | ||
230 | ARMI_VNMLS_D = 0xee100b00, | ||
231 | ARMI_VDIV_D = 0xee800b00, | ||
232 | |||
233 | ARMI_VABS_D = 0xeeb00bc0, | ||
234 | ARMI_VNEG_D = 0xeeb10b40, | ||
235 | ARMI_VSQRT_D = 0xeeb10bc0, | ||
236 | |||
237 | ARMI_VCMP_D = 0xeeb40b40, | ||
238 | ARMI_VCMPZ_D = 0xeeb50b40, | ||
239 | |||
240 | ARMI_VMRS = 0xeef1fa10, | ||
241 | |||
242 | ARMI_VCVT_S32_F32 = 0xeebd0ac0, | ||
243 | ARMI_VCVT_S32_F64 = 0xeebd0bc0, | ||
244 | ARMI_VCVT_U32_F32 = 0xeebc0ac0, | ||
245 | ARMI_VCVT_U32_F64 = 0xeebc0bc0, | ||
246 | ARMI_VCVTR_S32_F32 = 0xeebd0a40, | ||
247 | ARMI_VCVTR_S32_F64 = 0xeebd0b40, | ||
248 | ARMI_VCVTR_U32_F32 = 0xeebc0a40, | ||
249 | ARMI_VCVTR_U32_F64 = 0xeebc0b40, | ||
250 | ARMI_VCVT_F32_S32 = 0xeeb80ac0, | ||
251 | ARMI_VCVT_F64_S32 = 0xeeb80bc0, | ||
252 | ARMI_VCVT_F32_U32 = 0xeeb80a40, | ||
253 | ARMI_VCVT_F64_U32 = 0xeeb80b40, | ||
254 | ARMI_VCVT_F32_F64 = 0xeeb70bc0, | ||
255 | ARMI_VCVT_F64_F32 = 0xeeb70ac0, | ||
256 | |||
257 | ARMI_VLDR_S = 0xed100a00, | ||
258 | ARMI_VLDR_D = 0xed100b00, | ||
259 | ARMI_VSTR_S = 0xed000a00, | ||
260 | ARMI_VSTR_D = 0xed000b00, | ||
202 | } ARMIns; | 261 | } ARMIns; |
203 | 262 | ||
204 | typedef enum ARMShift { | 263 | typedef enum ARMShift { |