| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 // The link chain is terminated by a value in the instruction of -1, | 474 // The link chain is terminated by a value in the instruction of -1, |
| 475 // which is an otherwise illegal value (branch -1 is inf loop). | 475 // which is an otherwise illegal value (branch -1 is inf loop). |
| 476 // The instruction 16-bit offset field addresses 32-bit words, but in | 476 // The instruction 16-bit offset field addresses 32-bit words, but in |
| 477 // code is conv to an 18-bit value addressing bytes, hence the -4 value. | 477 // code is conv to an 18-bit value addressing bytes, hence the -4 value. |
| 478 | 478 |
| 479 const int kEndOfChain = -4; | 479 const int kEndOfChain = -4; |
| 480 // Determines the end of the Jump chain (a subset of the label link chain). | 480 // Determines the end of the Jump chain (a subset of the label link chain). |
| 481 const int kEndOfJumpChain = 0; | 481 const int kEndOfJumpChain = 0; |
| 482 | 482 |
| 483 bool Assembler::IsMsaBranch(Instr instr) { |
| 484 uint32_t opcode = GetOpcodeField(instr); |
| 485 uint32_t rs_field = GetRsField(instr); |
| 486 if (opcode == COP1) { |
| 487 switch (rs_field) { |
| 488 case BZ_V: |
| 489 case BZ_B: |
| 490 case BZ_H: |
| 491 case BZ_W: |
| 492 case BZ_D: |
| 493 case BNZ_V: |
| 494 case BNZ_B: |
| 495 case BNZ_H: |
| 496 case BNZ_W: |
| 497 case BNZ_D: |
| 498 return true; |
| 499 default: |
| 500 return false; |
| 501 } |
| 502 } else { |
| 503 return false; |
| 504 } |
| 505 } |
| 483 | 506 |
| 484 bool Assembler::IsBranch(Instr instr) { | 507 bool Assembler::IsBranch(Instr instr) { |
| 485 uint32_t opcode = GetOpcodeField(instr); | 508 uint32_t opcode = GetOpcodeField(instr); |
| 486 uint32_t rt_field = GetRtField(instr); | 509 uint32_t rt_field = GetRtField(instr); |
| 487 uint32_t rs_field = GetRsField(instr); | 510 uint32_t rs_field = GetRsField(instr); |
| 488 // Checks if the instruction is a branch. | 511 // Checks if the instruction is a branch. |
| 489 bool isBranch = | 512 bool isBranch = |
| 490 opcode == BEQ || opcode == BNE || opcode == BLEZ || opcode == BGTZ || | 513 opcode == BEQ || opcode == BNE || opcode == BLEZ || opcode == BGTZ || |
| 491 opcode == BEQL || opcode == BNEL || opcode == BLEZL || opcode == BGTZL || | 514 opcode == BEQL || opcode == BNEL || opcode == BLEZL || opcode == BGTZL || |
| 492 (opcode == REGIMM && (rt_field == BLTZ || rt_field == BGEZ || | 515 (opcode == REGIMM && (rt_field == BLTZ || rt_field == BGEZ || |
| 493 rt_field == BLTZAL || rt_field == BGEZAL)) || | 516 rt_field == BLTZAL || rt_field == BGEZAL)) || |
| 494 (opcode == COP1 && rs_field == BC1) || // Coprocessor branch. | 517 (opcode == COP1 && rs_field == BC1) || // Coprocessor branch. |
| 495 (opcode == COP1 && rs_field == BC1EQZ) || | 518 (opcode == COP1 && rs_field == BC1EQZ) || |
| 496 (opcode == COP1 && rs_field == BC1NEZ); | 519 (opcode == COP1 && rs_field == BC1NEZ) || IsMsaBranch(instr); |
| 497 if (!isBranch && IsMipsArchVariant(kMips32r6)) { | 520 if (!isBranch && IsMipsArchVariant(kMips32r6)) { |
| 498 // All the 3 variants of POP10 (BOVC, BEQC, BEQZALC) and | 521 // All the 3 variants of POP10 (BOVC, BEQC, BEQZALC) and |
| 499 // POP30 (BNVC, BNEC, BNEZALC) are branch ops. | 522 // POP30 (BNVC, BNEC, BNEZALC) are branch ops. |
| 500 isBranch |= opcode == POP10 || opcode == POP30 || opcode == BC || | 523 isBranch |= opcode == POP10 || opcode == POP30 || opcode == BC || |
| 501 opcode == BALC || | 524 opcode == BALC || |
| 502 (opcode == POP66 && rs_field != 0) || // BEQZC | 525 (opcode == POP66 && rs_field != 0) || // BEQZC |
| 503 (opcode == POP76 && rs_field != 0); // BNEZC | 526 (opcode == POP76 && rs_field != 0); // BNEZC |
| 504 } | 527 } |
| 505 return isBranch; | 528 return isBranch; |
| 506 } | 529 } |
| (...skipping 3307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3814 | 3837 |
| 3815 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3838 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 3816 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3839 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
| 3817 } | 3840 } |
| 3818 } | 3841 } |
| 3819 | 3842 |
| 3820 } // namespace internal | 3843 } // namespace internal |
| 3821 } // namespace v8 | 3844 } // namespace v8 |
| 3822 | 3845 |
| 3823 #endif // V8_TARGET_ARCH_MIPS | 3846 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |