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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 | 1272 |
1273 | 1273 |
1274 //------- Branch and jump instructions -------- | 1274 //------- Branch and jump instructions -------- |
1275 | 1275 |
1276 void Assembler::b(int16_t offset) { | 1276 void Assembler::b(int16_t offset) { |
1277 beq(zero_reg, zero_reg, offset); | 1277 beq(zero_reg, zero_reg, offset); |
1278 } | 1278 } |
1279 | 1279 |
1280 | 1280 |
1281 void Assembler::bal(int16_t offset) { | 1281 void Assembler::bal(int16_t offset) { |
1282 positions_recorder()->WriteRecordedPositions(); | |
1283 bgezal(zero_reg, offset); | 1282 bgezal(zero_reg, offset); |
1284 } | 1283 } |
1285 | 1284 |
1286 | 1285 |
1287 void Assembler::bc(int32_t offset) { | 1286 void Assembler::bc(int32_t offset) { |
1288 DCHECK(kArchVariant == kMips64r6); | 1287 DCHECK(kArchVariant == kMips64r6); |
1289 GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH); | 1288 GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH); |
1290 } | 1289 } |
1291 | 1290 |
1292 | 1291 |
1293 void Assembler::balc(int32_t offset) { | 1292 void Assembler::balc(int32_t offset) { |
1294 DCHECK(kArchVariant == kMips64r6); | 1293 DCHECK(kArchVariant == kMips64r6); |
1295 positions_recorder()->WriteRecordedPositions(); | |
1296 GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH); | 1294 GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH); |
1297 } | 1295 } |
1298 | 1296 |
1299 | 1297 |
1300 void Assembler::beq(Register rs, Register rt, int16_t offset) { | 1298 void Assembler::beq(Register rs, Register rt, int16_t offset) { |
1301 BlockTrampolinePoolScope block_trampoline_pool(this); | 1299 BlockTrampolinePoolScope block_trampoline_pool(this); |
1302 GenInstrImmediate(BEQ, rs, rt, offset); | 1300 GenInstrImmediate(BEQ, rs, rt, offset); |
1303 BlockTrampolinePoolFor(1); // For associated delay slot. | 1301 BlockTrampolinePoolFor(1); // For associated delay slot. |
1304 } | 1302 } |
1305 | 1303 |
(...skipping 26 matching lines...) Expand all Loading... |
1332 DCHECK(!(rs.is(zero_reg))); | 1330 DCHECK(!(rs.is(zero_reg))); |
1333 DCHECK(!(rt.is(zero_reg))); | 1331 DCHECK(!(rt.is(zero_reg))); |
1334 DCHECK(rs.code() != rt.code()); | 1332 DCHECK(rs.code() != rt.code()); |
1335 GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1333 GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1336 } | 1334 } |
1337 | 1335 |
1338 | 1336 |
1339 void Assembler::bgezal(Register rs, int16_t offset) { | 1337 void Assembler::bgezal(Register rs, int16_t offset) { |
1340 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); | 1338 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); |
1341 BlockTrampolinePoolScope block_trampoline_pool(this); | 1339 BlockTrampolinePoolScope block_trampoline_pool(this); |
1342 positions_recorder()->WriteRecordedPositions(); | |
1343 GenInstrImmediate(REGIMM, rs, BGEZAL, offset); | 1340 GenInstrImmediate(REGIMM, rs, BGEZAL, offset); |
1344 BlockTrampolinePoolFor(1); // For associated delay slot. | 1341 BlockTrampolinePoolFor(1); // For associated delay slot. |
1345 } | 1342 } |
1346 | 1343 |
1347 | 1344 |
1348 void Assembler::bgtz(Register rs, int16_t offset) { | 1345 void Assembler::bgtz(Register rs, int16_t offset) { |
1349 BlockTrampolinePoolScope block_trampoline_pool(this); | 1346 BlockTrampolinePoolScope block_trampoline_pool(this); |
1350 GenInstrImmediate(BGTZ, rs, zero_reg, offset); | 1347 GenInstrImmediate(BGTZ, rs, zero_reg, offset); |
1351 BlockTrampolinePoolFor(1); // For associated delay slot. | 1348 BlockTrampolinePoolFor(1); // For associated delay slot. |
1352 } | 1349 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 void Assembler::bltz(Register rs, int16_t offset) { | 1400 void Assembler::bltz(Register rs, int16_t offset) { |
1404 BlockTrampolinePoolScope block_trampoline_pool(this); | 1401 BlockTrampolinePoolScope block_trampoline_pool(this); |
1405 GenInstrImmediate(REGIMM, rs, BLTZ, offset); | 1402 GenInstrImmediate(REGIMM, rs, BLTZ, offset); |
1406 BlockTrampolinePoolFor(1); // For associated delay slot. | 1403 BlockTrampolinePoolFor(1); // For associated delay slot. |
1407 } | 1404 } |
1408 | 1405 |
1409 | 1406 |
1410 void Assembler::bltzal(Register rs, int16_t offset) { | 1407 void Assembler::bltzal(Register rs, int16_t offset) { |
1411 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); | 1408 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); |
1412 BlockTrampolinePoolScope block_trampoline_pool(this); | 1409 BlockTrampolinePoolScope block_trampoline_pool(this); |
1413 positions_recorder()->WriteRecordedPositions(); | |
1414 GenInstrImmediate(REGIMM, rs, BLTZAL, offset); | 1410 GenInstrImmediate(REGIMM, rs, BLTZAL, offset); |
1415 BlockTrampolinePoolFor(1); // For associated delay slot. | 1411 BlockTrampolinePoolFor(1); // For associated delay slot. |
1416 } | 1412 } |
1417 | 1413 |
1418 | 1414 |
1419 void Assembler::bne(Register rs, Register rt, int16_t offset) { | 1415 void Assembler::bne(Register rs, Register rt, int16_t offset) { |
1420 BlockTrampolinePoolScope block_trampoline_pool(this); | 1416 BlockTrampolinePoolScope block_trampoline_pool(this); |
1421 GenInstrImmediate(BNE, rs, rt, offset); | 1417 GenInstrImmediate(BNE, rs, rt, offset); |
1422 BlockTrampolinePoolFor(1); // For associated delay slot. | 1418 BlockTrampolinePoolFor(1); // For associated delay slot. |
1423 } | 1419 } |
(...skipping 15 matching lines...) Expand all Loading... |
1439 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1435 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1440 } else { | 1436 } else { |
1441 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); | 1437 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); |
1442 } | 1438 } |
1443 } | 1439 } |
1444 | 1440 |
1445 | 1441 |
1446 void Assembler::blezalc(Register rt, int16_t offset) { | 1442 void Assembler::blezalc(Register rt, int16_t offset) { |
1447 DCHECK(kArchVariant == kMips64r6); | 1443 DCHECK(kArchVariant == kMips64r6); |
1448 DCHECK(!(rt.is(zero_reg))); | 1444 DCHECK(!(rt.is(zero_reg))); |
1449 positions_recorder()->WriteRecordedPositions(); | |
1450 GenInstrImmediate(BLEZ, zero_reg, rt, offset, | 1445 GenInstrImmediate(BLEZ, zero_reg, rt, offset, |
1451 CompactBranchType::COMPACT_BRANCH); | 1446 CompactBranchType::COMPACT_BRANCH); |
1452 } | 1447 } |
1453 | 1448 |
1454 | 1449 |
1455 void Assembler::bgezalc(Register rt, int16_t offset) { | 1450 void Assembler::bgezalc(Register rt, int16_t offset) { |
1456 DCHECK(kArchVariant == kMips64r6); | 1451 DCHECK(kArchVariant == kMips64r6); |
1457 DCHECK(!(rt.is(zero_reg))); | 1452 DCHECK(!(rt.is(zero_reg))); |
1458 positions_recorder()->WriteRecordedPositions(); | |
1459 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1453 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1460 } | 1454 } |
1461 | 1455 |
1462 | 1456 |
1463 void Assembler::bgezall(Register rs, int16_t offset) { | 1457 void Assembler::bgezall(Register rs, int16_t offset) { |
1464 DCHECK(kArchVariant != kMips64r6); | 1458 DCHECK(kArchVariant != kMips64r6); |
1465 DCHECK(!(rs.is(zero_reg))); | 1459 DCHECK(!(rs.is(zero_reg))); |
1466 BlockTrampolinePoolScope block_trampoline_pool(this); | 1460 BlockTrampolinePoolScope block_trampoline_pool(this); |
1467 positions_recorder()->WriteRecordedPositions(); | |
1468 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); | 1461 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); |
1469 BlockTrampolinePoolFor(1); // For associated delay slot. | 1462 BlockTrampolinePoolFor(1); // For associated delay slot. |
1470 } | 1463 } |
1471 | 1464 |
1472 | 1465 |
1473 void Assembler::bltzalc(Register rt, int16_t offset) { | 1466 void Assembler::bltzalc(Register rt, int16_t offset) { |
1474 DCHECK(kArchVariant == kMips64r6); | 1467 DCHECK(kArchVariant == kMips64r6); |
1475 DCHECK(!(rt.is(zero_reg))); | 1468 DCHECK(!(rt.is(zero_reg))); |
1476 positions_recorder()->WriteRecordedPositions(); | |
1477 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1469 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1478 } | 1470 } |
1479 | 1471 |
1480 | 1472 |
1481 void Assembler::bgtzalc(Register rt, int16_t offset) { | 1473 void Assembler::bgtzalc(Register rt, int16_t offset) { |
1482 DCHECK(kArchVariant == kMips64r6); | 1474 DCHECK(kArchVariant == kMips64r6); |
1483 DCHECK(!(rt.is(zero_reg))); | 1475 DCHECK(!(rt.is(zero_reg))); |
1484 positions_recorder()->WriteRecordedPositions(); | |
1485 GenInstrImmediate(BGTZ, zero_reg, rt, offset, | 1476 GenInstrImmediate(BGTZ, zero_reg, rt, offset, |
1486 CompactBranchType::COMPACT_BRANCH); | 1477 CompactBranchType::COMPACT_BRANCH); |
1487 } | 1478 } |
1488 | 1479 |
1489 | 1480 |
1490 void Assembler::beqzalc(Register rt, int16_t offset) { | 1481 void Assembler::beqzalc(Register rt, int16_t offset) { |
1491 DCHECK(kArchVariant == kMips64r6); | 1482 DCHECK(kArchVariant == kMips64r6); |
1492 DCHECK(!(rt.is(zero_reg))); | 1483 DCHECK(!(rt.is(zero_reg))); |
1493 positions_recorder()->WriteRecordedPositions(); | |
1494 GenInstrImmediate(ADDI, zero_reg, rt, offset, | 1484 GenInstrImmediate(ADDI, zero_reg, rt, offset, |
1495 CompactBranchType::COMPACT_BRANCH); | 1485 CompactBranchType::COMPACT_BRANCH); |
1496 } | 1486 } |
1497 | 1487 |
1498 | 1488 |
1499 void Assembler::bnezalc(Register rt, int16_t offset) { | 1489 void Assembler::bnezalc(Register rt, int16_t offset) { |
1500 DCHECK(kArchVariant == kMips64r6); | 1490 DCHECK(kArchVariant == kMips64r6); |
1501 DCHECK(!(rt.is(zero_reg))); | 1491 DCHECK(!(rt.is(zero_reg))); |
1502 positions_recorder()->WriteRecordedPositions(); | |
1503 GenInstrImmediate(DADDI, zero_reg, rt, offset, | 1492 GenInstrImmediate(DADDI, zero_reg, rt, offset, |
1504 CompactBranchType::COMPACT_BRANCH); | 1493 CompactBranchType::COMPACT_BRANCH); |
1505 } | 1494 } |
1506 | 1495 |
1507 | 1496 |
1508 void Assembler::beqc(Register rs, Register rt, int16_t offset) { | 1497 void Assembler::beqc(Register rs, Register rt, int16_t offset) { |
1509 DCHECK(kArchVariant == kMips64r6); | 1498 DCHECK(kArchVariant == kMips64r6); |
1510 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0); | 1499 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0); |
1511 if (rs.code() < rt.code()) { | 1500 if (rs.code() < rt.code()) { |
1512 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1501 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 } else { | 1547 } else { |
1559 j(imm); | 1548 j(imm); |
1560 } | 1549 } |
1561 } | 1550 } |
1562 | 1551 |
1563 | 1552 |
1564 void Assembler::jal(Label* target) { | 1553 void Assembler::jal(Label* target) { |
1565 uint64_t imm = jump_offset(target); | 1554 uint64_t imm = jump_offset(target); |
1566 if (target->is_bound()) { | 1555 if (target->is_bound()) { |
1567 BlockTrampolinePoolScope block_trampoline_pool(this); | 1556 BlockTrampolinePoolScope block_trampoline_pool(this); |
1568 positions_recorder()->WriteRecordedPositions(); | |
1569 GenInstrJump(static_cast<Opcode>(kJalRawMark), | 1557 GenInstrJump(static_cast<Opcode>(kJalRawMark), |
1570 static_cast<uint32_t>(imm >> 2) & kImm26Mask); | 1558 static_cast<uint32_t>(imm >> 2) & kImm26Mask); |
1571 BlockTrampolinePoolFor(1); // For associated delay slot. | 1559 BlockTrampolinePoolFor(1); // For associated delay slot. |
1572 } else { | 1560 } else { |
1573 jal(imm); | 1561 jal(imm); |
1574 } | 1562 } |
1575 } | 1563 } |
1576 | 1564 |
1577 | 1565 |
1578 void Assembler::jr(Register rs) { | 1566 void Assembler::jr(Register rs) { |
1579 if (kArchVariant != kMips64r6) { | 1567 if (kArchVariant != kMips64r6) { |
1580 BlockTrampolinePoolScope block_trampoline_pool(this); | 1568 BlockTrampolinePoolScope block_trampoline_pool(this); |
1581 if (rs.is(ra)) { | |
1582 positions_recorder()->WriteRecordedPositions(); | |
1583 } | |
1584 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); | 1569 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); |
1585 BlockTrampolinePoolFor(1); // For associated delay slot. | 1570 BlockTrampolinePoolFor(1); // For associated delay slot. |
1586 } else { | 1571 } else { |
1587 jalr(rs, zero_reg); | 1572 jalr(rs, zero_reg); |
1588 } | 1573 } |
1589 } | 1574 } |
1590 | 1575 |
1591 | 1576 |
1592 void Assembler::jal(int64_t target) { | 1577 void Assembler::jal(int64_t target) { |
1593 BlockTrampolinePoolScope block_trampoline_pool(this); | 1578 BlockTrampolinePoolScope block_trampoline_pool(this); |
1594 positions_recorder()->WriteRecordedPositions(); | |
1595 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask); | 1579 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask); |
1596 BlockTrampolinePoolFor(1); // For associated delay slot. | 1580 BlockTrampolinePoolFor(1); // For associated delay slot. |
1597 } | 1581 } |
1598 | 1582 |
1599 | 1583 |
1600 void Assembler::jalr(Register rs, Register rd) { | 1584 void Assembler::jalr(Register rs, Register rd) { |
1601 DCHECK(rs.code() != rd.code()); | 1585 DCHECK(rs.code() != rd.code()); |
1602 BlockTrampolinePoolScope block_trampoline_pool(this); | 1586 BlockTrampolinePoolScope block_trampoline_pool(this); |
1603 positions_recorder()->WriteRecordedPositions(); | |
1604 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); | 1587 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); |
1605 BlockTrampolinePoolFor(1); // For associated delay slot. | 1588 BlockTrampolinePoolFor(1); // For associated delay slot. |
1606 } | 1589 } |
1607 | 1590 |
1608 | 1591 |
1609 void Assembler::jic(Register rt, int16_t offset) { | 1592 void Assembler::jic(Register rt, int16_t offset) { |
1610 DCHECK(kArchVariant == kMips64r6); | 1593 DCHECK(kArchVariant == kMips64r6); |
1611 GenInstrImmediate(POP66, zero_reg, rt, offset); | 1594 GenInstrImmediate(POP66, zero_reg, rt, offset); |
1612 } | 1595 } |
1613 | 1596 |
1614 | 1597 |
1615 void Assembler::jialc(Register rt, int16_t offset) { | 1598 void Assembler::jialc(Register rt, int16_t offset) { |
1616 DCHECK(kArchVariant == kMips64r6); | 1599 DCHECK(kArchVariant == kMips64r6); |
1617 positions_recorder()->WriteRecordedPositions(); | |
1618 GenInstrImmediate(POP76, zero_reg, rt, offset); | 1600 GenInstrImmediate(POP76, zero_reg, rt, offset); |
1619 } | 1601 } |
1620 | 1602 |
1621 | 1603 |
1622 // -------Data-processing-instructions--------- | 1604 // -------Data-processing-instructions--------- |
1623 | 1605 |
1624 // Arithmetic. | 1606 // Arithmetic. |
1625 | 1607 |
1626 void Assembler::addu(Register rd, Register rs, Register rt) { | 1608 void Assembler::addu(Register rd, Register rs, Register rt) { |
1627 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU); | 1609 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU); |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3466 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3448 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3467 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); | 3449 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); |
3468 } | 3450 } |
3469 } | 3451 } |
3470 | 3452 |
3471 | 3453 |
3472 } // namespace internal | 3454 } // namespace internal |
3473 } // namespace v8 | 3455 } // namespace v8 |
3474 | 3456 |
3475 #endif // V8_TARGET_ARCH_MIPS64 | 3457 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |