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

Side by Side Diff: src/arm/disasm-arm.cc

Issue 682643002: Add vrint{a,n,p,m,z} instructions to arm assembler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 // A Disassembler object is used to disassemble a block of code instruction by 5 // A Disassembler object is used to disassemble a block of code instruction by
6 // instruction. The default implementation of the NameConverter object can be 6 // instruction. The default implementation of the NameConverter object can be
7 // overriden to modify register names or to do symbol lookup on addresses. 7 // overriden to modify register names or to do symbol lookup on addresses.
8 // 8 //
9 // The example below will disassemble a block of code and print it to stdout. 9 // The example below will disassemble a block of code and print it to stdout.
10 // 10 //
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 (instr->Opc3Value() & 0x1)) { 1270 (instr->Opc3Value() & 0x1)) {
1271 DecodeVCMP(instr); 1271 DecodeVCMP(instr);
1272 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { 1272 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) {
1273 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm"); 1273 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm");
1274 } else if (instr->Opc3Value() == 0x0) { 1274 } else if (instr->Opc3Value() == 0x0) {
1275 if (instr->SzValue() == 0x1) { 1275 if (instr->SzValue() == 0x1) {
1276 Format(instr, "vmov'cond.f64 'Dd, 'd"); 1276 Format(instr, "vmov'cond.f64 'Dd, 'd");
1277 } else { 1277 } else {
1278 Unknown(instr); // Not used by V8. 1278 Unknown(instr); // Not used by V8.
1279 } 1279 }
1280 } else if (((instr->Opc2Value() == 0x6)) && (instr->Opc3Value() & 0x1)) {
1281 bool dp_operation = (instr->SzValue() == 1);
1282 if (instr->Opc3Value() & 0x2) {
Rodolph Perfetta 2014/10/29 12:37:53 You could move this check in the if above to simpl
sigurds 2014/10/29 15:25:05 Done.
1283 // vrintz - round towards zero (truncate)
1284 if (dp_operation) {
1285 Format(instr, "vrintz'cond.f64.f64 'Dd, 'Dm");
1286 } else {
1287 Format(instr, "vrintz'cond.f32.f32 'Sd, 'Sm");
Rodolph Perfetta 2014/10/29 12:37:53 Not used by V8
sigurds 2014/10/29 15:25:05 Done.
1288 }
1289 } else {
1290 Unknown(instr); // Not used by V8.
1291 }
1280 } else { 1292 } else {
1281 Unknown(instr); // Not used by V8. 1293 Unknown(instr); // Not used by V8.
1282 } 1294 }
1283 } else if (instr->Opc1Value() == 0x3) { 1295 } else if (instr->Opc1Value() == 0x3) {
1284 if (instr->SzValue() == 0x1) { 1296 if (instr->SzValue() == 0x1) {
1285 if (instr->Opc3Value() & 0x1) { 1297 if (instr->Opc3Value() & 0x1) {
1286 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm"); 1298 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm");
1287 } else { 1299 } else {
1288 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm"); 1300 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm");
1289 } 1301 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1632 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1621 "pld [r%d, #-%d]", Rn, offset); 1633 "pld [r%d, #-%d]", Rn, offset);
1622 } else { 1634 } else {
1623 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 1635 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1624 "pld [r%d, #+%d]", Rn, offset); 1636 "pld [r%d, #+%d]", Rn, offset);
1625 } 1637 }
1626 } else { 1638 } else {
1627 Unknown(instr); 1639 Unknown(instr);
1628 } 1640 }
1629 break; 1641 break;
1642 case 0x1D:
1643 if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 &&
1644 instr->Bits(11, 9) == 0x5 && instr->Bits(7, 6) == 0x1 &&
1645 instr->Bit(4) == 0x0) {
1646 // VRINTA, VRINTN, VRINTP, VRINTM (floating-point)
1647 bool dp_operation = (instr->SzValue() == 1);
1648 int rounding_mode = instr->Bits(17, 16);
1649 switch (rounding_mode) {
1650 case 0x0:
1651 if (dp_operation) {
1652 Format(instr, "vrinta.f64.f64 'Dd, 'Dm");
1653 } else {
1654 Unknown(instr);
1655 }
1656 break;
1657 case 0x1:
1658 if (dp_operation) {
1659 Format(instr, "vrintn.f64.f64 'Dd, 'Dm");
1660 } else {
1661 Unknown(instr);
1662 }
1663 break;
1664 case 0x2:
1665 if (dp_operation) {
1666 Format(instr, "vrintp.f64.f64 'Dd, 'Dm");
1667 } else {
1668 Unknown(instr);
1669 }
1670 break;
1671 case 0x3:
1672 if (dp_operation) {
1673 Format(instr, "vrintm.f64.f64 'Dd, 'Dm");
1674 } else {
1675 Unknown(instr);
1676 }
1677 break;
1678 default:
1679 UNREACHABLE(); // Case analysis is exhaustive.
1680 break;
1681 }
1682 } else {
1683 Unknown(instr);
1684 }
1685 break;
1630 default: 1686 default:
1631 Unknown(instr); 1687 Unknown(instr);
1632 break; 1688 break;
1633 } 1689 }
1634 } 1690 }
1635 1691
1636 #undef VERIFIY 1692 #undef VERIFIY
1637 1693
1638 bool Decoder::IsConstantPoolAt(byte* instr_ptr) { 1694 bool Decoder::IsConstantPoolAt(byte* instr_ptr) {
1639 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); 1695 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 v8::internal::PrintF( 1848 v8::internal::PrintF(
1793 f, "%p %08x %s\n", 1849 f, "%p %08x %s\n",
1794 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 1850 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
1795 } 1851 }
1796 } 1852 }
1797 1853
1798 1854
1799 } // namespace disasm 1855 } // namespace disasm
1800 1856
1801 #endif // V8_TARGET_ARCH_ARM 1857 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698