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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 1423493006: MIPS: Fix 'MIPS:r6 compact branch optimization.' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase, merge cctest/test-disasm-mips/Type0 fix. Created 5 years, 1 month 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
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/constants-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); 1416 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
1417 } else { 1417 } else {
1418 GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); 1418 GenInstrImmediate(ADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
1419 } 1419 }
1420 } 1420 }
1421 1421
1422 1422
1423 void Assembler::beqzc(Register rs, int32_t offset) { 1423 void Assembler::beqzc(Register rs, int32_t offset) {
1424 DCHECK(IsMipsArchVariant(kMips32r6)); 1424 DCHECK(IsMipsArchVariant(kMips32r6));
1425 DCHECK(!(rs.is(zero_reg))); 1425 DCHECK(!(rs.is(zero_reg)));
1426 DCHECK(is_int21(offset));
1427 GenInstrImmediate(POP66, rs, offset, CompactBranchType::COMPACT_BRANCH); 1426 GenInstrImmediate(POP66, rs, offset, CompactBranchType::COMPACT_BRANCH);
1428 } 1427 }
1429 1428
1430 1429
1431 void Assembler::bnec(Register rs, Register rt, int16_t offset) { 1430 void Assembler::bnec(Register rs, Register rt, int16_t offset) {
1432 DCHECK(IsMipsArchVariant(kMips32r6)); 1431 DCHECK(IsMipsArchVariant(kMips32r6));
1433 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0); 1432 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
1434 if (rs.code() < rt.code()) { 1433 if (rs.code() < rt.code()) {
1435 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); 1434 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
1436 } else { 1435 } else {
1437 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); 1436 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
1438 } 1437 }
1439 } 1438 }
1440 1439
1441 1440
1442 void Assembler::bnezc(Register rs, int32_t offset) { 1441 void Assembler::bnezc(Register rs, int32_t offset) {
1443 DCHECK(IsMipsArchVariant(kMips32r6)); 1442 DCHECK(IsMipsArchVariant(kMips32r6));
1444 DCHECK(!(rs.is(zero_reg))); 1443 DCHECK(!(rs.is(zero_reg)));
1445 DCHECK(is_int21(offset));
1446 GenInstrImmediate(POP76, rs, offset, CompactBranchType::COMPACT_BRANCH); 1444 GenInstrImmediate(POP76, rs, offset, CompactBranchType::COMPACT_BRANCH);
1447 } 1445 }
1448 1446
1449 1447
1450 void Assembler::j(int32_t target) { 1448 void Assembler::j(int32_t target) {
1451 #if DEBUG 1449 #if DEBUG
1452 // Get pc of delay slot. 1450 // Get pc of delay slot.
1453 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize); 1451 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize);
1454 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >> 1452 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >>
1455 (kImm26Bits + kImmFieldShift)) == 0; 1453 (kImm26Bits + kImmFieldShift)) == 0;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 DCHECK(rs.code() != rd.code()); 1488 DCHECK(rs.code() != rd.code());
1491 BlockTrampolinePoolScope block_trampoline_pool(this); 1489 BlockTrampolinePoolScope block_trampoline_pool(this);
1492 positions_recorder()->WriteRecordedPositions(); 1490 positions_recorder()->WriteRecordedPositions();
1493 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); 1491 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
1494 BlockTrampolinePoolFor(1); // For associated delay slot. 1492 BlockTrampolinePoolFor(1); // For associated delay slot.
1495 } 1493 }
1496 1494
1497 1495
1498 void Assembler::jic(Register rt, int16_t offset) { 1496 void Assembler::jic(Register rt, int16_t offset) {
1499 DCHECK(IsMipsArchVariant(kMips32r6)); 1497 DCHECK(IsMipsArchVariant(kMips32r6));
1500 GenInstrImmediate(POP66, zero_reg, rt, offset, 1498 GenInstrImmediate(POP66, zero_reg, rt, offset);
1501 CompactBranchType::COMPACT_BRANCH);
1502 } 1499 }
1503 1500
1504 1501
1505 void Assembler::jialc(Register rt, int16_t offset) { 1502 void Assembler::jialc(Register rt, int16_t offset) {
1506 DCHECK(IsMipsArchVariant(kMips32r6)); 1503 DCHECK(IsMipsArchVariant(kMips32r6));
1507 positions_recorder()->WriteRecordedPositions(); 1504 positions_recorder()->WriteRecordedPositions();
1508 GenInstrImmediate(POP76, zero_reg, rt, offset, 1505 GenInstrImmediate(POP76, zero_reg, rt, offset);
1509 CompactBranchType::COMPACT_BRANCH);
1510 } 1506 }
1511 1507
1512 1508
1513 // -------Data-processing-instructions--------- 1509 // -------Data-processing-instructions---------
1514 1510
1515 // Arithmetic. 1511 // Arithmetic.
1516 1512
1517 void Assembler::addu(Register rd, Register rs, Register rt) { 1513 void Assembler::addu(Register rd, Register rs, Register rt) {
1518 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU); 1514 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU);
1519 } 1515 }
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
3027 3023
3028 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3024 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3029 CpuFeatures::FlushICache(pc, 2 * sizeof(int32_t)); 3025 CpuFeatures::FlushICache(pc, 2 * sizeof(int32_t));
3030 } 3026 }
3031 } 3027 }
3032 3028
3033 } // namespace internal 3029 } // namespace internal
3034 } // namespace v8 3030 } // namespace v8
3035 3031
3036 #endif // V8_TARGET_ARCH_MIPS 3032 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/constants-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698