| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // For VFP support. | 131 // For VFP support. |
| 132 void DecodeTypeVFP(Instruction* instr); | 132 void DecodeTypeVFP(Instruction* instr); |
| 133 void DecodeType6CoprocessorIns(Instruction* instr); | 133 void DecodeType6CoprocessorIns(Instruction* instr); |
| 134 | 134 |
| 135 void DecodeSpecialCondition(Instruction* instr); | 135 void DecodeSpecialCondition(Instruction* instr); |
| 136 | 136 |
| 137 void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr); | 137 void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr); |
| 138 void DecodeVCMP(Instruction* instr); | 138 void DecodeVCMP(Instruction* instr); |
| 139 void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr); | 139 void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr); |
| 140 void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr); | 140 void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr); |
| 141 void DecodeVCVTBetweenFloatingPointAndFixedPoint(Instruction* instr); |
| 141 | 142 |
| 142 const disasm::NameConverter& converter_; | 143 const disasm::NameConverter& converter_; |
| 143 Vector<char> out_buffer_; | 144 Vector<char> out_buffer_; |
| 144 int out_buffer_pos_; | 145 int out_buffer_pos_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(Decoder); | 147 DISALLOW_COPY_AND_ASSIGN(Decoder); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 | 150 |
| 150 // Support for assertions in the Decoder formatting functions. | 151 // Support for assertions in the Decoder formatting functions. |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 return Instruction::kInstrSize; | 1227 return Instruction::kInstrSize; |
| 1227 } | 1228 } |
| 1228 | 1229 |
| 1229 | 1230 |
| 1230 // void Decoder::DecodeTypeVFP(Instruction* instr) | 1231 // void Decoder::DecodeTypeVFP(Instruction* instr) |
| 1231 // vmov: Sn = Rt | 1232 // vmov: Sn = Rt |
| 1232 // vmov: Rt = Sn | 1233 // vmov: Rt = Sn |
| 1233 // vcvt: Dd = Sm | 1234 // vcvt: Dd = Sm |
| 1234 // vcvt: Sd = Dm | 1235 // vcvt: Sd = Dm |
| 1235 // vcvt.f64.s32 Dd, Dd, #<fbits> | 1236 // vcvt.f64.s32 Dd, Dd, #<fbits> |
| 1237 // vcvt.u32.f64 Dd, Dd, #<fbits> |
| 1236 // Dd = vabs(Dm) | 1238 // Dd = vabs(Dm) |
| 1237 // Dd = vneg(Dm) | 1239 // Dd = vneg(Dm) |
| 1238 // Dd = vadd(Dn, Dm) | 1240 // Dd = vadd(Dn, Dm) |
| 1239 // Dd = vsub(Dn, Dm) | 1241 // Dd = vsub(Dn, Dm) |
| 1240 // Dd = vmul(Dn, Dm) | 1242 // Dd = vmul(Dn, Dm) |
| 1241 // Dd = vmla(Dn, Dm) | 1243 // Dd = vmla(Dn, Dm) |
| 1242 // Dd = vmls(Dn, Dm) | 1244 // Dd = vmls(Dn, Dm) |
| 1243 // Dd = vdiv(Dn, Dm) | 1245 // Dd = vdiv(Dn, Dm) |
| 1244 // vcmp(Dd, Dm) | 1246 // vcmp(Dd, Dm) |
| 1245 // vmrs | 1247 // vmrs |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1262 } else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) { | 1264 } else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) { |
| 1263 // vabs | 1265 // vabs |
| 1264 Format(instr, "vabs'cond.f64 'Dd, 'Dm"); | 1266 Format(instr, "vabs'cond.f64 'Dd, 'Dm"); |
| 1265 } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) { | 1267 } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) { |
| 1266 // vneg | 1268 // vneg |
| 1267 Format(instr, "vneg'cond.f64 'Dd, 'Dm"); | 1269 Format(instr, "vneg'cond.f64 'Dd, 'Dm"); |
| 1268 } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) { | 1270 } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) { |
| 1269 DecodeVCVTBetweenDoubleAndSingle(instr); | 1271 DecodeVCVTBetweenDoubleAndSingle(instr); |
| 1270 } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) { | 1272 } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) { |
| 1271 DecodeVCVTBetweenFloatingPointAndInteger(instr); | 1273 DecodeVCVTBetweenFloatingPointAndInteger(instr); |
| 1272 } else if ((instr->Opc2Value() == 0xA) && (instr->Opc3Value() == 0x3) && | 1274 } else if ((instr->Opc2Value() & 0x2) && (instr->Opc2Value() & 0x8) && |
| 1273 (instr->Bit(8) == 1)) { | 1275 (instr->Opc3Value() == 0x3) && |
| 1274 // vcvt.f64.s32 Dd, Dd, #<fbits> | 1276 (instr->Bit(5) || instr->Bits(3, 0))) { |
| 1275 int fraction_bits = 32 - ((instr->Bit(5) << 4) | instr->Bits(3, 0)); | 1277 DecodeVCVTBetweenFloatingPointAndFixedPoint(instr); |
| 1276 Format(instr, "vcvt'cond.f64.s32 'Dd, 'Dd"); | |
| 1277 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, | |
| 1278 ", #%d", fraction_bits); | |
| 1279 } else if (((instr->Opc2Value() >> 1) == 0x6) && | 1278 } else if (((instr->Opc2Value() >> 1) == 0x6) && |
| 1280 (instr->Opc3Value() & 0x1)) { | 1279 (instr->Opc3Value() & 0x1)) { |
| 1281 DecodeVCVTBetweenFloatingPointAndInteger(instr); | 1280 DecodeVCVTBetweenFloatingPointAndInteger(instr); |
| 1282 } else if (((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) && | 1281 } else if (((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) && |
| 1283 (instr->Opc3Value() & 0x1)) { | 1282 (instr->Opc3Value() & 0x1)) { |
| 1284 DecodeVCMP(instr); | 1283 DecodeVCMP(instr); |
| 1285 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { | 1284 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { |
| 1286 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm"); | 1285 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm"); |
| 1287 } else if (instr->Opc3Value() == 0x0) { | 1286 } else if (instr->Opc3Value() == 0x0) { |
| 1288 if (instr->SzValue() == 0x1) { | 1287 if (instr->SzValue() == 0x1) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 if (unsigned_integer) { | 1458 if (unsigned_integer) { |
| 1460 Format(instr, "vcvt'cond.f32.u32 'Sd, 'Sm"); | 1459 Format(instr, "vcvt'cond.f32.u32 'Sd, 'Sm"); |
| 1461 } else { | 1460 } else { |
| 1462 Format(instr, "vcvt'cond.f32.s32 'Sd, 'Sm"); | 1461 Format(instr, "vcvt'cond.f32.s32 'Sd, 'Sm"); |
| 1463 } | 1462 } |
| 1464 } | 1463 } |
| 1465 } | 1464 } |
| 1466 } | 1465 } |
| 1467 | 1466 |
| 1468 | 1467 |
| 1468 void Decoder::DecodeVCVTBetweenFloatingPointAndFixedPoint(Instruction* instr) { |
| 1469 VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7)); |
| 1470 VERIFY((instr->Opc2Value() & 0x2) && (instr->Opc2Value() & 0x8)); |
| 1471 VERIFY(instr->Opc3Value() == 0x3); |
| 1472 VERIFY(instr->Bit(5) || instr->Bits(3, 0)); |
| 1473 |
| 1474 bool to_integer = (instr->Bit(18) == 1); |
| 1475 bool dp_operation = (instr->SzValue() == 1); |
| 1476 bool unsigned_integer = (instr->Bit(16) == 1); |
| 1477 |
| 1478 int sx = instr->Bit(7); |
| 1479 |
| 1480 int fraction_bits = (sx ? 32 : 16) - |
| 1481 ((instr->Bits(3, 0) << 1) | instr->Bit(5)); |
| 1482 |
| 1483 if (to_integer) { |
| 1484 if (dp_operation) { |
| 1485 if (unsigned_integer) { |
| 1486 Format(instr, "vcvt'cond.u32.f64 'Dd, 'Dd"); |
| 1487 } else { |
| 1488 Format(instr, "vcvt'cond.s32.f64 'Dd, 'Dd"); |
| 1489 } |
| 1490 } else { |
| 1491 if (unsigned_integer) { |
| 1492 Format(instr, "vcvt'cond.u32.f32 'Sd, 'Sd"); |
| 1493 } else { |
| 1494 Format(instr, "vcvt'cond.s32.f32 'Sd, 'Sd"); |
| 1495 } |
| 1496 } |
| 1497 } else { |
| 1498 if (dp_operation) { |
| 1499 if (unsigned_integer) { |
| 1500 Format(instr, "vcvt'cond.f64.u32 'Dd, 'Dd"); |
| 1501 } else { |
| 1502 Format(instr, "vcvt'cond.f64.s32 'Dd, 'Dd"); |
| 1503 } |
| 1504 } else { |
| 1505 if (unsigned_integer) { |
| 1506 Format(instr, "vcvt'cond.f32.u32 'Sd, 'Sd"); |
| 1507 } else { |
| 1508 Format(instr, "vcvt'cond.f32.s32 'Sd, 'Sd"); |
| 1509 } |
| 1510 } |
| 1511 } |
| 1512 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1513 ", #%d", fraction_bits); |
| 1514 } |
| 1515 |
| 1516 |
| 1469 // Decode Type 6 coprocessor instructions. | 1517 // Decode Type 6 coprocessor instructions. |
| 1470 // Dm = vmov(Rt, Rt2) | 1518 // Dm = vmov(Rt, Rt2) |
| 1471 // <Rt, Rt2> = vmov(Dm) | 1519 // <Rt, Rt2> = vmov(Dm) |
| 1472 // Ddst = MEM(Rbase + 4*offset). | 1520 // Ddst = MEM(Rbase + 4*offset). |
| 1473 // MEM(Rbase + 4*offset) = Dsrc. | 1521 // MEM(Rbase + 4*offset) = Dsrc. |
| 1474 void Decoder::DecodeType6CoprocessorIns(Instruction* instr) { | 1522 void Decoder::DecodeType6CoprocessorIns(Instruction* instr) { |
| 1475 VERIFY(instr->TypeValue() == 6); | 1523 VERIFY(instr->TypeValue() == 6); |
| 1476 | 1524 |
| 1477 if (instr->CoprocessorValue() == 0xA) { | 1525 if (instr->CoprocessorValue() == 0xA) { |
| 1478 switch (instr->OpcodeValue()) { | 1526 switch (instr->OpcodeValue()) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 v8::internal::PrintF( | 1853 v8::internal::PrintF( |
| 1806 f, "%p %08x %s\n", | 1854 f, "%p %08x %s\n", |
| 1807 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1855 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
| 1808 } | 1856 } |
| 1809 } | 1857 } |
| 1810 | 1858 |
| 1811 | 1859 |
| 1812 } // namespace disasm | 1860 } // namespace disasm |
| 1813 | 1861 |
| 1814 #endif // V8_TARGET_ARCH_ARM | 1862 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |