| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef  V8_MIPS_CONSTANTS_H_ | 5 #ifndef  V8_MIPS_CONSTANTS_H_ | 
| 6 #define  V8_MIPS_CONSTANTS_H_ | 6 #define  V8_MIPS_CONSTANTS_H_ | 
| 7 #include "src/globals.h" | 7 #include "src/globals.h" | 
| 8 // UNIMPLEMENTED_ macro for MIPS. | 8 // UNIMPLEMENTED_ macro for MIPS. | 
| 9 #ifdef DEBUG | 9 #ifdef DEBUG | 
| 10 #define UNIMPLEMENTED_MIPS()                                                  \ | 10 #define UNIMPLEMENTED_MIPS()                                                  \ | 
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 252 const int kRsBits        = 5; | 252 const int kRsBits        = 5; | 
| 253 const int kRtShift       = 16; | 253 const int kRtShift       = 16; | 
| 254 const int kRtBits        = 5; | 254 const int kRtBits        = 5; | 
| 255 const int kRdShift       = 11; | 255 const int kRdShift       = 11; | 
| 256 const int kRdBits        = 5; | 256 const int kRdBits        = 5; | 
| 257 const int kSaShift       = 6; | 257 const int kSaShift       = 6; | 
| 258 const int kSaBits        = 5; | 258 const int kSaBits        = 5; | 
| 259 const int kFunctionShift = 0; | 259 const int kFunctionShift = 0; | 
| 260 const int kFunctionBits  = 6; | 260 const int kFunctionBits  = 6; | 
| 261 const int kLuiShift      = 16; | 261 const int kLuiShift      = 16; | 
|  | 262 const int kBp2Shift = 6; | 
|  | 263 const int kBp2Bits = 2; | 
| 262 | 264 | 
| 263 const int kImm16Shift = 0; | 265 const int kImm16Shift = 0; | 
| 264 const int kImm16Bits  = 16; | 266 const int kImm16Bits  = 16; | 
|  | 267 const int kImm18Shift = 0; | 
|  | 268 const int kImm18Bits = 18; | 
|  | 269 const int kImm19Shift = 0; | 
|  | 270 const int kImm19Bits = 19; | 
| 265 const int kImm21Shift = 0; | 271 const int kImm21Shift = 0; | 
| 266 const int kImm21Bits  = 21; | 272 const int kImm21Bits  = 21; | 
| 267 const int kImm26Shift = 0; | 273 const int kImm26Shift = 0; | 
| 268 const int kImm26Bits  = 26; | 274 const int kImm26Bits  = 26; | 
| 269 const int kImm28Shift = 0; | 275 const int kImm28Shift = 0; | 
| 270 const int kImm28Bits  = 28; | 276 const int kImm28Bits  = 28; | 
| 271 const int kImm32Shift = 0; | 277 const int kImm32Shift = 0; | 
| 272 const int kImm32Bits  = 32; | 278 const int kImm32Bits  = 32; | 
| 273 | 279 | 
| 274 // In branches and jumps immediate fields point to words, not bytes, | 280 // In branches and jumps immediate fields point to words, not bytes, | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 287 const int kFCccBits      = 3; | 293 const int kFCccBits      = 3; | 
| 288 const int kFBccShift     = 18; | 294 const int kFBccShift     = 18; | 
| 289 const int kFBccBits      = 3; | 295 const int kFBccBits      = 3; | 
| 290 const int kFBtrueShift   = 16; | 296 const int kFBtrueShift   = 16; | 
| 291 const int kFBtrueBits    = 1; | 297 const int kFBtrueBits    = 1; | 
| 292 | 298 | 
| 293 // ----- Miscellaneous useful masks. | 299 // ----- Miscellaneous useful masks. | 
| 294 // Instruction bit masks. | 300 // Instruction bit masks. | 
| 295 const int  kOpcodeMask   = ((1 << kOpcodeBits) - 1) << kOpcodeShift; | 301 const int  kOpcodeMask   = ((1 << kOpcodeBits) - 1) << kOpcodeShift; | 
| 296 const int  kImm16Mask    = ((1 << kImm16Bits) - 1) << kImm16Shift; | 302 const int  kImm16Mask    = ((1 << kImm16Bits) - 1) << kImm16Shift; | 
|  | 303 const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift; | 
|  | 304 const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift; | 
|  | 305 const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift; | 
| 297 const int  kImm26Mask    = ((1 << kImm26Bits) - 1) << kImm26Shift; | 306 const int  kImm26Mask    = ((1 << kImm26Bits) - 1) << kImm26Shift; | 
| 298 const int  kImm28Mask    = ((1 << kImm28Bits) - 1) << kImm28Shift; | 307 const int  kImm28Mask    = ((1 << kImm28Bits) - 1) << kImm28Shift; | 
| 299 const int  kRsFieldMask  = ((1 << kRsBits) - 1) << kRsShift; | 308 const int  kRsFieldMask  = ((1 << kRsBits) - 1) << kRsShift; | 
| 300 const int  kRtFieldMask  = ((1 << kRtBits) - 1) << kRtShift; | 309 const int  kRtFieldMask  = ((1 << kRtBits) - 1) << kRtShift; | 
| 301 const int  kRdFieldMask  = ((1 << kRdBits) - 1) << kRdShift; | 310 const int  kRdFieldMask  = ((1 << kRdBits) - 1) << kRdShift; | 
| 302 const int  kSaFieldMask  = ((1 << kSaBits) - 1) << kSaShift; | 311 const int  kSaFieldMask  = ((1 << kSaBits) - 1) << kSaShift; | 
| 303 const int  kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift; | 312 const int  kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift; | 
| 304 // Misc masks. | 313 // Misc masks. | 
| 305 const int  kHiMask       =   0xffff << 16; | 314 const int  kHiMask       =   0xffff << 16; | 
| 306 const int  kLoMask       =   0xffff; | 315 const int  kLoMask       =   0xffff; | 
| 307 const int  kSignMask     =   0x80000000; | 316 const int  kSignMask     =   0x80000000; | 
| 308 const int  kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1; | 317 const int  kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1; | 
| 309 | 318 | 
| 310 // ----- MIPS Opcodes and Function Fields. | 319 // ----- MIPS Opcodes and Function Fields. | 
| 311 // We use this presentation to stay close to the table representation in | 320 // We use this presentation to stay close to the table representation in | 
| 312 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set. | 321 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set. | 
| 313 enum Opcode { | 322 enum Opcode { | 
| 314   SPECIAL   =   0 << kOpcodeShift, | 323   SPECIAL = 0 << kOpcodeShift, | 
| 315   REGIMM    =   1 << kOpcodeShift, | 324   REGIMM = 1 << kOpcodeShift, | 
| 316 | 325 | 
| 317   J         =   ((0 << 3) + 2) << kOpcodeShift, | 326   J = ((0 << 3) + 2) << kOpcodeShift, | 
| 318   JAL       =   ((0 << 3) + 3) << kOpcodeShift, | 327   JAL = ((0 << 3) + 3) << kOpcodeShift, | 
| 319   BEQ       =   ((0 << 3) + 4) << kOpcodeShift, | 328   BEQ = ((0 << 3) + 4) << kOpcodeShift, | 
| 320   BNE       =   ((0 << 3) + 5) << kOpcodeShift, | 329   BNE = ((0 << 3) + 5) << kOpcodeShift, | 
| 321   BLEZ      =   ((0 << 3) + 6) << kOpcodeShift, | 330   BLEZ = ((0 << 3) + 6) << kOpcodeShift, | 
| 322   BGTZ      =   ((0 << 3) + 7) << kOpcodeShift, | 331   BGTZ = ((0 << 3) + 7) << kOpcodeShift, | 
| 323 | 332 | 
| 324   ADDI      =   ((1 << 3) + 0) << kOpcodeShift, | 333   ADDI = ((1 << 3) + 0) << kOpcodeShift, | 
| 325   ADDIU     =   ((1 << 3) + 1) << kOpcodeShift, | 334   ADDIU = ((1 << 3) + 1) << kOpcodeShift, | 
| 326   SLTI      =   ((1 << 3) + 2) << kOpcodeShift, | 335   SLTI = ((1 << 3) + 2) << kOpcodeShift, | 
| 327   SLTIU     =   ((1 << 3) + 3) << kOpcodeShift, | 336   SLTIU = ((1 << 3) + 3) << kOpcodeShift, | 
| 328   ANDI      =   ((1 << 3) + 4) << kOpcodeShift, | 337   ANDI = ((1 << 3) + 4) << kOpcodeShift, | 
| 329   ORI       =   ((1 << 3) + 5) << kOpcodeShift, | 338   ORI = ((1 << 3) + 5) << kOpcodeShift, | 
| 330   XORI      =   ((1 << 3) + 6) << kOpcodeShift, | 339   XORI = ((1 << 3) + 6) << kOpcodeShift, | 
| 331   LUI       =   ((1 << 3) + 7) << kOpcodeShift,  // LUI/AUI family. | 340   LUI = ((1 << 3) + 7) << kOpcodeShift,  // LUI/AUI family. | 
| 332 | 341 | 
| 333   BEQC      =   ((2 << 3) + 0) << kOpcodeShift, | 342   BEQC = ((2 << 3) + 0) << kOpcodeShift, | 
| 334   COP1      =   ((2 << 3) + 1) << kOpcodeShift,  // Coprocessor 1 class. | 343   COP1 = ((2 << 3) + 1) << kOpcodeShift,  // Coprocessor 1 class. | 
| 335   BEQL      =   ((2 << 3) + 4) << kOpcodeShift, | 344   BEQL = ((2 << 3) + 4) << kOpcodeShift, | 
| 336   BNEL      =   ((2 << 3) + 5) << kOpcodeShift, | 345   BNEL = ((2 << 3) + 5) << kOpcodeShift, | 
| 337   BLEZL     =   ((2 << 3) + 6) << kOpcodeShift, | 346   BLEZL = ((2 << 3) + 6) << kOpcodeShift, | 
| 338   BGTZL     =   ((2 << 3) + 7) << kOpcodeShift, | 347   BGTZL = ((2 << 3) + 7) << kOpcodeShift, | 
| 339 | 348 | 
| 340   DADDI     =   ((3 << 3) + 0) << kOpcodeShift,  // This is also BNEC. | 349   DADDI = ((3 << 3) + 0) << kOpcodeShift,  // This is also BNEC. | 
| 341   SPECIAL2  =   ((3 << 3) + 4) << kOpcodeShift, | 350   SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift, | 
| 342   SPECIAL3  =   ((3 << 3) + 7) << kOpcodeShift, | 351   SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift, | 
| 343 | 352 | 
| 344   LB        =   ((4 << 3) + 0) << kOpcodeShift, | 353   LB = ((4 << 3) + 0) << kOpcodeShift, | 
| 345   LH        =   ((4 << 3) + 1) << kOpcodeShift, | 354   LH = ((4 << 3) + 1) << kOpcodeShift, | 
| 346   LWL       =   ((4 << 3) + 2) << kOpcodeShift, | 355   LWL = ((4 << 3) + 2) << kOpcodeShift, | 
| 347   LW        =   ((4 << 3) + 3) << kOpcodeShift, | 356   LW = ((4 << 3) + 3) << kOpcodeShift, | 
| 348   LBU       =   ((4 << 3) + 4) << kOpcodeShift, | 357   LBU = ((4 << 3) + 4) << kOpcodeShift, | 
| 349   LHU       =   ((4 << 3) + 5) << kOpcodeShift, | 358   LHU = ((4 << 3) + 5) << kOpcodeShift, | 
| 350   LWR       =   ((4 << 3) + 6) << kOpcodeShift, | 359   LWR = ((4 << 3) + 6) << kOpcodeShift, | 
| 351   SB        =   ((5 << 3) + 0) << kOpcodeShift, | 360   SB = ((5 << 3) + 0) << kOpcodeShift, | 
| 352   SH        =   ((5 << 3) + 1) << kOpcodeShift, | 361   SH = ((5 << 3) + 1) << kOpcodeShift, | 
| 353   SWL       =   ((5 << 3) + 2) << kOpcodeShift, | 362   SWL = ((5 << 3) + 2) << kOpcodeShift, | 
| 354   SW        =   ((5 << 3) + 3) << kOpcodeShift, | 363   SW = ((5 << 3) + 3) << kOpcodeShift, | 
| 355   SWR       =   ((5 << 3) + 6) << kOpcodeShift, | 364   SWR = ((5 << 3) + 6) << kOpcodeShift, | 
| 356 | 365 | 
| 357   LWC1      =   ((6 << 3) + 1) << kOpcodeShift, | 366   LWC1 = ((6 << 3) + 1) << kOpcodeShift, | 
| 358   LDC1      =   ((6 << 3) + 5) << kOpcodeShift, | 367   BC = ((6 << 3) + 2) << kOpcodeShift, | 
| 359   BEQZC     =   ((6 << 3) + 6) << kOpcodeShift, | 368   LDC1 = ((6 << 3) + 5) << kOpcodeShift, | 
|  | 369   POP66 = ((6 << 3) + 6) << kOpcodeShift, | 
| 360 | 370 | 
| 361   PREF      =   ((6 << 3) + 3) << kOpcodeShift, | 371   PREF = ((6 << 3) + 3) << kOpcodeShift, | 
| 362 | 372 | 
| 363   SWC1      =   ((7 << 3) + 1) << kOpcodeShift, | 373   SWC1 = ((7 << 3) + 1) << kOpcodeShift, | 
| 364   SDC1      =   ((7 << 3) + 5) << kOpcodeShift, | 374   BALC = ((7 << 3) + 2) << kOpcodeShift, | 
| 365   BNEZC     =   ((7 << 3) + 6) << kOpcodeShift, | 375   PCREL = ((7 << 3) + 3) << kOpcodeShift, | 
|  | 376   SDC1 = ((7 << 3) + 5) << kOpcodeShift, | 
|  | 377   POP76 = ((7 << 3) + 6) << kOpcodeShift, | 
| 366 | 378 | 
| 367   COP1X     =   ((1 << 4) + 3) << kOpcodeShift | 379   COP1X = ((1 << 4) + 3) << kOpcodeShift | 
| 368 }; | 380 }; | 
| 369 | 381 | 
| 370 enum SecondaryField { | 382 enum SecondaryField { | 
| 371   // SPECIAL Encoding of Function Field. | 383   // SPECIAL Encoding of Function Field. | 
| 372   SLL = ((0 << 3) + 0), | 384   SLL = ((0 << 3) + 0), | 
| 373   MOVCI = ((0 << 3) + 1), | 385   MOVCI = ((0 << 3) + 1), | 
| 374   SRL = ((0 << 3) + 2), | 386   SRL = ((0 << 3) + 2), | 
| 375   SRA = ((0 << 3) + 3), | 387   SRA = ((0 << 3) + 3), | 
| 376   SLLV = ((0 << 3) + 4), | 388   SLLV = ((0 << 3) + 4), | 
| 377   SRLV = ((0 << 3) + 6), | 389   SRLV = ((0 << 3) + 6), | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 428   DIV_MOD_U = ((3 << 3) + 3), | 440   DIV_MOD_U = ((3 << 3) + 3), | 
| 429 | 441 | 
| 430   // SPECIAL2 Encoding of Function Field. | 442   // SPECIAL2 Encoding of Function Field. | 
| 431   MUL = ((0 << 3) + 2), | 443   MUL = ((0 << 3) + 2), | 
| 432   CLZ = ((4 << 3) + 0), | 444   CLZ = ((4 << 3) + 0), | 
| 433   CLO = ((4 << 3) + 1), | 445   CLO = ((4 << 3) + 1), | 
| 434 | 446 | 
| 435   // SPECIAL3 Encoding of Function Field. | 447   // SPECIAL3 Encoding of Function Field. | 
| 436   EXT = ((0 << 3) + 0), | 448   EXT = ((0 << 3) + 0), | 
| 437   INS = ((0 << 3) + 4), | 449   INS = ((0 << 3) + 4), | 
| 438   BITSWAP = ((4 << 3) + 0), | 450   BSHFL = ((4 << 3) + 0), | 
|  | 451 | 
|  | 452   // SPECIAL3 Encoding of sa Field. | 
|  | 453   BITSWAP = ((0 << 3) + 0), | 
|  | 454   ALIGN = ((0 << 3) + 2), | 
|  | 455   WSBH = ((0 << 3) + 2), | 
|  | 456   SEB = ((2 << 3) + 0), | 
|  | 457   SEH = ((3 << 3) + 0), | 
| 439 | 458 | 
| 440   // REGIMM  encoding of rt Field. | 459   // REGIMM  encoding of rt Field. | 
| 441   BLTZ = ((0 << 3) + 0) << 16, | 460   BLTZ = ((0 << 3) + 0) << 16, | 
| 442   BGEZ = ((0 << 3) + 1) << 16, | 461   BGEZ = ((0 << 3) + 1) << 16, | 
| 443   BLTZAL = ((2 << 3) + 0) << 16, | 462   BLTZAL = ((2 << 3) + 0) << 16, | 
| 444   BGEZAL = ((2 << 3) + 1) << 16, | 463   BGEZAL = ((2 << 3) + 1) << 16, | 
| 445   BGEZALL = ((2 << 3) + 3) << 16, | 464   BGEZALL = ((2 << 3) + 3) << 16, | 
| 446 | 465 | 
| 447   // COP1 Encoding of rs Field. | 466   // COP1 Encoding of rs Field. | 
| 448   MFC1 = ((0 << 3) + 0) << 21, | 467   MFC1 = ((0 << 3) + 0) << 21, | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 564   SEL = ((2 << 3) + 0), | 583   SEL = ((2 << 3) + 0), | 
| 565   MOVZ_C = ((2 << 3) + 2), | 584   MOVZ_C = ((2 << 3) + 2), | 
| 566   MOVN_C = ((2 << 3) + 3), | 585   MOVN_C = ((2 << 3) + 3), | 
| 567   SELEQZ_C = ((2 << 3) + 4),  // COP1 on FPR registers. | 586   SELEQZ_C = ((2 << 3) + 4),  // COP1 on FPR registers. | 
| 568   MOVF = ((2 << 3) + 1),      // Function field for MOVT.fmt and MOVF.fmt | 587   MOVF = ((2 << 3) + 1),      // Function field for MOVT.fmt and MOVF.fmt | 
| 569   SELNEZ_C = ((2 << 3) + 7),  // COP1 on FPR registers. | 588   SELNEZ_C = ((2 << 3) + 7),  // COP1 on FPR registers. | 
| 570   // COP1 Encoding of Function Field When rs=PS. | 589   // COP1 Encoding of Function Field When rs=PS. | 
| 571   // COP1X Encoding of Function Field. | 590   // COP1X Encoding of Function Field. | 
| 572   MADD_D = ((4 << 3) + 1), | 591   MADD_D = ((4 << 3) + 1), | 
| 573 | 592 | 
|  | 593   // PCREL Encoding of rt Field. | 
|  | 594   ADDIUPC = ((0 << 2) + 0), | 
|  | 595   LWPC = ((0 << 2) + 1), | 
|  | 596   AUIPC = ((3 << 3) + 6), | 
|  | 597   ALUIPC = ((3 << 3) + 7), | 
|  | 598 | 
|  | 599   // POP66 Encoding of rs Field. | 
|  | 600   JIC = ((0 << 5) + 0), | 
|  | 601 | 
|  | 602   // POP76 Encoding of rs Field. | 
|  | 603   JIALC = ((0 << 5) + 0), | 
|  | 604 | 
| 574   NULLSF = 0 | 605   NULLSF = 0 | 
| 575 }; | 606 }; | 
| 576 | 607 | 
| 577 | 608 | 
| 578 // ----- Emulated conditions. | 609 // ----- Emulated conditions. | 
| 579 // On MIPS we use this enum to abstract from conditional branch instructions. | 610 // On MIPS we use this enum to abstract from conditional branch instructions. | 
| 580 // The 'U' prefix is used to specify unsigned comparisons. | 611 // The 'U' prefix is used to specify unsigned comparisons. | 
| 581 // Opposite conditions must be paired as odd/even numbers | 612 // Opposite conditions must be paired as odd/even numbers | 
| 582 // because 'NegateCondition' function flips LSB to negate condition. | 613 // because 'NegateCondition' function flips LSB to negate condition. | 
| 583 enum Condition { | 614 enum Condition { | 
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 874   } | 905   } | 
| 875 | 906 | 
| 876   inline int FtValue() const { | 907   inline int FtValue() const { | 
| 877     return Bits(kFtShift + kFtBits - 1, kFtShift); | 908     return Bits(kFtShift + kFtBits - 1, kFtShift); | 
| 878   } | 909   } | 
| 879 | 910 | 
| 880   inline int FrValue() const { | 911   inline int FrValue() const { | 
| 881     return Bits(kFrShift + kFrBits -1, kFrShift); | 912     return Bits(kFrShift + kFrBits -1, kFrShift); | 
| 882   } | 913   } | 
| 883 | 914 | 
|  | 915   inline int Bp2Value() const { | 
|  | 916     DCHECK(InstructionType() == kRegisterType); | 
|  | 917     return Bits(kBp2Shift + kBp2Bits - 1, kBp2Shift); | 
|  | 918   } | 
|  | 919 | 
| 884   // Float Compare condition code instruction bits. | 920   // Float Compare condition code instruction bits. | 
| 885   inline int FCccValue() const { | 921   inline int FCccValue() const { | 
| 886     return Bits(kFCccShift + kFCccBits - 1, kFCccShift); | 922     return Bits(kFCccShift + kFCccBits - 1, kFCccShift); | 
| 887   } | 923   } | 
| 888 | 924 | 
| 889   // Float Branch condition code instruction bits. | 925   // Float Branch condition code instruction bits. | 
| 890   inline int FBccValue() const { | 926   inline int FBccValue() const { | 
| 891     return Bits(kFBccShift + kFBccBits - 1, kFBccShift); | 927     return Bits(kFBccShift + kFBccBits - 1, kFBccShift); | 
| 892   } | 928   } | 
| 893 | 929 | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 917            InstructionType() == kImmediateType); | 953            InstructionType() == kImmediateType); | 
| 918     return InstructionBits() & kRtFieldMask; | 954     return InstructionBits() & kRtFieldMask; | 
| 919   } | 955   } | 
| 920 | 956 | 
| 921   inline int RdFieldRaw() const { | 957   inline int RdFieldRaw() const { | 
| 922     DCHECK(InstructionType() == kRegisterType); | 958     DCHECK(InstructionType() == kRegisterType); | 
| 923     return InstructionBits() & kRdFieldMask; | 959     return InstructionBits() & kRdFieldMask; | 
| 924   } | 960   } | 
| 925 | 961 | 
| 926   inline int SaFieldRaw() const { | 962   inline int SaFieldRaw() const { | 
| 927     DCHECK(InstructionType() == kRegisterType); |  | 
| 928     return InstructionBits() & kSaFieldMask; | 963     return InstructionBits() & kSaFieldMask; | 
| 929   } | 964   } | 
| 930 | 965 | 
| 931   inline int FunctionFieldRaw() const { | 966   inline int FunctionFieldRaw() const { | 
| 932     return InstructionBits() & kFunctionFieldMask; | 967     return InstructionBits() & kFunctionFieldMask; | 
| 933   } | 968   } | 
| 934 | 969 | 
| 935   // Get the secondary field according to the opcode. | 970   // Get the secondary field according to the opcode. | 
| 936   inline int SecondaryValue() const { | 971   inline int SecondaryValue() const { | 
| 937     Opcode op = OpcodeFieldRaw(); | 972     Opcode op = OpcodeFieldRaw(); | 
| 938     switch (op) { | 973     switch (op) { | 
| 939       case SPECIAL: | 974       case SPECIAL: | 
| 940       case SPECIAL2: | 975       case SPECIAL2: | 
| 941         return FunctionValue(); | 976         return FunctionValue(); | 
| 942       case COP1: | 977       case COP1: | 
| 943         return RsValue(); | 978         return RsValue(); | 
| 944       case REGIMM: | 979       case REGIMM: | 
| 945         return RtValue(); | 980         return RtValue(); | 
| 946       default: | 981       default: | 
| 947         return NULLSF; | 982         return NULLSF; | 
| 948     } | 983     } | 
| 949   } | 984   } | 
| 950 | 985 | 
| 951   inline int32_t Imm16Value() const { | 986   inline int32_t Imm16Value() const { | 
| 952     DCHECK(InstructionType() == kImmediateType); | 987     DCHECK(InstructionType() == kImmediateType); | 
| 953     return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift); | 988     return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift); | 
| 954   } | 989   } | 
| 955 | 990 | 
|  | 991   inline int32_t Imm18Value() const { | 
|  | 992     DCHECK(InstructionType() == kImmediateType); | 
|  | 993     return Bits(kImm18Shift + kImm18Bits - 1, kImm18Shift); | 
|  | 994   } | 
|  | 995 | 
|  | 996   inline int32_t Imm19Value() const { | 
|  | 997     DCHECK(InstructionType() == kImmediateType); | 
|  | 998     return Bits(kImm19Shift + kImm19Bits - 1, kImm19Shift); | 
|  | 999   } | 
|  | 1000 | 
| 956   inline int32_t Imm21Value() const { | 1001   inline int32_t Imm21Value() const { | 
| 957     DCHECK(InstructionType() == kImmediateType); | 1002     DCHECK(InstructionType() == kImmediateType); | 
| 958     return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift); | 1003     return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift); | 
| 959   } | 1004   } | 
| 960 | 1005 | 
| 961   inline int32_t Imm26Value() const { | 1006   inline int32_t Imm26Value() const { | 
| 962     DCHECK(InstructionType() == kJumpType); | 1007     DCHECK((InstructionType() == kJumpType) || | 
|  | 1008            (InstructionType() == kImmediateType)); | 
| 963     return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift); | 1009     return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift); | 
| 964   } | 1010   } | 
| 965 | 1011 | 
| 966   // Say if the instruction should not be used in a branch delay slot. | 1012   // Say if the instruction should not be used in a branch delay slot. | 
| 967   bool IsForbiddenInBranchDelay() const; | 1013   bool IsForbiddenInBranchDelay() const; | 
| 968   // Say if the instruction 'links'. e.g. jal, bal. | 1014   // Say if the instruction 'links'. e.g. jal, bal. | 
| 969   bool IsLinkingInstruction() const; | 1015   bool IsLinkingInstruction() const; | 
| 970   // Say if the instruction is a break or a trap. | 1016   // Say if the instruction is a break or a trap. | 
| 971   bool IsTrap() const; | 1017   bool IsTrap() const; | 
| 972 | 1018 | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 994 // JS argument slots size. | 1040 // JS argument slots size. | 
| 995 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; | 1041 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; | 
| 996 // Assembly builtins argument slots size. | 1042 // Assembly builtins argument slots size. | 
| 997 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; | 1043 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; | 
| 998 | 1044 | 
| 999 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; | 1045 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; | 
| 1000 | 1046 | 
| 1001 } }   // namespace v8::internal | 1047 } }   // namespace v8::internal | 
| 1002 | 1048 | 
| 1003 #endif    // #ifndef V8_MIPS_CONSTANTS_H_ | 1049 #endif    // #ifndef V8_MIPS_CONSTANTS_H_ | 
| OLD | NEW | 
|---|