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/ia32/disasm-ia32.cc

Issue 2103713003: [ia32] Fixes a bug in cmpw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Save and restore ebx. Created 4 years, 5 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/ia32/assembler-ia32.cc ('k') | test/cctest/test-assembler-ia32.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 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 data += PrintRightOperand(data); 1615 data += PrintRightOperand(data);
1616 AppendToBuffer(",%s", NameOfCPURegister(regop)); 1616 AppendToBuffer(",%s", NameOfCPURegister(regop));
1617 } 1617 }
1618 } 1618 }
1619 break; 1619 break;
1620 1620
1621 case 0x66: // prefix 1621 case 0x66: // prefix
1622 while (*data == 0x66) data++; 1622 while (*data == 0x66) data++;
1623 if (*data == 0xf && data[1] == 0x1f) { 1623 if (*data == 0xf && data[1] == 0x1f) {
1624 AppendToBuffer("nop"); // 0x66 prefix 1624 AppendToBuffer("nop"); // 0x66 prefix
1625 } else if (*data == 0x90) { 1625 } else if (*data == 0x39) {
1626 AppendToBuffer("nop"); // 0x66 prefix
1627 } else if (*data == 0x8B) {
1628 data++; 1626 data++;
1629 data += PrintOperands("mov_w", REG_OPER_OP_ORDER, data); 1627 data += PrintOperands("cmpw", OPER_REG_OP_ORDER, data);
1628 } else if (*data == 0x3B) {
1629 data++;
1630 data += PrintOperands("cmpw", REG_OPER_OP_ORDER, data);
1631 } else if (*data == 0x81) {
1632 data++;
1633 AppendToBuffer("cmpw ");
1634 data += PrintRightOperand(data);
1635 int imm = *reinterpret_cast<int16_t*>(data);
1636 AppendToBuffer(",0x%x", imm);
1637 data += 2;
1630 } else if (*data == 0x87) { 1638 } else if (*data == 0x87) {
1631 data++; 1639 data++;
1632 int mod, regop, rm; 1640 int mod, regop, rm;
1633 get_modrm(*data, &mod, &regop, &rm); 1641 get_modrm(*data, &mod, &regop, &rm);
1634 AppendToBuffer("xchg_w %s,", NameOfCPURegister(regop)); 1642 AppendToBuffer("xchg_w %s,", NameOfCPURegister(regop));
1635 data += PrintRightOperand(data); 1643 data += PrintRightOperand(data);
1636 } else if (*data == 0x89) { 1644 } else if (*data == 0x89) {
1637 data++; 1645 data++;
1638 int mod, regop, rm; 1646 int mod, regop, rm;
1639 get_modrm(*data, &mod, &regop, &rm); 1647 get_modrm(*data, &mod, &regop, &rm);
1640 AppendToBuffer("mov_w "); 1648 AppendToBuffer("mov_w ");
1641 data += PrintRightOperand(data); 1649 data += PrintRightOperand(data);
1642 AppendToBuffer(",%s", NameOfCPURegister(regop)); 1650 AppendToBuffer(",%s", NameOfCPURegister(regop));
1651 } else if (*data == 0x8B) {
1652 data++;
1653 data += PrintOperands("mov_w", REG_OPER_OP_ORDER, data);
1654 } else if (*data == 0x90) {
1655 AppendToBuffer("nop"); // 0x66 prefix
1643 } else if (*data == 0xC7) { 1656 } else if (*data == 0xC7) {
1644 data++; 1657 data++;
1645 AppendToBuffer("%s ", "mov_w"); 1658 AppendToBuffer("%s ", "mov_w");
1646 data += PrintRightOperand(data); 1659 data += PrintRightOperand(data);
1647 int imm = *reinterpret_cast<int16_t*>(data); 1660 int imm = *reinterpret_cast<int16_t*>(data);
1648 AppendToBuffer(",0x%x", imm); 1661 AppendToBuffer(",0x%x", imm);
1649 data += 2; 1662 data += 2;
1650 } else if (*data == 0xF7) { 1663 } else if (*data == 0xF7) {
1651 data++; 1664 data++;
1652 AppendToBuffer("%s ", "test_w"); 1665 AppendToBuffer("%s ", "test_w");
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 fprintf(f, " "); 2321 fprintf(f, " ");
2309 } 2322 }
2310 fprintf(f, " %s\n", buffer.start()); 2323 fprintf(f, " %s\n", buffer.start());
2311 } 2324 }
2312 } 2325 }
2313 2326
2314 2327
2315 } // namespace disasm 2328 } // namespace disasm
2316 2329
2317 #endif // V8_TARGET_ARCH_IA32 2330 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | test/cctest/test-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698