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

Issue 6893094: Fix broken cases in x64 disassembler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 if (regop == 4) { // SIB byte present. 1179 if (regop == 4) { // SIB byte present.
1180 current++; 1180 current++;
1181 } 1181 }
1182 if (mod == 1) { // Byte displacement. 1182 if (mod == 1) { // Byte displacement.
1183 current += 1; 1183 current += 1;
1184 } else if (mod == 2) { // 32-bit displacement. 1184 } else if (mod == 2) { // 32-bit displacement.
1185 current += 4; 1185 current += 4;
1186 } // else no immediate displacement. 1186 } // else no immediate displacement.
1187 AppendToBuffer("nop"); 1187 AppendToBuffer("nop");
1188 1188
1189 } else if (opcode == 28) { 1189 } else if (opcode == 0x28) {
1190 // movaps xmm, xmm/m128 1190 // movaps xmm, xmm/m128
1191 int mod, regop, rm; 1191 int mod, regop, rm;
1192 get_modrm(*current, &mod, &regop, &rm); 1192 get_modrm(*current, &mod, &regop, &rm);
1193 AppendToBuffer("movaps %s, ", NameOfXMMRegister(regop)); 1193 AppendToBuffer("movaps %s, ", NameOfXMMRegister(regop));
1194 current += PrintRightXMMOperand(current); 1194 current += PrintRightXMMOperand(current);
1195 1195
1196 } else if (opcode == 29) { 1196 } else if (opcode == 0x29) {
1197 // movaps xmm/m128, xmm 1197 // movaps xmm/m128, xmm
1198 int mod, regop, rm; 1198 int mod, regop, rm;
1199 get_modrm(*current, &mod, &regop, &rm); 1199 get_modrm(*current, &mod, &regop, &rm);
1200 AppendToBuffer("movaps"); 1200 AppendToBuffer("movaps ");
1201 current += PrintRightXMMOperand(current); 1201 current += PrintRightXMMOperand(current);
1202 AppendToBuffer(", %s", NameOfXMMRegister(regop)); 1202 AppendToBuffer(", %s", NameOfXMMRegister(regop));
1203 1203
1204 } else if (opcode == 0xA2 || opcode == 0x31) { 1204 } else if (opcode == 0xA2 || opcode == 0x31) {
1205 // RDTSC or CPUID 1205 // RDTSC or CPUID
1206 AppendToBuffer("%s", mnemonic); 1206 AppendToBuffer("%s", mnemonic);
1207 1207
1208 } else if ((opcode & 0xF0) == 0x40) { 1208 } else if ((opcode & 0xF0) == 0x40) {
1209 // CMOVcc: conditional move. 1209 // CMOVcc: conditional move.
1210 int condition = opcode & 0x0F; 1210 int condition = opcode & 0x0F;
1211 const InstructionDesc& idesc = cmov_instructions[condition]; 1211 const InstructionDesc& idesc = cmov_instructions[condition];
1212 byte_size_operand_ = idesc.byte_size_operation; 1212 byte_size_operand_ = idesc.byte_size_operation;
1213 current += PrintOperands(idesc.mnem, idesc.op_order_, current); 1213 current += PrintOperands(idesc.mnem, idesc.op_order_, current);
1214 1214
1215 } else if (opcode == 57) { 1215 } else if (opcode == 0x57) {
1216 // xoprps xmm, xmm/m128 1216 // xorps xmm, xmm/m128
1217 int mod, regop, rm; 1217 int mod, regop, rm;
1218 get_modrm(*current, &mod, &regop, &rm); 1218 get_modrm(*current, &mod, &regop, &rm);
1219 AppendToBuffer("xorps %s, ", NameOfXMMRegister(regop)); 1219 AppendToBuffer("xorps %s, ", NameOfXMMRegister(regop));
1220 current += PrintRightXMMOperand(current); 1220 current += PrintRightXMMOperand(current);
1221 1221
1222 } else if ((opcode & 0xF0) == 0x80) { 1222 } else if ((opcode & 0xF0) == 0x80) {
1223 // Jcc: Conditional jump (branch). 1223 // Jcc: Conditional jump (branch).
1224 current = data + JumpConditional(data); 1224 current = data + JumpConditional(data);
1225 1225
1226 } else if (opcode == 0xBE || opcode == 0xBF || opcode == 0xB6 || 1226 } else if (opcode == 0xBE || opcode == 0xBF || opcode == 0xB6 ||
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { 1823 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) {
1824 fprintf(f, " "); 1824 fprintf(f, " ");
1825 } 1825 }
1826 fprintf(f, " %s\n", buffer.start()); 1826 fprintf(f, " %s\n", buffer.start());
1827 } 1827 }
1828 } 1828 }
1829 1829
1830 } // namespace disasm 1830 } // namespace disasm
1831 1831
1832 #endif // V8_TARGET_ARCH_X64 1832 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698