| Index: src/mips/macro-assembler-mips.cc
|
| diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
|
| index 7faf8784f821a355c98857ef1418d5ed0bccadfe..c73bb3611723bbed3747d5187efd38c4ddbc2810 100644
|
| --- a/src/mips/macro-assembler-mips.cc
|
| +++ b/src/mips/macro-assembler-mips.cc
|
| @@ -1108,6 +1108,7 @@ void MacroAssembler::BranchF(Label* target,
|
| FPURegister cmp1,
|
| FPURegister cmp2,
|
| BranchDelaySlot bd) {
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| if (cc == al) {
|
| Branch(bd, target);
|
| return;
|
| @@ -1125,23 +1126,19 @@ void MacroAssembler::BranchF(Label* target,
|
| // have been handled by the caller.
|
| // Unsigned conditions are treated as their signed counterpart.
|
| switch (cc) {
|
| - case Uless:
|
| - case less:
|
| + case lt:
|
| c(OLT, D, cmp1, cmp2);
|
| bc1t(target);
|
| break;
|
| - case Ugreater:
|
| - case greater:
|
| + case gt:
|
| c(ULE, D, cmp1, cmp2);
|
| bc1f(target);
|
| break;
|
| - case Ugreater_equal:
|
| - case greater_equal:
|
| + case ge:
|
| c(ULT, D, cmp1, cmp2);
|
| bc1f(target);
|
| break;
|
| - case Uless_equal:
|
| - case less_equal:
|
| + case le:
|
| c(OLE, D, cmp1, cmp2);
|
| bc1t(target);
|
| break;
|
| @@ -1149,10 +1146,18 @@ void MacroAssembler::BranchF(Label* target,
|
| c(EQ, D, cmp1, cmp2);
|
| bc1t(target);
|
| break;
|
| + case ueq:
|
| + c(UEQ, D, cmp1, cmp2);
|
| + bc1t(target);
|
| + break;
|
| case ne:
|
| c(EQ, D, cmp1, cmp2);
|
| bc1f(target);
|
| break;
|
| + case nue:
|
| + c(UEQ, D, cmp1, cmp2);
|
| + bc1f(target);
|
| + break;
|
| default:
|
| CHECK(0);
|
| };
|
| @@ -1696,6 +1701,7 @@ void MacroAssembler::BranchShort(int16_t offset, Condition cond, Register rs,
|
| if (rt.is_reg()) {
|
| // NOTE: 'at' can be clobbered by Branch but it is legal to use it as rs or
|
| // rt.
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| r2 = rt.rm_;
|
| switch (cond) {
|
| case cc_always:
|
| @@ -1781,6 +1787,7 @@ void MacroAssembler::BranchShort(int16_t offset, Condition cond, Register rs,
|
| // Be careful to always use shifted_branch_offset only just before the
|
| // branch instruction, as the location will be remember for patching the
|
| // target.
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| switch (cond) {
|
| case cc_always:
|
| b(offset);
|
| @@ -1925,6 +1932,7 @@ void MacroAssembler::BranchShort(Label* L, Condition cond, Register rs,
|
| Register r2 = no_reg;
|
| Register scratch = at;
|
| if (rt.is_reg()) {
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| r2 = rt.rm_;
|
| // Be careful to always use shifted_branch_offset only just before the
|
| // branch instruction, as the location will be remember for patching the
|
| @@ -2031,6 +2039,7 @@ void MacroAssembler::BranchShort(Label* L, Condition cond, Register rs,
|
| // Be careful to always use shifted_branch_offset only just before the
|
| // branch instruction, as the location will be remember for patching the
|
| // target.
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| switch (cond) {
|
| case cc_always:
|
| offset = shifted_branch_offset(L, false);
|
| @@ -2267,67 +2276,70 @@ void MacroAssembler::BranchAndLinkShort(int16_t offset, Condition cond,
|
| li(r2, rt);
|
| }
|
|
|
| - switch (cond) {
|
| - case cc_always:
|
| - bal(offset);
|
| - break;
|
| - case eq:
|
| - bne(rs, r2, 2);
|
| - nop();
|
| - bal(offset);
|
| - break;
|
| - case ne:
|
| - beq(rs, r2, 2);
|
| - nop();
|
| - bal(offset);
|
| - break;
|
| + {
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| + switch (cond) {
|
| + case cc_always:
|
| + bal(offset);
|
| + break;
|
| + case eq:
|
| + bne(rs, r2, 2);
|
| + nop();
|
| + bal(offset);
|
| + break;
|
| + case ne:
|
| + beq(rs, r2, 2);
|
| + nop();
|
| + bal(offset);
|
| + break;
|
|
|
| - // Signed comparison.
|
| - case greater:
|
| - slt(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case greater_equal:
|
| - slt(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - bltzal(scratch, offset);
|
| - break;
|
| - case less:
|
| - slt(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case less_equal:
|
| - slt(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - bltzal(scratch, offset);
|
| - break;
|
| + // Signed comparison.
|
| + case greater:
|
| + slt(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case greater_equal:
|
| + slt(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + bltzal(scratch, offset);
|
| + break;
|
| + case less:
|
| + slt(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case less_equal:
|
| + slt(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + bltzal(scratch, offset);
|
| + break;
|
|
|
| - // Unsigned comparison.
|
| - case Ugreater:
|
| - sltu(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case Ugreater_equal:
|
| - sltu(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - bltzal(scratch, offset);
|
| - break;
|
| - case Uless:
|
| - sltu(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case Uless_equal:
|
| - sltu(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - bltzal(scratch, offset);
|
| - break;
|
| + // Unsigned comparison.
|
| + case Ugreater:
|
| + sltu(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case Ugreater_equal:
|
| + sltu(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + bltzal(scratch, offset);
|
| + break;
|
| + case Uless:
|
| + sltu(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case Uless_equal:
|
| + sltu(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + bltzal(scratch, offset);
|
| + break;
|
|
|
| - default:
|
| - UNREACHABLE();
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| }
|
| // Emit a nop in the branch delay slot if required.
|
| if (bdslot == PROTECT)
|
| @@ -2359,80 +2371,82 @@ void MacroAssembler::BranchAndLinkShort(Label* L, Condition cond, Register rs,
|
| li(r2, rt);
|
| }
|
|
|
| - switch (cond) {
|
| - case cc_always:
|
| - offset = shifted_branch_offset(L, false);
|
| - bal(offset);
|
| - break;
|
| - case eq:
|
| - bne(rs, r2, 2);
|
| - nop();
|
| - offset = shifted_branch_offset(L, false);
|
| - bal(offset);
|
| - break;
|
| - case ne:
|
| - beq(rs, r2, 2);
|
| - nop();
|
| - offset = shifted_branch_offset(L, false);
|
| - bal(offset);
|
| - break;
|
| + {
|
| + BlockTrampolinePoolScope block_trampoline_pool(this);
|
| + switch (cond) {
|
| + case cc_always:
|
| + offset = shifted_branch_offset(L, false);
|
| + bal(offset);
|
| + break;
|
| + case eq:
|
| + bne(rs, r2, 2);
|
| + nop();
|
| + offset = shifted_branch_offset(L, false);
|
| + bal(offset);
|
| + break;
|
| + case ne:
|
| + beq(rs, r2, 2);
|
| + nop();
|
| + offset = shifted_branch_offset(L, false);
|
| + bal(offset);
|
| + break;
|
|
|
| - // Signed comparison.
|
| - case greater:
|
| - slt(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case greater_equal:
|
| - slt(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bltzal(scratch, offset);
|
| - break;
|
| - case less:
|
| - slt(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case less_equal:
|
| - slt(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bltzal(scratch, offset);
|
| - break;
|
| + // Signed comparison.
|
| + case greater:
|
| + slt(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case greater_equal:
|
| + slt(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bltzal(scratch, offset);
|
| + break;
|
| + case less:
|
| + slt(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case less_equal:
|
| + slt(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bltzal(scratch, offset);
|
| + break;
|
|
|
| - // Unsigned comparison.
|
| - case Ugreater:
|
| - sltu(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case Ugreater_equal:
|
| - sltu(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bltzal(scratch, offset);
|
| - break;
|
| - case Uless:
|
| - sltu(scratch, rs, r2);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bgezal(scratch, offset);
|
| - break;
|
| - case Uless_equal:
|
| - sltu(scratch, r2, rs);
|
| - addiu(scratch, scratch, -1);
|
| - offset = shifted_branch_offset(L, false);
|
| - bltzal(scratch, offset);
|
| - break;
|
| + // Unsigned comparison.
|
| + case Ugreater:
|
| + sltu(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case Ugreater_equal:
|
| + sltu(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bltzal(scratch, offset);
|
| + break;
|
| + case Uless:
|
| + sltu(scratch, rs, r2);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bgezal(scratch, offset);
|
| + break;
|
| + case Uless_equal:
|
| + sltu(scratch, r2, rs);
|
| + addiu(scratch, scratch, -1);
|
| + offset = shifted_branch_offset(L, false);
|
| + bltzal(scratch, offset);
|
| + break;
|
|
|
| - default:
|
| - UNREACHABLE();
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| }
|
| -
|
| // Check that offset could actually hold on an int16_t.
|
| ASSERT(is_int16(offset));
|
|
|
|
|