| 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2253 fprintf(f, " "); | 2276 fprintf(f, " "); |
| 2254 } | 2277 } |
| 2255 fprintf(f, " %s\n", buffer.start()); | 2278 fprintf(f, " %s\n", buffer.start()); |
| 2256 } | 2279 } |
| 2257 } | 2280 } |
| 2258 | 2281 |
| 2259 | 2282 |
| 2260 } // namespace disasm | 2283 } // namespace disasm |
| 2261 | 2284 |
| 2262 #endif // V8_TARGET_ARCH_IA32 | 2285 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |