Index: src/mips64/constants-mips64.h |
diff --git a/src/mips64/constants-mips64.h b/src/mips64/constants-mips64.h |
index 38e5aa3dd176d5d978844ec3326d2886ebfc82f6..d3dd31da584bfaf82c5d056deb3105bd2836441d 100644 |
--- a/src/mips64/constants-mips64.h |
+++ b/src/mips64/constants-mips64.h |
@@ -17,21 +17,17 @@ |
#define UNSUPPORTED_MIPS() v8::internal::PrintF("Unsupported instruction.\n") |
enum ArchVariants { |
- kMips32r2, |
- kMips32r1, |
- kLoongson, |
- kMips64r2 |
+ kMips64r2, |
+ kMips64r6 |
}; |
#ifdef _MIPS_ARCH_MIPS64R2 |
static const ArchVariants kArchVariant = kMips64r2; |
-#elif _MIPS_ARCH_LOONGSON |
-// The loongson flag refers to the LOONGSON architectures based on MIPS-III, |
-// which predates (and is a subset of) the mips32r2 and r1 architectures. |
- static const ArchVariants kArchVariant = kLoongson; |
+#elif _MIPS_ARCH_MIPS64R6 |
+ static const ArchVariants kArchVariant = kMips64r6; |
#else |
- static const ArchVariants kArchVariant = kMips64r1; |
+ static const ArchVariants kArchVariant = kMips64r2; |
#endif |
@@ -228,6 +224,8 @@ const int kLuiShift = 16; |
const int kImm16Shift = 0; |
const int kImm16Bits = 16; |
+const int kImm21Shift = 0; |
+const int kImm21Bits = 21; |
const int kImm26Shift = 0; |
const int kImm26Bits = 26; |
const int kImm28Shift = 0; |
@@ -295,15 +293,17 @@ enum Opcode { |
ANDI = ((1 << 3) + 4) << kOpcodeShift, |
ORI = ((1 << 3) + 5) << kOpcodeShift, |
XORI = ((1 << 3) + 6) << kOpcodeShift, |
- LUI = ((1 << 3) + 7) << kOpcodeShift, |
+ LUI = ((1 << 3) + 7) << kOpcodeShift, // LUI/AUI family. |
+ DAUI = ((3 << 3) + 5) << kOpcodeShift, |
+ BEQC = ((2 << 3) + 0) << kOpcodeShift, |
COP1 = ((2 << 3) + 1) << kOpcodeShift, // Coprocessor 1 class. |
BEQL = ((2 << 3) + 4) << kOpcodeShift, |
BNEL = ((2 << 3) + 5) << kOpcodeShift, |
BLEZL = ((2 << 3) + 6) << kOpcodeShift, |
BGTZL = ((2 << 3) + 7) << kOpcodeShift, |
- DADDI = ((3 << 3) + 0) << kOpcodeShift, |
+ DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC. |
DADDIU = ((3 << 3) + 1) << kOpcodeShift, |
LDL = ((3 << 3) + 2) << kOpcodeShift, |
LDR = ((3 << 3) + 3) << kOpcodeShift, |
@@ -330,6 +330,7 @@ enum Opcode { |
LWC1 = ((6 << 3) + 1) << kOpcodeShift, |
LLD = ((6 << 3) + 4) << kOpcodeShift, |
LDC1 = ((6 << 3) + 5) << kOpcodeShift, |
+ BEQZC = ((6 << 3) + 6) << kOpcodeShift, |
LD = ((6 << 3) + 7) << kOpcodeShift, |
PREF = ((6 << 3) + 3) << kOpcodeShift, |
@@ -337,6 +338,7 @@ enum Opcode { |
SWC1 = ((7 << 3) + 1) << kOpcodeShift, |
SCD = ((7 << 3) + 4) << kOpcodeShift, |
SDC1 = ((7 << 3) + 5) << kOpcodeShift, |
+ BNEZC = ((7 << 3) + 6) << kOpcodeShift, |
SD = ((7 << 3) + 7) << kOpcodeShift, |
COP1X = ((1 << 4) + 3) << kOpcodeShift |
@@ -359,6 +361,8 @@ enum SecondaryField { |
BREAK = ((1 << 3) + 5), |
MFHI = ((2 << 3) + 0), |
+ CLZ_R6 = ((2 << 3) + 0), |
+ CLO_R6 = ((2 << 3) + 1), |
MFLO = ((2 << 3) + 2), |
DSLLV = ((2 << 3) + 4), |
DSRLV = ((2 << 3) + 6), |
@@ -394,7 +398,9 @@ enum SecondaryField { |
TLT = ((6 << 3) + 2), |
TLTU = ((6 << 3) + 3), |
TEQ = ((6 << 3) + 4), |
+ SELEQZ_S = ((6 << 3) + 5), |
TNE = ((6 << 3) + 6), |
+ SELNEZ_S = ((6 << 3) + 7), |
DSLL = ((7 << 3) + 0), |
DSRL = ((7 << 3) + 2), |
@@ -402,6 +408,23 @@ enum SecondaryField { |
DSLL32 = ((7 << 3) + 4), |
DSRL32 = ((7 << 3) + 6), |
DSRA32 = ((7 << 3) + 7), |
+ |
+ // Multiply integers in r6. |
+ MUL_MUH = ((3 << 3) + 0), // MUL, MUH. |
+ MUL_MUH_U = ((3 << 3) + 1), // MUL_U, MUH_U. |
+ D_MUL_MUH = ((7 << 2) + 0), // DMUL, DMUH. |
+ D_MUL_MUH_U = ((7 << 2) + 1), // DMUL_U, DMUH_U. |
+ |
+ MUL_OP = ((0 << 3) + 2), |
+ MUH_OP = ((0 << 3) + 3), |
+ DIV_OP = ((0 << 3) + 2), |
+ MOD_OP = ((0 << 3) + 3), |
+ |
+ DIV_MOD = ((3 << 3) + 2), |
+ DIV_MOD_U = ((3 << 3) + 3), |
+ D_DIV_MOD = ((3 << 3) + 6), |
+ D_DIV_MOD_U = ((3 << 3) + 7), |
+ |
// drotr in special4? |
// SPECIAL2 Encoding of Function Field. |
@@ -426,6 +449,9 @@ enum SecondaryField { |
BGEZ = ((0 << 3) + 1) << 16, |
BLTZAL = ((2 << 3) + 0) << 16, |
BGEZAL = ((2 << 3) + 1) << 16, |
+ BGEZALL = ((2 << 3) + 3) << 16, |
+ DAHI = ((0 << 3) + 6) << 16, |
+ DATI = ((3 << 3) + 6) << 16, |
// COP1 Encoding of rs Field. |
MFC1 = ((0 << 3) + 0) << 21, |
@@ -472,6 +498,10 @@ enum SecondaryField { |
TRUNC_W_D = ((1 << 3) + 5), |
CEIL_W_D = ((1 << 3) + 6), |
FLOOR_W_D = ((1 << 3) + 7), |
+ MIN = ((3 << 3) + 4), |
+ MINA = ((3 << 3) + 5), |
+ MAX = ((3 << 3) + 6), |
+ MAXA = ((3 << 3) + 7), |
CVT_S_D = ((4 << 3) + 0), |
CVT_W_D = ((4 << 3) + 4), |
CVT_L_D = ((4 << 3) + 5), |
@@ -488,6 +518,47 @@ enum SecondaryField { |
CVT_D_W = ((4 << 3) + 1), |
CVT_S_L = ((4 << 3) + 0), |
CVT_D_L = ((4 << 3) + 1), |
+ BC1EQZ = ((2 << 2) + 1) << 21, |
+ BC1NEZ = ((3 << 2) + 1) << 21, |
+ // COP1 CMP positive predicates Bit 5..4 = 00. |
+ CMP_AF = ((0 << 3) + 0), |
+ CMP_UN = ((0 << 3) + 1), |
+ CMP_EQ = ((0 << 3) + 2), |
+ CMP_UEQ = ((0 << 3) + 3), |
+ CMP_LT = ((0 << 3) + 4), |
+ CMP_ULT = ((0 << 3) + 5), |
+ CMP_LE = ((0 << 3) + 6), |
+ CMP_ULE = ((0 << 3) + 7), |
+ CMP_SAF = ((1 << 3) + 0), |
+ CMP_SUN = ((1 << 3) + 1), |
+ CMP_SEQ = ((1 << 3) + 2), |
+ CMP_SUEQ = ((1 << 3) + 3), |
+ CMP_SSLT = ((1 << 3) + 4), |
+ CMP_SSULT = ((1 << 3) + 5), |
+ CMP_SLE = ((1 << 3) + 6), |
+ CMP_SULE = ((1 << 3) + 7), |
+ // COP1 CMP negative predicates Bit 5..4 = 01. |
+ CMP_AT = ((2 << 3) + 0), // Reserved, not implemented. |
+ CMP_OR = ((2 << 3) + 1), |
+ CMP_UNE = ((2 << 3) + 2), |
+ CMP_NE = ((2 << 3) + 3), |
+ CMP_UGE = ((2 << 3) + 4), // Reserved, not implemented. |
+ CMP_OGE = ((2 << 3) + 5), // Reserved, not implemented. |
+ CMP_UGT = ((2 << 3) + 6), // Reserved, not implemented. |
+ CMP_OGT = ((2 << 3) + 7), // Reserved, not implemented. |
+ CMP_SAT = ((3 << 3) + 0), // Reserved, not implemented. |
+ CMP_SOR = ((3 << 3) + 1), |
+ CMP_SUNE = ((3 << 3) + 2), |
+ CMP_SNE = ((3 << 3) + 3), |
+ CMP_SUGE = ((3 << 3) + 4), // Reserved, not implemented. |
+ CMP_SOGE = ((3 << 3) + 5), // Reserved, not implemented. |
+ CMP_SUGT = ((3 << 3) + 6), // Reserved, not implemented. |
+ CMP_SOGT = ((3 << 3) + 7), // Reserved, not implemented. |
+ |
+ SEL = ((2 << 3) + 0), |
+ SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers. |
+ SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers. |
+ |
// COP1 Encoding of Function Field When rs=PS. |
// COP1X Encoding of Function Field. |
MADD_D = ((4 << 3) + 1), |
@@ -497,9 +568,9 @@ enum SecondaryField { |
// ----- Emulated conditions. |
-// On MIPS we use this enum to abstract from conditionnal branch instructions. |
+// On MIPS we use this enum to abstract from conditional branch instructions. |
// The 'U' prefix is used to specify unsigned comparisons. |
-// Oppposite conditions must be paired as odd/even numbers |
+// Opposite conditions must be paired as odd/even numbers |
// because 'NegateCondition' function flips LSB to negate condition. |
enum Condition { |
// Any value < 0 is considered no_condition. |
@@ -833,6 +904,11 @@ class Instruction { |
return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift); |
} |
+ inline int32_t Imm21Value() const { |
+ ASSERT(InstructionType() == kImmediateType); |
+ return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift); |
+ } |
+ |
inline int32_t Imm26Value() const { |
ASSERT(InstructionType() == kJumpType); |
return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift); |