| OLD | NEW |
| 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 #include <assert.h> | 5 #include <assert.h> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
| 10 | 10 |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 data += 2; | 1477 data += 2; |
| 1478 AppendToBuffer("%s ", f0mnem); | 1478 AppendToBuffer("%s ", f0mnem); |
| 1479 int mod, regop, rm; | 1479 int mod, regop, rm; |
| 1480 get_modrm(*data, &mod, ®op, &rm); | 1480 get_modrm(*data, &mod, ®op, &rm); |
| 1481 data += PrintRightOperand(data); | 1481 data += PrintRightOperand(data); |
| 1482 if (f0byte == 0xAB) { | 1482 if (f0byte == 0xAB) { |
| 1483 AppendToBuffer(",%s", NameOfCPURegister(regop)); | 1483 AppendToBuffer(",%s", NameOfCPURegister(regop)); |
| 1484 } else { | 1484 } else { |
| 1485 AppendToBuffer(",%s,cl", NameOfCPURegister(regop)); | 1485 AppendToBuffer(",%s,cl", NameOfCPURegister(regop)); |
| 1486 } | 1486 } |
| 1487 } else if (f0byte == 0xAE) { |
| 1488 // ldmxcsr and stmxcsr |
| 1489 data += 2; |
| 1490 byte modrm = *data; |
| 1491 int mod, regop, rm; |
| 1492 get_modrm(modrm, &mod, ®op, &rm); |
| 1493 regop &= 0x7; // The REX.R bit does not affect the operation. |
| 1494 const char* mnem = NULL; |
| 1495 switch (regop) { |
| 1496 case 2: |
| 1497 mnem = "ldmxcsr"; |
| 1498 break; |
| 1499 case 3: |
| 1500 mnem = "stmxcsr"; |
| 1501 break; |
| 1502 default: |
| 1503 UnimplementedInstruction(); |
| 1504 return 2; |
| 1505 } |
| 1506 DCHECK_NOT_NULL(mnem); |
| 1507 AppendToBuffer("%s ", mnem); |
| 1508 data += PrintRightOperandHelper( |
| 1509 data, &DisassemblerIA32::NameOfCPURegister); |
| 1487 } else if (f0byte == 0xBC) { | 1510 } else if (f0byte == 0xBC) { |
| 1488 data += 2; | 1511 data += 2; |
| 1489 int mod, regop, rm; | 1512 int mod, regop, rm; |
| 1490 get_modrm(*data, &mod, ®op, &rm); | 1513 get_modrm(*data, &mod, ®op, &rm); |
| 1491 AppendToBuffer("%s %s,", f0mnem, NameOfCPURegister(regop)); | 1514 AppendToBuffer("%s %s,", f0mnem, NameOfCPURegister(regop)); |
| 1492 data += PrintRightOperand(data); | 1515 data += PrintRightOperand(data); |
| 1493 } else if (f0byte == 0xBD) { | 1516 } else if (f0byte == 0xBD) { |
| 1494 data += 2; | 1517 data += 2; |
| 1495 int mod, regop, rm; | 1518 int mod, regop, rm; |
| 1496 get_modrm(*data, &mod, ®op, &rm); | 1519 get_modrm(*data, &mod, ®op, &rm); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1623 NameOfXMMRegister(rm)); | 1646 NameOfXMMRegister(rm)); |
| 1624 data++; | 1647 data++; |
| 1625 } else if (*data == 0x2A) { | 1648 } else if (*data == 0x2A) { |
| 1626 // movntdqa | 1649 // movntdqa |
| 1627 UnimplementedInstruction(); | 1650 UnimplementedInstruction(); |
| 1628 } else { | 1651 } else { |
| 1629 UnimplementedInstruction(); | 1652 UnimplementedInstruction(); |
| 1630 } | 1653 } |
| 1631 } else if (*data == 0x3A) { | 1654 } else if (*data == 0x3A) { |
| 1632 data++; | 1655 data++; |
| 1633 if (*data == 0x0B) { | 1656 if (*data == 0x0A) { |
| 1634 data++; | 1657 data++; |
| 1635 int mod, regop, rm; | 1658 int mod, regop, rm; |
| 1636 get_modrm(*data, &mod, ®op, &rm); | 1659 get_modrm(*data, &mod, ®op, &rm); |
| 1660 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1661 AppendToBuffer("roundss %s,%s,%d", NameOfXMMRegister(regop), |
| 1662 NameOfXMMRegister(rm), static_cast<int>(imm8)); |
| 1663 data += 2; |
| 1664 } else if (*data == 0x0B) { |
| 1665 data++; |
| 1666 int mod, regop, rm; |
| 1667 get_modrm(*data, &mod, ®op, &rm); |
| 1637 int8_t imm8 = static_cast<int8_t>(data[1]); | 1668 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1638 AppendToBuffer("roundsd %s,%s,%d", | 1669 AppendToBuffer("roundsd %s,%s,%d", |
| 1639 NameOfXMMRegister(regop), | 1670 NameOfXMMRegister(regop), |
| 1640 NameOfXMMRegister(rm), | 1671 NameOfXMMRegister(rm), |
| 1641 static_cast<int>(imm8)); | 1672 static_cast<int>(imm8)); |
| 1642 data += 2; | 1673 data += 2; |
| 1643 } else if (*data == 0x16) { | 1674 } else if (*data == 0x16) { |
| 1644 data++; | 1675 data++; |
| 1645 int mod, regop, rm; | 1676 int mod, regop, rm; |
| 1646 get_modrm(*data, &mod, &rm, ®op); | 1677 get_modrm(*data, &mod, &rm, ®op); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2253 fprintf(f, " "); | 2284 fprintf(f, " "); |
| 2254 } | 2285 } |
| 2255 fprintf(f, " %s\n", buffer.start()); | 2286 fprintf(f, " %s\n", buffer.start()); |
| 2256 } | 2287 } |
| 2257 } | 2288 } |
| 2258 | 2289 |
| 2259 | 2290 |
| 2260 } // namespace disasm | 2291 } // namespace disasm |
| 2261 | 2292 |
| 2262 #endif // V8_TARGET_ARCH_IA32 | 2293 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |