MIPS: Add MIPS64 R6 port.

Contributed by Hua Zhang, YunQiang Su from Wave Computing,
and Radovan Birdic from RT-RK.
Sponsored by Wave Computing.
This commit is contained in:
Mike Pall
2020-01-20 22:15:45 +01:00
parent dfa692b746
commit 94d0b53004
15 changed files with 1297 additions and 348 deletions

View File

@@ -223,6 +223,8 @@ typedef enum MIPSIns {
MIPSI_ADDIU = 0x24000000,
MIPSI_SUB = 0x00000022,
MIPSI_SUBU = 0x00000023,
#if !LJ_TARGET_MIPSR6
MIPSI_MUL = 0x70000002,
MIPSI_DIV = 0x0000001a,
MIPSI_DIVU = 0x0000001b,
@@ -232,6 +234,15 @@ typedef enum MIPSIns {
MIPSI_MFHI = 0x00000010,
MIPSI_MFLO = 0x00000012,
MIPSI_MULT = 0x00000018,
#else
MIPSI_MUL = 0x00000098,
MIPSI_MUH = 0x000000d8,
MIPSI_DIV = 0x0000009a,
MIPSI_DIVU = 0x0000009b,
MIPSI_SELEQZ = 0x00000035,
MIPSI_SELNEZ = 0x00000037,
#endif
MIPSI_SLL = 0x00000000,
MIPSI_SRL = 0x00000002,
@@ -253,8 +264,13 @@ typedef enum MIPSIns {
MIPSI_B = 0x10000000,
MIPSI_J = 0x08000000,
MIPSI_JAL = 0x0c000000,
#if !LJ_TARGET_MIPSR6
MIPSI_JALX = 0x74000000,
MIPSI_JR = 0x00000008,
#else
MIPSI_JR = 0x00000009,
MIPSI_BALC = 0xe8000000,
#endif
MIPSI_JALR = 0x0000f809,
MIPSI_BEQ = 0x10000000,
@@ -282,15 +298,23 @@ typedef enum MIPSIns {
/* MIPS64 instructions. */
MIPSI_DADD = 0x0000002c,
MIPSI_DADDI = 0x60000000,
MIPSI_DADDU = 0x0000002d,
MIPSI_DADDIU = 0x64000000,
MIPSI_DSUB = 0x0000002e,
MIPSI_DSUBU = 0x0000002f,
#if !LJ_TARGET_MIPSR6
MIPSI_DDIV = 0x0000001e,
MIPSI_DDIVU = 0x0000001f,
MIPSI_DMULT = 0x0000001c,
MIPSI_DMULTU = 0x0000001d,
#else
MIPSI_DDIV = 0x0000009e,
MIPSI_DMOD = 0x000000de,
MIPSI_DDIVU = 0x0000009f,
MIPSI_DMODU = 0x000000df,
MIPSI_DMUL = 0x0000009c,
MIPSI_DMUH = 0x000000dc,
#endif
MIPSI_DSLL = 0x00000038,
MIPSI_DSRL = 0x0000003a,
@@ -308,6 +332,11 @@ typedef enum MIPSIns {
MIPSI_ASUBU = LJ_32 ? MIPSI_SUBU : MIPSI_DSUBU,
MIPSI_AL = LJ_32 ? MIPSI_LW : MIPSI_LD,
MIPSI_AS = LJ_32 ? MIPSI_SW : MIPSI_SD,
#if LJ_TARGET_MIPSR6
MIPSI_LSA = 0x00000005,
MIPSI_DLSA = 0x00000015,
MIPSI_ALSA = LJ_32 ? MIPSI_LSA : MIPSI_DLSA,
#endif
/* Extract/insert instructions. */
MIPSI_DEXTM = 0x7c000001,
@@ -317,18 +346,19 @@ typedef enum MIPSIns {
MIPSI_DINSU = 0x7c000006,
MIPSI_DINS = 0x7c000007,
MIPSI_RINT_D = 0x4620001a,
MIPSI_RINT_S = 0x4600001a,
MIPSI_RINT = 0x4400001a,
MIPSI_FLOOR_D = 0x4620000b,
MIPSI_CEIL_D = 0x4620000a,
MIPSI_ROUND_D = 0x46200008,
/* FP instructions. */
MIPSI_MOV_S = 0x46000006,
MIPSI_MOV_D = 0x46200006,
#if !LJ_TARGET_MIPSR6
MIPSI_MOVT_D = 0x46210011,
MIPSI_MOVF_D = 0x46200011,
#else
MIPSI_MIN_D = 0x4620001C,
MIPSI_MAX_D = 0x4620001E,
MIPSI_SEL_D = 0x46200010,
#endif
MIPSI_ABS_D = 0x46200005,
MIPSI_NEG_D = 0x46200007,
@@ -363,15 +393,23 @@ typedef enum MIPSIns {
MIPSI_DMTC1 = 0x44a00000,
MIPSI_DMFC1 = 0x44200000,
#if !LJ_TARGET_MIPSR6
MIPSI_BC1F = 0x45000000,
MIPSI_BC1T = 0x45010000,
MIPSI_C_EQ_D = 0x46200032,
MIPSI_C_OLT_S = 0x46000034,
MIPSI_C_OLT_D = 0x46200034,
MIPSI_C_ULT_D = 0x46200035,
MIPSI_C_OLE_D = 0x46200036,
MIPSI_C_ULE_D = 0x46200037,
#else
MIPSI_BC1EQZ = 0x45200000,
MIPSI_BC1NEZ = 0x45a00000,
MIPSI_CMP_EQ_D = 0x46a00002,
MIPSI_CMP_LT_S = 0x46800004,
MIPSI_CMP_LT_D = 0x46a00004,
#endif
} MIPSIns;
#endif