Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/mips/constants-mips.h

Issue 1144373003: MIPS: Implemented PC-relative instructions for R6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Implementation BC and BALC. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // On MIPS Simulator breakpoints can have different codes: 236 // On MIPS Simulator breakpoints can have different codes:
237 // - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints, 237 // - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
238 // the simulator will run through them and print the registers. 238 // the simulator will run through them and print the registers.
239 // - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop() 239 // - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
240 // instructions (see Assembler::stop()). 240 // instructions (see Assembler::stop()).
241 // - Breaks larger than kMaxStopCode are simple breaks, dropping you into the 241 // - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
242 // debugger. 242 // debugger.
243 const uint32_t kMaxWatchpointCode = 31; 243 const uint32_t kMaxWatchpointCode = 31;
244 const uint32_t kMaxStopCode = 127; 244 const uint32_t kMaxStopCode = 127;
245 const int32_t kMaxInt19 = 262143;
246 const int32_t kMinInt19 = -262144;
247 const int32_t kMaxInt26 = 33554431;
248 const int32_t kMinInt26 = -33554432;
paul.l... 2015/06/10 03:49:25 I don't think you need this constants if you chang
ilija.pavlovic 2015/06/12 09:51:32 These constants are deleted. They were actually de
245 STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode); 249 STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode);
246 250
247 251
248 // ----- Fields offset and length. 252 // ----- Fields offset and length.
249 const int kOpcodeShift = 26; 253 const int kOpcodeShift = 26;
250 const int kOpcodeBits = 6; 254 const int kOpcodeBits = 6;
251 const int kRsShift = 21; 255 const int kRsShift = 21;
252 const int kRsBits = 5; 256 const int kRsBits = 5;
253 const int kRtShift = 16; 257 const int kRtShift = 16;
254 const int kRtBits = 5; 258 const int kRtBits = 5;
255 const int kRdShift = 11; 259 const int kRdShift = 11;
256 const int kRdBits = 5; 260 const int kRdBits = 5;
257 const int kSaShift = 6; 261 const int kSaShift = 6;
258 const int kSaBits = 5; 262 const int kSaBits = 5;
259 const int kFunctionShift = 0; 263 const int kFunctionShift = 0;
260 const int kFunctionBits = 6; 264 const int kFunctionBits = 6;
261 const int kLuiShift = 16; 265 const int kLuiShift = 16;
266 const int kBp2Shift = 6;
267 const int kBp2Bits = 2;
paul.l... 2015/06/10 03:49:25 nit: indentation is off here and a few places belo
ilija.pavlovic 2015/06/12 09:51:32 I made an effort to have nicely aligned signs "=",
262 268
263 const int kImm16Shift = 0; 269 const int kImm16Shift = 0;
264 const int kImm16Bits = 16; 270 const int kImm16Bits = 16;
271 const int kImm18Shift = 0;
272 const int kImm18Bits = 18;
273 const int kImm19Shift = 0;
274 const int kImm19Bits = 19;
265 const int kImm21Shift = 0; 275 const int kImm21Shift = 0;
266 const int kImm21Bits = 21; 276 const int kImm21Bits = 21;
267 const int kImm26Shift = 0; 277 const int kImm26Shift = 0;
268 const int kImm26Bits = 26; 278 const int kImm26Bits = 26;
269 const int kImm28Shift = 0; 279 const int kImm28Shift = 0;
270 const int kImm28Bits = 28; 280 const int kImm28Bits = 28;
271 const int kImm32Shift = 0; 281 const int kImm32Shift = 0;
272 const int kImm32Bits = 32; 282 const int kImm32Bits = 32;
273 283
274 // In branches and jumps immediate fields point to words, not bytes, 284 // In branches and jumps immediate fields point to words, not bytes,
(...skipping 12 matching lines...) Expand all
287 const int kFCccBits = 3; 297 const int kFCccBits = 3;
288 const int kFBccShift = 18; 298 const int kFBccShift = 18;
289 const int kFBccBits = 3; 299 const int kFBccBits = 3;
290 const int kFBtrueShift = 16; 300 const int kFBtrueShift = 16;
291 const int kFBtrueBits = 1; 301 const int kFBtrueBits = 1;
292 302
293 // ----- Miscellaneous useful masks. 303 // ----- Miscellaneous useful masks.
294 // Instruction bit masks. 304 // Instruction bit masks.
295 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift; 305 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
296 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift; 306 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
307 const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift;
308 const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift;
309 const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift;
297 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift; 310 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
298 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift; 311 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
299 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift; 312 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
300 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift; 313 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
301 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift; 314 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
302 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift; 315 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift;
303 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift; 316 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift;
304 // Misc masks. 317 // Misc masks.
305 const int kHiMask = 0xffff << 16; 318 const int kHiMask = 0xffff << 16;
306 const int kLoMask = 0xffff; 319 const int kLoMask = 0xffff;
307 const int kSignMask = 0x80000000; 320 const int kSignMask = 0x80000000;
308 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1; 321 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1;
309 322
310 // ----- MIPS Opcodes and Function Fields. 323 // ----- MIPS Opcodes and Function Fields.
311 // We use this presentation to stay close to the table representation in 324 // We use this presentation to stay close to the table representation in
312 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set. 325 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set.
313 enum Opcode { 326 enum Opcode {
314 SPECIAL = 0 << kOpcodeShift, 327 SPECIAL = 0 << kOpcodeShift,
315 REGIMM = 1 << kOpcodeShift, 328 REGIMM = 1 << kOpcodeShift,
316 329
317 J = ((0 << 3) + 2) << kOpcodeShift, 330 J = ((0 << 3) + 2) << kOpcodeShift,
318 JAL = ((0 << 3) + 3) << kOpcodeShift, 331 JAL = ((0 << 3) + 3) << kOpcodeShift,
319 BEQ = ((0 << 3) + 4) << kOpcodeShift, 332 BEQ = ((0 << 3) + 4) << kOpcodeShift,
320 BNE = ((0 << 3) + 5) << kOpcodeShift, 333 BNE = ((0 << 3) + 5) << kOpcodeShift,
321 BLEZ = ((0 << 3) + 6) << kOpcodeShift, 334 BLEZ = ((0 << 3) + 6) << kOpcodeShift,
322 BGTZ = ((0 << 3) + 7) << kOpcodeShift, 335 BGTZ = ((0 << 3) + 7) << kOpcodeShift,
323 336
324 ADDI = ((1 << 3) + 0) << kOpcodeShift, 337 ADDI = ((1 << 3) + 0) << kOpcodeShift,
325 ADDIU = ((1 << 3) + 1) << kOpcodeShift, 338 ADDIU = ((1 << 3) + 1) << kOpcodeShift,
326 SLTI = ((1 << 3) + 2) << kOpcodeShift, 339 SLTI = ((1 << 3) + 2) << kOpcodeShift,
327 SLTIU = ((1 << 3) + 3) << kOpcodeShift, 340 SLTIU = ((1 << 3) + 3) << kOpcodeShift,
328 ANDI = ((1 << 3) + 4) << kOpcodeShift, 341 ANDI = ((1 << 3) + 4) << kOpcodeShift,
329 ORI = ((1 << 3) + 5) << kOpcodeShift, 342 ORI = ((1 << 3) + 5) << kOpcodeShift,
330 XORI = ((1 << 3) + 6) << kOpcodeShift, 343 XORI = ((1 << 3) + 6) << kOpcodeShift,
331 LUI = ((1 << 3) + 7) << kOpcodeShift, // LUI/AUI family. 344 LUI = ((1 << 3) + 7) << kOpcodeShift, // LUI/AUI family.
332 345
333 BEQC = ((2 << 3) + 0) << kOpcodeShift, 346 BEQC = ((2 << 3) + 0) << kOpcodeShift,
334 COP1 = ((2 << 3) + 1) << kOpcodeShift, // Coprocessor 1 class. 347 COP1 = ((2 << 3) + 1) << kOpcodeShift, // Coprocessor 1 class.
335 BEQL = ((2 << 3) + 4) << kOpcodeShift, 348 BEQL = ((2 << 3) + 4) << kOpcodeShift,
336 BNEL = ((2 << 3) + 5) << kOpcodeShift, 349 BNEL = ((2 << 3) + 5) << kOpcodeShift,
337 BLEZL = ((2 << 3) + 6) << kOpcodeShift, 350 BLEZL = ((2 << 3) + 6) << kOpcodeShift,
338 BGTZL = ((2 << 3) + 7) << kOpcodeShift, 351 BGTZL = ((2 << 3) + 7) << kOpcodeShift,
339 352
340 DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC. 353 DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC.
341 SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift, 354 SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift,
342 SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift, 355 SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift,
343 356
344 LB = ((4 << 3) + 0) << kOpcodeShift, 357 LB = ((4 << 3) + 0) << kOpcodeShift,
345 LH = ((4 << 3) + 1) << kOpcodeShift, 358 LH = ((4 << 3) + 1) << kOpcodeShift,
346 LWL = ((4 << 3) + 2) << kOpcodeShift, 359 LWL = ((4 << 3) + 2) << kOpcodeShift,
347 LW = ((4 << 3) + 3) << kOpcodeShift, 360 LW = ((4 << 3) + 3) << kOpcodeShift,
348 LBU = ((4 << 3) + 4) << kOpcodeShift, 361 LBU = ((4 << 3) + 4) << kOpcodeShift,
349 LHU = ((4 << 3) + 5) << kOpcodeShift, 362 LHU = ((4 << 3) + 5) << kOpcodeShift,
350 LWR = ((4 << 3) + 6) << kOpcodeShift, 363 LWR = ((4 << 3) + 6) << kOpcodeShift,
351 SB = ((5 << 3) + 0) << kOpcodeShift, 364 SB = ((5 << 3) + 0) << kOpcodeShift,
352 SH = ((5 << 3) + 1) << kOpcodeShift, 365 SH = ((5 << 3) + 1) << kOpcodeShift,
353 SWL = ((5 << 3) + 2) << kOpcodeShift, 366 SWL = ((5 << 3) + 2) << kOpcodeShift,
354 SW = ((5 << 3) + 3) << kOpcodeShift, 367 SW = ((5 << 3) + 3) << kOpcodeShift,
355 SWR = ((5 << 3) + 6) << kOpcodeShift, 368 SWR = ((5 << 3) + 6) << kOpcodeShift,
356 369
357 LWC1 = ((6 << 3) + 1) << kOpcodeShift, 370 LWC1 = ((6 << 3) + 1) << kOpcodeShift,
358 LDC1 = ((6 << 3) + 5) << kOpcodeShift, 371 BC = ((6 << 3) + 2) << kOpcodeShift,
359 BEQZC = ((6 << 3) + 6) << kOpcodeShift, 372 LDC1 = ((6 << 3) + 5) << kOpcodeShift,
373 POP66 = ((6 << 3) + 6) << kOpcodeShift,
360 374
361 PREF = ((6 << 3) + 3) << kOpcodeShift, 375 PREF = ((6 << 3) + 3) << kOpcodeShift,
362 376
363 SWC1 = ((7 << 3) + 1) << kOpcodeShift, 377 SWC1 = ((7 << 3) + 1) << kOpcodeShift,
364 SDC1 = ((7 << 3) + 5) << kOpcodeShift, 378 BALC = ((7 << 3) + 2) << kOpcodeShift,
365 BNEZC = ((7 << 3) + 6) << kOpcodeShift, 379 PCREL = ((7 << 3) + 3) << kOpcodeShift,
380 SDC1 = ((7 << 3) + 5) << kOpcodeShift,
381 POP76 = ((7 << 3) + 6) << kOpcodeShift,
366 382
367 COP1X = ((1 << 4) + 3) << kOpcodeShift 383 COP1X = ((1 << 4) + 3) << kOpcodeShift
368 }; 384 };
369 385
370 enum SecondaryField { 386 enum SecondaryField {
371 // SPECIAL Encoding of Function Field. 387 // SPECIAL Encoding of Function Field.
372 SLL = ((0 << 3) + 0), 388 SLL = ((0 << 3) + 0),
373 MOVCI = ((0 << 3) + 1), 389 MOVCI = ((0 << 3) + 1),
374 SRL = ((0 << 3) + 2), 390 SRL = ((0 << 3) + 2),
375 SRA = ((0 << 3) + 3), 391 SRA = ((0 << 3) + 3),
376 SLLV = ((0 << 3) + 4), 392 SLLV = ((0 << 3) + 4),
377 SRLV = ((0 << 3) + 6), 393 SRLV = ((0 << 3) + 6),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 DIV_MOD_U = ((3 << 3) + 3), 444 DIV_MOD_U = ((3 << 3) + 3),
429 445
430 // SPECIAL2 Encoding of Function Field. 446 // SPECIAL2 Encoding of Function Field.
431 MUL = ((0 << 3) + 2), 447 MUL = ((0 << 3) + 2),
432 CLZ = ((4 << 3) + 0), 448 CLZ = ((4 << 3) + 0),
433 CLO = ((4 << 3) + 1), 449 CLO = ((4 << 3) + 1),
434 450
435 // SPECIAL3 Encoding of Function Field. 451 // SPECIAL3 Encoding of Function Field.
436 EXT = ((0 << 3) + 0), 452 EXT = ((0 << 3) + 0),
437 INS = ((0 << 3) + 4), 453 INS = ((0 << 3) + 4),
438 BITSWAP = ((4 << 3) + 0), 454 BSHFL = ((4 << 3) + 0),
455
456 // SPECIAL3 Encoding of sa Field
paul.l... 2015/06/10 03:49:25 nit: period at the end of all comments. Here and b
ilija.pavlovic 2015/06/12 09:51:33 Done.
457 BITSWAP = ((0 << 3) + 0),
458 ALIGN = ((0 << 3) + 2),
459 WSBH = ((0 << 3) + 2),
460 SEB = ((2 << 3) + 0),
461 SEH = ((3 << 3) + 0),
439 462
440 // REGIMM encoding of rt Field. 463 // REGIMM encoding of rt Field.
441 BLTZ = ((0 << 3) + 0) << 16, 464 BLTZ = ((0 << 3) + 0) << 16,
442 BGEZ = ((0 << 3) + 1) << 16, 465 BGEZ = ((0 << 3) + 1) << 16,
443 BLTZAL = ((2 << 3) + 0) << 16, 466 BLTZAL = ((2 << 3) + 0) << 16,
444 BGEZAL = ((2 << 3) + 1) << 16, 467 BGEZAL = ((2 << 3) + 1) << 16,
445 BGEZALL = ((2 << 3) + 3) << 16, 468 BGEZALL = ((2 << 3) + 3) << 16,
446 469
447 // COP1 Encoding of rs Field. 470 // COP1 Encoding of rs Field.
448 MFC1 = ((0 << 3) + 0) << 21, 471 MFC1 = ((0 << 3) + 0) << 21,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 SEL = ((2 << 3) + 0), 587 SEL = ((2 << 3) + 0),
565 MOVZ_C = ((2 << 3) + 2), 588 MOVZ_C = ((2 << 3) + 2),
566 MOVN_C = ((2 << 3) + 3), 589 MOVN_C = ((2 << 3) + 3),
567 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers. 590 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers.
568 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt 591 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt
569 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers. 592 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers.
570 // COP1 Encoding of Function Field When rs=PS. 593 // COP1 Encoding of Function Field When rs=PS.
571 // COP1X Encoding of Function Field. 594 // COP1X Encoding of Function Field.
572 MADD_D = ((4 << 3) + 1), 595 MADD_D = ((4 << 3) + 1),
573 596
597 // PCREL Encoding of rt field
598 ADDIUPC = ((0 << 2) + 0),
599 LWPC = ((0 << 2) + 1),
600 AUIPC = ((3 << 3) + 6),
601 ALUIPC = ((3 << 3) + 7),
602
603 // POP66 Encoding of rs field
604 JIC = ((0 << 5) + 0),
605
606 // POP76 Encoding of rs field
607 JIALC = ((0 << 5) + 0),
608
574 NULLSF = 0 609 NULLSF = 0
575 }; 610 };
576 611
577 612
578 // ----- Emulated conditions. 613 // ----- Emulated conditions.
579 // On MIPS we use this enum to abstract from conditional branch instructions. 614 // On MIPS we use this enum to abstract from conditional branch instructions.
580 // The 'U' prefix is used to specify unsigned comparisons. 615 // The 'U' prefix is used to specify unsigned comparisons.
581 // Opposite conditions must be paired as odd/even numbers 616 // Opposite conditions must be paired as odd/even numbers
582 // because 'NegateCondition' function flips LSB to negate condition. 617 // because 'NegateCondition' function flips LSB to negate condition.
583 enum Condition { 618 enum Condition {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } 909 }
875 910
876 inline int FtValue() const { 911 inline int FtValue() const {
877 return Bits(kFtShift + kFtBits - 1, kFtShift); 912 return Bits(kFtShift + kFtBits - 1, kFtShift);
878 } 913 }
879 914
880 inline int FrValue() const { 915 inline int FrValue() const {
881 return Bits(kFrShift + kFrBits -1, kFrShift); 916 return Bits(kFrShift + kFrBits -1, kFrShift);
882 } 917 }
883 918
919 inline int Bp2Value() const {
920 DCHECK(InstructionType() == kRegisterType);
921 return Bits(kBp2Shift + kBp2Bits - 1, kBp2Shift);
922 }
923
884 // Float Compare condition code instruction bits. 924 // Float Compare condition code instruction bits.
885 inline int FCccValue() const { 925 inline int FCccValue() const {
886 return Bits(kFCccShift + kFCccBits - 1, kFCccShift); 926 return Bits(kFCccShift + kFCccBits - 1, kFCccShift);
887 } 927 }
888 928
889 // Float Branch condition code instruction bits. 929 // Float Branch condition code instruction bits.
890 inline int FBccValue() const { 930 inline int FBccValue() const {
891 return Bits(kFBccShift + kFBccBits - 1, kFBccShift); 931 return Bits(kFBccShift + kFBccBits - 1, kFBccShift);
892 } 932 }
893 933
(...skipping 23 matching lines...) Expand all
917 InstructionType() == kImmediateType); 957 InstructionType() == kImmediateType);
918 return InstructionBits() & kRtFieldMask; 958 return InstructionBits() & kRtFieldMask;
919 } 959 }
920 960
921 inline int RdFieldRaw() const { 961 inline int RdFieldRaw() const {
922 DCHECK(InstructionType() == kRegisterType); 962 DCHECK(InstructionType() == kRegisterType);
923 return InstructionBits() & kRdFieldMask; 963 return InstructionBits() & kRdFieldMask;
924 } 964 }
925 965
926 inline int SaFieldRaw() const { 966 inline int SaFieldRaw() const {
927 DCHECK(InstructionType() == kRegisterType); 967 // DCHECK(InstructionType() == kRegisterType);
paul.l... 2015/06/10 03:49:25 Hmmm, either fix it, or delete it, we shouldn't ha
ilija.pavlovic 2015/06/12 09:51:32 Deleted. Done.
928 return InstructionBits() & kSaFieldMask; 968 return InstructionBits() & kSaFieldMask;
929 } 969 }
930 970
931 inline int FunctionFieldRaw() const { 971 inline int FunctionFieldRaw() const {
932 return InstructionBits() & kFunctionFieldMask; 972 return InstructionBits() & kFunctionFieldMask;
933 } 973 }
934 974
935 // Get the secondary field according to the opcode. 975 // Get the secondary field according to the opcode.
936 inline int SecondaryValue() const { 976 inline int SecondaryValue() const {
937 Opcode op = OpcodeFieldRaw(); 977 Opcode op = OpcodeFieldRaw();
938 switch (op) { 978 switch (op) {
939 case SPECIAL: 979 case SPECIAL:
940 case SPECIAL2: 980 case SPECIAL2:
941 return FunctionValue(); 981 return FunctionValue();
942 case COP1: 982 case COP1:
943 return RsValue(); 983 return RsValue();
944 case REGIMM: 984 case REGIMM:
945 return RtValue(); 985 return RtValue();
946 default: 986 default:
947 return NULLSF; 987 return NULLSF;
948 } 988 }
949 } 989 }
950 990
951 inline int32_t Imm16Value() const { 991 inline int32_t Imm16Value() const {
952 DCHECK(InstructionType() == kImmediateType); 992 DCHECK(InstructionType() == kImmediateType);
953 return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift); 993 return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift);
954 } 994 }
955 995
996 inline int32_t Imm18Value() const {
997 DCHECK(InstructionType() == kImmediateType);
998 return Bits(kImm18Shift + kImm18Bits - 1, kImm18Shift);
999 }
1000
1001 inline int32_t Imm19Value() const {
1002 DCHECK(InstructionType() == kImmediateType);
1003 return Bits(kImm19Shift + kImm19Bits - 1, kImm19Shift);
1004 }
1005
956 inline int32_t Imm21Value() const { 1006 inline int32_t Imm21Value() const {
957 DCHECK(InstructionType() == kImmediateType); 1007 DCHECK(InstructionType() == kImmediateType);
958 return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift); 1008 return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift);
959 } 1009 }
960 1010
961 inline int32_t Imm26Value() const { 1011 inline int32_t Imm26Value() const {
962 DCHECK(InstructionType() == kJumpType); 1012 DCHECK((InstructionType() == kJumpType) ||
1013 (InstructionType() == kImmediateType));
963 return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift); 1014 return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift);
964 } 1015 }
965 1016
966 // Say if the instruction should not be used in a branch delay slot. 1017 // Say if the instruction should not be used in a branch delay slot.
967 bool IsForbiddenInBranchDelay() const; 1018 bool IsForbiddenInBranchDelay() const;
968 // Say if the instruction 'links'. e.g. jal, bal. 1019 // Say if the instruction 'links'. e.g. jal, bal.
969 bool IsLinkingInstruction() const; 1020 bool IsLinkingInstruction() const;
970 // Say if the instruction is a break or a trap. 1021 // Say if the instruction is a break or a trap.
971 bool IsTrap() const; 1022 bool IsTrap() const;
972 1023
(...skipping 21 matching lines...) Expand all
994 // JS argument slots size. 1045 // JS argument slots size.
995 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; 1046 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize;
996 // Assembly builtins argument slots size. 1047 // Assembly builtins argument slots size.
997 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; 1048 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize;
998 1049
999 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; 1050 const int kBranchReturnOffset = 2 * Instruction::kInstrSize;
1000 1051
1001 } } // namespace v8::internal 1052 } } // namespace v8::internal
1002 1053
1003 #endif // #ifndef V8_MIPS_CONSTANTS_H_ 1054 #endif // #ifndef V8_MIPS_CONSTANTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698