| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 DIV_MOD_U = ((3 << 3) + 3), | 428 DIV_MOD_U = ((3 << 3) + 3), |
| 429 | 429 |
| 430 // SPECIAL2 Encoding of Function Field. | 430 // SPECIAL2 Encoding of Function Field. |
| 431 MUL = ((0 << 3) + 2), | 431 MUL = ((0 << 3) + 2), |
| 432 CLZ = ((4 << 3) + 0), | 432 CLZ = ((4 << 3) + 0), |
| 433 CLO = ((4 << 3) + 1), | 433 CLO = ((4 << 3) + 1), |
| 434 | 434 |
| 435 // SPECIAL3 Encoding of Function Field. | 435 // SPECIAL3 Encoding of Function Field. |
| 436 EXT = ((0 << 3) + 0), | 436 EXT = ((0 << 3) + 0), |
| 437 INS = ((0 << 3) + 4), | 437 INS = ((0 << 3) + 4), |
| 438 BITSWAP = ((4 << 3) + 0), |
| 438 | 439 |
| 439 // REGIMM encoding of rt Field. | 440 // REGIMM encoding of rt Field. |
| 440 BLTZ = ((0 << 3) + 0) << 16, | 441 BLTZ = ((0 << 3) + 0) << 16, |
| 441 BGEZ = ((0 << 3) + 1) << 16, | 442 BGEZ = ((0 << 3) + 1) << 16, |
| 442 BLTZAL = ((2 << 3) + 0) << 16, | 443 BLTZAL = ((2 << 3) + 0) << 16, |
| 443 BGEZAL = ((2 << 3) + 1) << 16, | 444 BGEZAL = ((2 << 3) + 1) << 16, |
| 444 BGEZALL = ((2 << 3) + 3) << 16, | 445 BGEZALL = ((2 << 3) + 3) << 16, |
| 445 | 446 |
| 446 // COP1 Encoding of rs Field. | 447 // COP1 Encoding of rs Field. |
| 447 MFC1 = ((0 << 3) + 0) << 21, | 448 MFC1 = ((0 << 3) + 0) << 21, |
| 448 CFC1 = ((0 << 3) + 2) << 21, | 449 CFC1 = ((0 << 3) + 2) << 21, |
| 449 MFHC1 = ((0 << 3) + 3) << 21, | 450 MFHC1 = ((0 << 3) + 3) << 21, |
| 450 MTC1 = ((0 << 3) + 4) << 21, | 451 MTC1 = ((0 << 3) + 4) << 21, |
| 451 CTC1 = ((0 << 3) + 6) << 21, | 452 CTC1 = ((0 << 3) + 6) << 21, |
| 452 MTHC1 = ((0 << 3) + 7) << 21, | 453 MTHC1 = ((0 << 3) + 7) << 21, |
| 453 BC1 = ((1 << 3) + 0) << 21, | 454 BC1 = ((1 << 3) + 0) << 21, |
| 454 S = ((2 << 3) + 0) << 21, | 455 S = ((2 << 3) + 0) << 21, |
| 455 D = ((2 << 3) + 1) << 21, | 456 D = ((2 << 3) + 1) << 21, |
| 456 W = ((2 << 3) + 4) << 21, | 457 W = ((2 << 3) + 4) << 21, |
| 457 L = ((2 << 3) + 5) << 21, | 458 L = ((2 << 3) + 5) << 21, |
| 458 PS = ((2 << 3) + 6) << 21, | 459 PS = ((2 << 3) + 6) << 21, |
| 459 // COP1 Encoding of Function Field When rs=S. | 460 // COP1 Encoding of Function Field When rs=S. |
| 461 |
| 460 ADD_S = ((0 << 3) + 0), | 462 ADD_S = ((0 << 3) + 0), |
| 461 SUB_S = ((0 << 3) + 1), | 463 SUB_S = ((0 << 3) + 1), |
| 462 MUL_S = ((0 << 3) + 2), | 464 MUL_S = ((0 << 3) + 2), |
| 463 DIV_S = ((0 << 3) + 3), | 465 DIV_S = ((0 << 3) + 3), |
| 464 ABS_S = ((0 << 3) + 5), | 466 ABS_S = ((0 << 3) + 5), |
| 465 SQRT_S = ((0 << 3) + 4), | 467 SQRT_S = ((0 << 3) + 4), |
| 466 MOV_S = ((0 << 3) + 6), | 468 MOV_S = ((0 << 3) + 6), |
| 467 NEG_S = ((0 << 3) + 7), | 469 NEG_S = ((0 << 3) + 7), |
| 468 ROUND_L_S = ((1 << 3) + 0), | 470 ROUND_L_S = ((1 << 3) + 0), |
| 469 TRUNC_L_S = ((1 << 3) + 1), | 471 TRUNC_L_S = ((1 << 3) + 1), |
| 470 CEIL_L_S = ((1 << 3) + 2), | 472 CEIL_L_S = ((1 << 3) + 2), |
| 471 FLOOR_L_S = ((1 << 3) + 3), | 473 FLOOR_L_S = ((1 << 3) + 3), |
| 472 ROUND_W_S = ((1 << 3) + 4), | 474 ROUND_W_S = ((1 << 3) + 4), |
| 473 TRUNC_W_S = ((1 << 3) + 5), | 475 TRUNC_W_S = ((1 << 3) + 5), |
| 474 CEIL_W_S = ((1 << 3) + 6), | 476 CEIL_W_S = ((1 << 3) + 6), |
| 475 FLOOR_W_S = ((1 << 3) + 7), | 477 FLOOR_W_S = ((1 << 3) + 7), |
| 476 RECIP_S = ((2 << 3) + 5), | 478 RECIP_S = ((2 << 3) + 5), |
| 477 RSQRT_S = ((2 << 3) + 6), | 479 RSQRT_S = ((2 << 3) + 6), |
| 480 CLASS_S = ((3 << 3) + 3), |
| 478 CVT_D_S = ((4 << 3) + 1), | 481 CVT_D_S = ((4 << 3) + 1), |
| 479 CVT_W_S = ((4 << 3) + 4), | 482 CVT_W_S = ((4 << 3) + 4), |
| 480 CVT_L_S = ((4 << 3) + 5), | 483 CVT_L_S = ((4 << 3) + 5), |
| 481 CVT_PS_S = ((4 << 3) + 6), | 484 CVT_PS_S = ((4 << 3) + 6), |
| 485 |
| 482 // COP1 Encoding of Function Field When rs=D. | 486 // COP1 Encoding of Function Field When rs=D. |
| 483 ADD_D = ((0 << 3) + 0), | 487 ADD_D = ((0 << 3) + 0), |
| 484 SUB_D = ((0 << 3) + 1), | 488 SUB_D = ((0 << 3) + 1), |
| 485 MUL_D = ((0 << 3) + 2), | 489 MUL_D = ((0 << 3) + 2), |
| 486 DIV_D = ((0 << 3) + 3), | 490 DIV_D = ((0 << 3) + 3), |
| 487 SQRT_D = ((0 << 3) + 4), | 491 SQRT_D = ((0 << 3) + 4), |
| 488 ABS_D = ((0 << 3) + 5), | 492 ABS_D = ((0 << 3) + 5), |
| 489 MOV_D = ((0 << 3) + 6), | 493 MOV_D = ((0 << 3) + 6), |
| 490 NEG_D = ((0 << 3) + 7), | 494 NEG_D = ((0 << 3) + 7), |
| 491 ROUND_L_D = ((1 << 3) + 0), | 495 ROUND_L_D = ((1 << 3) + 0), |
| 492 TRUNC_L_D = ((1 << 3) + 1), | 496 TRUNC_L_D = ((1 << 3) + 1), |
| 493 CEIL_L_D = ((1 << 3) + 2), | 497 CEIL_L_D = ((1 << 3) + 2), |
| 494 FLOOR_L_D = ((1 << 3) + 3), | 498 FLOOR_L_D = ((1 << 3) + 3), |
| 495 ROUND_W_D = ((1 << 3) + 4), | 499 ROUND_W_D = ((1 << 3) + 4), |
| 496 TRUNC_W_D = ((1 << 3) + 5), | 500 TRUNC_W_D = ((1 << 3) + 5), |
| 497 CEIL_W_D = ((1 << 3) + 6), | 501 CEIL_W_D = ((1 << 3) + 6), |
| 498 FLOOR_W_D = ((1 << 3) + 7), | 502 FLOOR_W_D = ((1 << 3) + 7), |
| 499 RECIP_D = ((2 << 3) + 5), | 503 RECIP_D = ((2 << 3) + 5), |
| 500 RSQRT_D = ((2 << 3) + 6), | 504 RSQRT_D = ((2 << 3) + 6), |
| 505 CLASS_D = ((3 << 3) + 3), |
| 506 MIN = ((3 << 3) + 4), |
| 507 MINA = ((3 << 3) + 5), |
| 508 MAX = ((3 << 3) + 6), |
| 509 MAXA = ((3 << 3) + 7), |
| 501 CVT_S_D = ((4 << 3) + 0), | 510 CVT_S_D = ((4 << 3) + 0), |
| 502 CVT_W_D = ((4 << 3) + 4), | 511 CVT_W_D = ((4 << 3) + 4), |
| 503 CVT_L_D = ((4 << 3) + 5), | 512 CVT_L_D = ((4 << 3) + 5), |
| 504 C_F_D = ((6 << 3) + 0), | 513 C_F_D = ((6 << 3) + 0), |
| 505 C_UN_D = ((6 << 3) + 1), | 514 C_UN_D = ((6 << 3) + 1), |
| 506 C_EQ_D = ((6 << 3) + 2), | 515 C_EQ_D = ((6 << 3) + 2), |
| 507 C_UEQ_D = ((6 << 3) + 3), | 516 C_UEQ_D = ((6 << 3) + 3), |
| 508 C_OLT_D = ((6 << 3) + 4), | 517 C_OLT_D = ((6 << 3) + 4), |
| 509 C_ULT_D = ((6 << 3) + 5), | 518 C_ULT_D = ((6 << 3) + 5), |
| 510 C_OLE_D = ((6 << 3) + 6), | 519 C_OLE_D = ((6 << 3) + 6), |
| 511 C_ULE_D = ((6 << 3) + 7), | 520 C_ULE_D = ((6 << 3) + 7), |
| 521 |
| 512 // COP1 Encoding of Function Field When rs=W or L. | 522 // COP1 Encoding of Function Field When rs=W or L. |
| 513 CVT_S_W = ((4 << 3) + 0), | 523 CVT_S_W = ((4 << 3) + 0), |
| 514 CVT_D_W = ((4 << 3) + 1), | 524 CVT_D_W = ((4 << 3) + 1), |
| 515 CVT_S_L = ((4 << 3) + 0), | 525 CVT_S_L = ((4 << 3) + 0), |
| 516 CVT_D_L = ((4 << 3) + 1), | 526 CVT_D_L = ((4 << 3) + 1), |
| 517 BC1EQZ = ((2 << 2) + 1) << 21, | 527 BC1EQZ = ((2 << 2) + 1) << 21, |
| 518 BC1NEZ = ((3 << 2) + 1) << 21, | 528 BC1NEZ = ((3 << 2) + 1) << 21, |
| 519 // COP1 CMP positive predicates Bit 5..4 = 00. | 529 // COP1 CMP positive predicates Bit 5..4 = 00. |
| 520 CMP_AF = ((0 << 3) + 0), | 530 CMP_AF = ((0 << 3) + 0), |
| 521 CMP_UN = ((0 << 3) + 1), | 531 CMP_UN = ((0 << 3) + 1), |
| (...skipping 22 matching lines...) Expand all Loading... |
| 544 CMP_OGT = ((2 << 3) + 7), // Reserved, not implemented. | 554 CMP_OGT = ((2 << 3) + 7), // Reserved, not implemented. |
| 545 CMP_SAT = ((3 << 3) + 0), // Reserved, not implemented. | 555 CMP_SAT = ((3 << 3) + 0), // Reserved, not implemented. |
| 546 CMP_SOR = ((3 << 3) + 1), | 556 CMP_SOR = ((3 << 3) + 1), |
| 547 CMP_SUNE = ((3 << 3) + 2), | 557 CMP_SUNE = ((3 << 3) + 2), |
| 548 CMP_SNE = ((3 << 3) + 3), | 558 CMP_SNE = ((3 << 3) + 3), |
| 549 CMP_SUGE = ((3 << 3) + 4), // Reserved, not implemented. | 559 CMP_SUGE = ((3 << 3) + 4), // Reserved, not implemented. |
| 550 CMP_SOGE = ((3 << 3) + 5), // Reserved, not implemented. | 560 CMP_SOGE = ((3 << 3) + 5), // Reserved, not implemented. |
| 551 CMP_SUGT = ((3 << 3) + 6), // Reserved, not implemented. | 561 CMP_SUGT = ((3 << 3) + 6), // Reserved, not implemented. |
| 552 CMP_SOGT = ((3 << 3) + 7), // Reserved, not implemented. | 562 CMP_SOGT = ((3 << 3) + 7), // Reserved, not implemented. |
| 553 | 563 |
| 554 MIN = ((3 << 3) + 4), | |
| 555 MINA = ((3 << 3) + 5), | |
| 556 MAX = ((3 << 3) + 6), | |
| 557 MAXA = ((3 << 3) + 7), | |
| 558 SEL = ((2 << 3) + 0), | 564 SEL = ((2 << 3) + 0), |
| 559 MOVZ_C = ((2 << 3) + 2), | 565 MOVZ_C = ((2 << 3) + 2), |
| 560 MOVN_C = ((2 << 3) + 3), | 566 MOVN_C = ((2 << 3) + 3), |
| 561 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers. | 567 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers. |
| 562 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt | 568 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt |
| 563 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers. | 569 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers. |
| 564 // COP1 Encoding of Function Field When rs=PS. | 570 // COP1 Encoding of Function Field When rs=PS. |
| 565 // COP1X Encoding of Function Field. | 571 // COP1X Encoding of Function Field. |
| 566 MADD_D = ((4 << 3) + 1), | 572 MADD_D = ((4 << 3) + 1), |
| 567 | 573 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 default: | 697 default: |
| 692 return cc; | 698 return cc; |
| 693 } | 699 } |
| 694 } | 700 } |
| 695 | 701 |
| 696 | 702 |
| 697 // ----- Coprocessor conditions. | 703 // ----- Coprocessor conditions. |
| 698 enum FPUCondition { | 704 enum FPUCondition { |
| 699 kNoFPUCondition = -1, | 705 kNoFPUCondition = -1, |
| 700 | 706 |
| 701 F = 0, // False. | 707 F = 0x00, // False. |
| 702 UN = 1, // Unordered. | 708 UN = 0x01, // Unordered. |
| 703 EQ = 2, // Equal. | 709 EQ = 0x02, // Equal. |
| 704 UEQ = 3, // Unordered or Equal. | 710 UEQ = 0x03, // Unordered or Equal. |
| 705 OLT = 4, // Ordered or Less Than. | 711 OLT = 0x04, // Ordered or Less Than, on Mips release < 6. |
| 706 ULT = 5, // Unordered or Less Than. | 712 LT = 0x04, // Ordered or Less Than, on Mips release >= 6. |
| 707 OLE = 6, // Ordered or Less Than or Equal. | 713 ULT = 0x05, // Unordered or Less Than. |
| 708 ULE = 7 // Unordered or Less Than or Equal. | 714 OLE = 0x06, // Ordered or Less Than or Equal, on Mips release < 6. |
| 715 LE = 0x06, // Ordered or Less Than or Equal, on Mips release >= 6. |
| 716 ULE = 0x07, // Unordered or Less Than or Equal. |
| 717 |
| 718 // Following constants are available on Mips release >= 6 only. |
| 719 ORD = 0x11, // Ordered, on Mips release >= 6. |
| 720 UNE = 0x12, // Not equal, on Mips release >= 6. |
| 721 NE = 0x13, // Ordered Greater Than or Less Than. on Mips >= 6 only. |
| 709 }; | 722 }; |
| 710 | 723 |
| 711 | 724 |
| 712 // FPU rounding modes. | 725 // FPU rounding modes. |
| 713 enum FPURoundingMode { | 726 enum FPURoundingMode { |
| 714 RN = 0 << 0, // Round to Nearest. | 727 RN = 0 << 0, // Round to Nearest. |
| 715 RZ = 1 << 0, // Round towards zero. | 728 RZ = 1 << 0, // Round towards zero. |
| 716 RP = 2 << 0, // Round towards Plus Infinity. | 729 RP = 2 << 0, // Round towards Plus Infinity. |
| 717 RM = 3 << 0, // Round towards Minus Infinity. | 730 RM = 3 << 0, // Round towards Minus Infinity. |
| 718 | 731 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 // JS argument slots size. | 994 // JS argument slots size. |
| 982 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; | 995 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; |
| 983 // Assembly builtins argument slots size. | 996 // Assembly builtins argument slots size. |
| 984 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; | 997 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; |
| 985 | 998 |
| 986 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; | 999 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; |
| 987 | 1000 |
| 988 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
| 989 | 1002 |
| 990 #endif // #ifndef V8_MIPS_CONSTANTS_H_ | 1003 #endif // #ifndef V8_MIPS_CONSTANTS_H_ |
| OLD | NEW |