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

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

Issue 1046953004: MIPS: [turbofan] Add backend support for float32 operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months 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/macro-assembler-mips.h ('k') | src/mips/simulator-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 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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 1423
1424 void MacroAssembler::Mfhc1(Register rt, FPURegister fs) { 1424 void MacroAssembler::Mfhc1(Register rt, FPURegister fs) {
1425 if (IsFp64Mode()) { 1425 if (IsFp64Mode()) {
1426 mfhc1(rt, fs); 1426 mfhc1(rt, fs);
1427 } else { 1427 } else {
1428 mfc1(rt, fs.high()); 1428 mfc1(rt, fs.high());
1429 } 1429 }
1430 } 1430 }
1431 1431
1432 1432
1433 void MacroAssembler::BranchF(Label* target, 1433 void MacroAssembler::BranchFSize(SecondaryField sizeField, Label* target,
1434 Label* nan, 1434 Label* nan, Condition cc, FPURegister cmp1,
1435 Condition cc, 1435 FPURegister cmp2, BranchDelaySlot bd) {
1436 FPURegister cmp1,
1437 FPURegister cmp2,
1438 BranchDelaySlot bd) {
1439 BlockTrampolinePoolScope block_trampoline_pool(this); 1436 BlockTrampolinePoolScope block_trampoline_pool(this);
1440 if (cc == al) { 1437 if (cc == al) {
1441 Branch(bd, target); 1438 Branch(bd, target);
1442 return; 1439 return;
1443 } 1440 }
1444 1441
1442 if (IsMipsArchVariant(kMips32r6)) {
1443 sizeField = sizeField == D ? L : W;
1444 }
1445 DCHECK(nan || target); 1445 DCHECK(nan || target);
1446 // Check for unordered (NaN) cases. 1446 // Check for unordered (NaN) cases.
1447 if (nan) { 1447 if (nan) {
1448 if (!IsMipsArchVariant(kMips32r6)) { 1448 if (!IsMipsArchVariant(kMips32r6)) {
1449 c(UN, D, cmp1, cmp2); 1449 c(UN, D, cmp1, cmp2);
1450 bc1t(nan); 1450 bc1t(nan);
1451 } else { 1451 } else {
1452 // Use kDoubleCompareReg for comparison result. It has to be unavailable 1452 // Use kDoubleCompareReg for comparison result. It has to be unavailable
1453 // to lithium register allocator. 1453 // to lithium register allocator.
1454 DCHECK(!cmp1.is(kDoubleCompareReg) && !cmp2.is(kDoubleCompareReg)); 1454 DCHECK(!cmp1.is(kDoubleCompareReg) && !cmp2.is(kDoubleCompareReg));
1455 cmp(UN, L, kDoubleCompareReg, cmp1, cmp2); 1455 cmp(UN, L, kDoubleCompareReg, cmp1, cmp2);
1456 bc1nez(nan, kDoubleCompareReg); 1456 bc1nez(nan, kDoubleCompareReg);
1457 } 1457 }
1458 } 1458 }
1459 1459
1460 if (!IsMipsArchVariant(kMips32r6)) { 1460 if (!IsMipsArchVariant(kMips32r6)) {
1461 if (target) { 1461 if (target) {
1462 // Here NaN cases were either handled by this function or are assumed to 1462 // Here NaN cases were either handled by this function or are assumed to
1463 // have been handled by the caller. 1463 // have been handled by the caller.
1464 switch (cc) { 1464 switch (cc) {
1465 case lt: 1465 case lt:
1466 c(OLT, D, cmp1, cmp2); 1466 c(OLT, sizeField, cmp1, cmp2);
1467 bc1t(target); 1467 bc1t(target);
1468 break; 1468 break;
1469 case gt: 1469 case gt:
1470 c(ULE, D, cmp1, cmp2); 1470 c(ULE, sizeField, cmp1, cmp2);
1471 bc1f(target); 1471 bc1f(target);
1472 break; 1472 break;
1473 case ge: 1473 case ge:
1474 c(ULT, D, cmp1, cmp2); 1474 c(ULT, sizeField, cmp1, cmp2);
1475 bc1f(target); 1475 bc1f(target);
1476 break; 1476 break;
1477 case le: 1477 case le:
1478 c(OLE, D, cmp1, cmp2); 1478 c(OLE, sizeField, cmp1, cmp2);
1479 bc1t(target); 1479 bc1t(target);
1480 break; 1480 break;
1481 case eq: 1481 case eq:
1482 c(EQ, D, cmp1, cmp2); 1482 c(EQ, sizeField, cmp1, cmp2);
1483 bc1t(target); 1483 bc1t(target);
1484 break; 1484 break;
1485 case ueq: 1485 case ueq:
1486 c(UEQ, D, cmp1, cmp2); 1486 c(UEQ, sizeField, cmp1, cmp2);
1487 bc1t(target); 1487 bc1t(target);
1488 break; 1488 break;
1489 case ne: 1489 case ne:
1490 c(EQ, D, cmp1, cmp2); 1490 c(EQ, sizeField, cmp1, cmp2);
1491 bc1f(target); 1491 bc1f(target);
1492 break; 1492 break;
1493 case nue: 1493 case nue:
1494 c(UEQ, D, cmp1, cmp2); 1494 c(UEQ, sizeField, cmp1, cmp2);
1495 bc1f(target); 1495 bc1f(target);
1496 break; 1496 break;
1497 default: 1497 default:
1498 CHECK(0); 1498 CHECK(0);
1499 } 1499 }
1500 } 1500 }
1501 } else { 1501 } else {
1502 if (target) { 1502 if (target) {
1503 // Here NaN cases were either handled by this function or are assumed to 1503 // Here NaN cases were either handled by this function or are assumed to
1504 // have been handled by the caller. 1504 // have been handled by the caller.
1505 // Unsigned conditions are treated as their signed counterpart. 1505 // Unsigned conditions are treated as their signed counterpart.
1506 // Use kDoubleCompareReg for comparison result, it is 1506 // Use kDoubleCompareReg for comparison result, it is
1507 // valid in fp64 (FR = 1) mode which is implied for mips32r6. 1507 // valid in fp64 (FR = 1) mode which is implied for mips32r6.
1508 DCHECK(!cmp1.is(kDoubleCompareReg) && !cmp2.is(kDoubleCompareReg)); 1508 DCHECK(!cmp1.is(kDoubleCompareReg) && !cmp2.is(kDoubleCompareReg));
1509 switch (cc) { 1509 switch (cc) {
1510 case lt: 1510 case lt:
1511 cmp(OLT, L, kDoubleCompareReg, cmp1, cmp2); 1511 cmp(OLT, sizeField, kDoubleCompareReg, cmp1, cmp2);
1512 bc1nez(target, kDoubleCompareReg); 1512 bc1nez(target, kDoubleCompareReg);
1513 break; 1513 break;
1514 case gt: 1514 case gt:
1515 cmp(ULE, L, kDoubleCompareReg, cmp1, cmp2); 1515 cmp(ULE, sizeField, kDoubleCompareReg, cmp1, cmp2);
1516 bc1eqz(target, kDoubleCompareReg); 1516 bc1eqz(target, kDoubleCompareReg);
1517 break; 1517 break;
1518 case ge: 1518 case ge:
1519 cmp(ULT, L, kDoubleCompareReg, cmp1, cmp2); 1519 cmp(ULT, sizeField, kDoubleCompareReg, cmp1, cmp2);
1520 bc1eqz(target, kDoubleCompareReg); 1520 bc1eqz(target, kDoubleCompareReg);
1521 break; 1521 break;
1522 case le: 1522 case le:
1523 cmp(OLE, L, kDoubleCompareReg, cmp1, cmp2); 1523 cmp(OLE, sizeField, kDoubleCompareReg, cmp1, cmp2);
1524 bc1nez(target, kDoubleCompareReg); 1524 bc1nez(target, kDoubleCompareReg);
1525 break; 1525 break;
1526 case eq: 1526 case eq:
1527 cmp(EQ, L, kDoubleCompareReg, cmp1, cmp2); 1527 cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
1528 bc1nez(target, kDoubleCompareReg); 1528 bc1nez(target, kDoubleCompareReg);
1529 break; 1529 break;
1530 case ueq: 1530 case ueq:
1531 cmp(UEQ, L, kDoubleCompareReg, cmp1, cmp2); 1531 cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
1532 bc1nez(target, kDoubleCompareReg); 1532 bc1nez(target, kDoubleCompareReg);
1533 break; 1533 break;
1534 case ne: 1534 case ne:
1535 cmp(EQ, L, kDoubleCompareReg, cmp1, cmp2); 1535 cmp(EQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
1536 bc1eqz(target, kDoubleCompareReg); 1536 bc1eqz(target, kDoubleCompareReg);
1537 break; 1537 break;
1538 case nue: 1538 case nue:
1539 cmp(UEQ, L, kDoubleCompareReg, cmp1, cmp2); 1539 cmp(UEQ, sizeField, kDoubleCompareReg, cmp1, cmp2);
1540 bc1eqz(target, kDoubleCompareReg); 1540 bc1eqz(target, kDoubleCompareReg);
1541 break; 1541 break;
1542 default: 1542 default:
1543 CHECK(0); 1543 CHECK(0);
1544 } 1544 }
1545 } 1545 }
1546 } 1546 }
1547 1547
1548 if (bd == PROTECT) { 1548 if (bd == PROTECT) {
1549 nop(); 1549 nop();
1550 } 1550 }
1551 } 1551 }
1552 1552
1553 1553
1554 void MacroAssembler::BranchF(Label* target, Label* nan, Condition cc,
1555 FPURegister cmp1, FPURegister cmp2,
1556 BranchDelaySlot bd) {
1557 BranchFSize(D, target, nan, cc, cmp1, cmp2, bd);
1558 }
1559
1560
1561 void MacroAssembler::BranchFS(Label* target, Label* nan, Condition cc,
1562 FPURegister cmp1, FPURegister cmp2,
1563 BranchDelaySlot bd) {
1564 BranchFSize(S, target, nan, cc, cmp1, cmp2, bd);
1565 }
1566
1567
1554 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) { 1568 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) {
1555 if (IsFp64Mode()) { 1569 if (IsFp64Mode()) {
1556 DCHECK(!src_low.is(at)); 1570 DCHECK(!src_low.is(at));
1557 mfhc1(at, dst); 1571 mfhc1(at, dst);
1558 mtc1(src_low, dst); 1572 mtc1(src_low, dst);
1559 mthc1(at, dst); 1573 mthc1(at, dst);
1560 } else { 1574 } else {
1561 mtc1(src_low, dst); 1575 mtc1(src_low, dst);
1562 } 1576 }
1563 } 1577 }
(...skipping 4501 matching lines...) Expand 10 before | Expand all | Expand 10 after
6065 } 6079 }
6066 if (mag.shift > 0) sra(result, result, mag.shift); 6080 if (mag.shift > 0) sra(result, result, mag.shift);
6067 srl(at, dividend, 31); 6081 srl(at, dividend, 31);
6068 Addu(result, result, Operand(at)); 6082 Addu(result, result, Operand(at));
6069 } 6083 }
6070 6084
6071 6085
6072 } } // namespace v8::internal 6086 } } // namespace v8::internal
6073 6087
6074 #endif // V8_TARGET_ARCH_MIPS 6088 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698