summaryrefslogtreecommitdiff
path: root/src/lj_target_mips.h
diff options
context:
space:
mode:
authorMike Pall <mike>2020-01-20 22:15:45 +0100
committerMike Pall <mike>2020-01-20 22:15:45 +0100
commit94d0b53004a5fa368defa4307a17edcdb87fe727 (patch)
tree2468fb7d60f39ccadcd696d333c83ef49f3dfc02 /src/lj_target_mips.h
parentdfa692b746c9de067857d5fc992a41730be3d99a (diff)
downloadluajit-94d0b53004a5fa368defa4307a17edcdb87fe727.tar.gz
luajit-94d0b53004a5fa368defa4307a17edcdb87fe727.tar.bz2
luajit-94d0b53004a5fa368defa4307a17edcdb87fe727.zip
MIPS: Add MIPS64 R6 port.
Contributed by Hua Zhang, YunQiang Su from Wave Computing, and Radovan Birdic from RT-RK. Sponsored by Wave Computing.
Diffstat (limited to 'src/lj_target_mips.h')
-rw-r--r--src/lj_target_mips.h52
1 files changed, 45 insertions, 7 deletions
diff --git a/src/lj_target_mips.h b/src/lj_target_mips.h
index 740687b3..84db6012 100644
--- a/src/lj_target_mips.h
+++ b/src/lj_target_mips.h
@@ -223,6 +223,8 @@ typedef enum MIPSIns {
223 MIPSI_ADDIU = 0x24000000, 223 MIPSI_ADDIU = 0x24000000,
224 MIPSI_SUB = 0x00000022, 224 MIPSI_SUB = 0x00000022,
225 MIPSI_SUBU = 0x00000023, 225 MIPSI_SUBU = 0x00000023,
226
227#if !LJ_TARGET_MIPSR6
226 MIPSI_MUL = 0x70000002, 228 MIPSI_MUL = 0x70000002,
227 MIPSI_DIV = 0x0000001a, 229 MIPSI_DIV = 0x0000001a,
228 MIPSI_DIVU = 0x0000001b, 230 MIPSI_DIVU = 0x0000001b,
@@ -232,6 +234,15 @@ typedef enum MIPSIns {
232 MIPSI_MFHI = 0x00000010, 234 MIPSI_MFHI = 0x00000010,
233 MIPSI_MFLO = 0x00000012, 235 MIPSI_MFLO = 0x00000012,
234 MIPSI_MULT = 0x00000018, 236 MIPSI_MULT = 0x00000018,
237#else
238 MIPSI_MUL = 0x00000098,
239 MIPSI_MUH = 0x000000d8,
240 MIPSI_DIV = 0x0000009a,
241 MIPSI_DIVU = 0x0000009b,
242
243 MIPSI_SELEQZ = 0x00000035,
244 MIPSI_SELNEZ = 0x00000037,
245#endif
235 246
236 MIPSI_SLL = 0x00000000, 247 MIPSI_SLL = 0x00000000,
237 MIPSI_SRL = 0x00000002, 248 MIPSI_SRL = 0x00000002,
@@ -253,8 +264,13 @@ typedef enum MIPSIns {
253 MIPSI_B = 0x10000000, 264 MIPSI_B = 0x10000000,
254 MIPSI_J = 0x08000000, 265 MIPSI_J = 0x08000000,
255 MIPSI_JAL = 0x0c000000, 266 MIPSI_JAL = 0x0c000000,
267#if !LJ_TARGET_MIPSR6
256 MIPSI_JALX = 0x74000000, 268 MIPSI_JALX = 0x74000000,
257 MIPSI_JR = 0x00000008, 269 MIPSI_JR = 0x00000008,
270#else
271 MIPSI_JR = 0x00000009,
272 MIPSI_BALC = 0xe8000000,
273#endif
258 MIPSI_JALR = 0x0000f809, 274 MIPSI_JALR = 0x0000f809,
259 275
260 MIPSI_BEQ = 0x10000000, 276 MIPSI_BEQ = 0x10000000,
@@ -282,15 +298,23 @@ typedef enum MIPSIns {
282 298
283 /* MIPS64 instructions. */ 299 /* MIPS64 instructions. */
284 MIPSI_DADD = 0x0000002c, 300 MIPSI_DADD = 0x0000002c,
285 MIPSI_DADDI = 0x60000000,
286 MIPSI_DADDU = 0x0000002d, 301 MIPSI_DADDU = 0x0000002d,
287 MIPSI_DADDIU = 0x64000000, 302 MIPSI_DADDIU = 0x64000000,
288 MIPSI_DSUB = 0x0000002e, 303 MIPSI_DSUB = 0x0000002e,
289 MIPSI_DSUBU = 0x0000002f, 304 MIPSI_DSUBU = 0x0000002f,
305#if !LJ_TARGET_MIPSR6
290 MIPSI_DDIV = 0x0000001e, 306 MIPSI_DDIV = 0x0000001e,
291 MIPSI_DDIVU = 0x0000001f, 307 MIPSI_DDIVU = 0x0000001f,
292 MIPSI_DMULT = 0x0000001c, 308 MIPSI_DMULT = 0x0000001c,
293 MIPSI_DMULTU = 0x0000001d, 309 MIPSI_DMULTU = 0x0000001d,
310#else
311 MIPSI_DDIV = 0x0000009e,
312 MIPSI_DMOD = 0x000000de,
313 MIPSI_DDIVU = 0x0000009f,
314 MIPSI_DMODU = 0x000000df,
315 MIPSI_DMUL = 0x0000009c,
316 MIPSI_DMUH = 0x000000dc,
317#endif
294 318
295 MIPSI_DSLL = 0x00000038, 319 MIPSI_DSLL = 0x00000038,
296 MIPSI_DSRL = 0x0000003a, 320 MIPSI_DSRL = 0x0000003a,
@@ -308,6 +332,11 @@ typedef enum MIPSIns {
308 MIPSI_ASUBU = LJ_32 ? MIPSI_SUBU : MIPSI_DSUBU, 332 MIPSI_ASUBU = LJ_32 ? MIPSI_SUBU : MIPSI_DSUBU,
309 MIPSI_AL = LJ_32 ? MIPSI_LW : MIPSI_LD, 333 MIPSI_AL = LJ_32 ? MIPSI_LW : MIPSI_LD,
310 MIPSI_AS = LJ_32 ? MIPSI_SW : MIPSI_SD, 334 MIPSI_AS = LJ_32 ? MIPSI_SW : MIPSI_SD,
335#if LJ_TARGET_MIPSR6
336 MIPSI_LSA = 0x00000005,
337 MIPSI_DLSA = 0x00000015,
338 MIPSI_ALSA = LJ_32 ? MIPSI_LSA : MIPSI_DLSA,
339#endif
311 340
312 /* Extract/insert instructions. */ 341 /* Extract/insert instructions. */
313 MIPSI_DEXTM = 0x7c000001, 342 MIPSI_DEXTM = 0x7c000001,
@@ -317,18 +346,19 @@ typedef enum MIPSIns {
317 MIPSI_DINSU = 0x7c000006, 346 MIPSI_DINSU = 0x7c000006,
318 MIPSI_DINS = 0x7c000007, 347 MIPSI_DINS = 0x7c000007,
319 348
320 MIPSI_RINT_D = 0x4620001a,
321 MIPSI_RINT_S = 0x4600001a,
322 MIPSI_RINT = 0x4400001a,
323 MIPSI_FLOOR_D = 0x4620000b, 349 MIPSI_FLOOR_D = 0x4620000b,
324 MIPSI_CEIL_D = 0x4620000a,
325 MIPSI_ROUND_D = 0x46200008,
326 350
327 /* FP instructions. */ 351 /* FP instructions. */
328 MIPSI_MOV_S = 0x46000006, 352 MIPSI_MOV_S = 0x46000006,
329 MIPSI_MOV_D = 0x46200006, 353 MIPSI_MOV_D = 0x46200006,
354#if !LJ_TARGET_MIPSR6
330 MIPSI_MOVT_D = 0x46210011, 355 MIPSI_MOVT_D = 0x46210011,
331 MIPSI_MOVF_D = 0x46200011, 356 MIPSI_MOVF_D = 0x46200011,
357#else
358 MIPSI_MIN_D = 0x4620001C,
359 MIPSI_MAX_D = 0x4620001E,
360 MIPSI_SEL_D = 0x46200010,
361#endif
332 362
333 MIPSI_ABS_D = 0x46200005, 363 MIPSI_ABS_D = 0x46200005,
334 MIPSI_NEG_D = 0x46200007, 364 MIPSI_NEG_D = 0x46200007,
@@ -363,15 +393,23 @@ typedef enum MIPSIns {
363 MIPSI_DMTC1 = 0x44a00000, 393 MIPSI_DMTC1 = 0x44a00000,
364 MIPSI_DMFC1 = 0x44200000, 394 MIPSI_DMFC1 = 0x44200000,
365 395
396#if !LJ_TARGET_MIPSR6
366 MIPSI_BC1F = 0x45000000, 397 MIPSI_BC1F = 0x45000000,
367 MIPSI_BC1T = 0x45010000, 398 MIPSI_BC1T = 0x45010000,
368
369 MIPSI_C_EQ_D = 0x46200032, 399 MIPSI_C_EQ_D = 0x46200032,
370 MIPSI_C_OLT_S = 0x46000034, 400 MIPSI_C_OLT_S = 0x46000034,
371 MIPSI_C_OLT_D = 0x46200034, 401 MIPSI_C_OLT_D = 0x46200034,
372 MIPSI_C_ULT_D = 0x46200035, 402 MIPSI_C_ULT_D = 0x46200035,
373 MIPSI_C_OLE_D = 0x46200036, 403 MIPSI_C_OLE_D = 0x46200036,
374 MIPSI_C_ULE_D = 0x46200037, 404 MIPSI_C_ULE_D = 0x46200037,
405#else
406 MIPSI_BC1EQZ = 0x45200000,
407 MIPSI_BC1NEZ = 0x45a00000,
408 MIPSI_CMP_EQ_D = 0x46a00002,
409 MIPSI_CMP_LT_S = 0x46800004,
410 MIPSI_CMP_LT_D = 0x46a00004,
411#endif
412
375} MIPSIns; 413} MIPSIns;
376 414
377#endif 415#endif