| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by | 
| 6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be | 
| 7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. | 
| 8 // | 8 // | 
| 9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. | 
| 10 // | 10 // | 
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1172       } else { | 1172       } else { | 
| 1173         if ((instr->FunctionFieldRaw() == CLZ_R6) && (instr->FdValue() == 1)) { | 1173         if ((instr->FunctionFieldRaw() == CLZ_R6) && (instr->FdValue() == 1)) { | 
| 1174           Format(instr, "clz     'rd, 'rs"); | 1174           Format(instr, "clz     'rd, 'rs"); | 
| 1175         } else if ((instr->FunctionFieldRaw() == CLO_R6) && | 1175         } else if ((instr->FunctionFieldRaw() == CLO_R6) && | 
| 1176                    (instr->FdValue() == 1)) { | 1176                    (instr->FdValue() == 1)) { | 
| 1177           Format(instr, "clo     'rd, 'rs"); | 1177           Format(instr, "clo     'rd, 'rs"); | 
| 1178         } | 1178         } | 
| 1179       } | 1179       } | 
| 1180       break; | 1180       break; | 
| 1181     case MFLO: | 1181     case MFLO: | 
| 1182       Format(instr, "mflo    'rd"); | 1182       if (instr->Bits(25, 16) == 0) { | 
|  | 1183         Format(instr, "mflo    'rd"); | 
|  | 1184       } else { | 
|  | 1185         if ((instr->FunctionFieldRaw() == DCLZ_R6) && (instr->FdValue() == 1)) { | 
|  | 1186           Format(instr, "dclz    'rd, 'rs"); | 
|  | 1187         } else if ((instr->FunctionFieldRaw() == DCLO_R6) && | 
|  | 1188                    (instr->FdValue() == 1)) { | 
|  | 1189           Format(instr, "dclo     'rd, 'rs"); | 
|  | 1190         } | 
|  | 1191       } | 
| 1183       break; | 1192       break; | 
| 1184     case D_MUL_MUH_U:  // Equals to DMULTU. | 1193     case D_MUL_MUH_U:  // Equals to DMULTU. | 
| 1185       if (kArchVariant != kMips64r6) { | 1194       if (kArchVariant != kMips64r6) { | 
| 1186         Format(instr, "dmultu  'rs, 'rt"); | 1195         Format(instr, "dmultu  'rs, 'rt"); | 
| 1187       } else { | 1196       } else { | 
| 1188         if (instr->SaValue() == MUL_OP) { | 1197         if (instr->SaValue() == MUL_OP) { | 
| 1189           Format(instr, "dmulu  'rd, 'rs, 'rt"); | 1198           Format(instr, "dmulu  'rd, 'rs, 'rt"); | 
| 1190         } else { | 1199         } else { | 
| 1191           Format(instr, "dmuhu  'rd, 'rs, 'rt"); | 1200           Format(instr, "dmuhu  'rd, 'rs, 'rt"); | 
| 1192         } | 1201         } | 
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1353 void Decoder::DecodeTypeRegisterSPECIAL2(Instruction* instr) { | 1362 void Decoder::DecodeTypeRegisterSPECIAL2(Instruction* instr) { | 
| 1354   switch (instr->FunctionFieldRaw()) { | 1363   switch (instr->FunctionFieldRaw()) { | 
| 1355     case MUL: | 1364     case MUL: | 
| 1356       Format(instr, "mul     'rd, 'rs, 'rt"); | 1365       Format(instr, "mul     'rd, 'rs, 'rt"); | 
| 1357       break; | 1366       break; | 
| 1358     case CLZ: | 1367     case CLZ: | 
| 1359       if (kArchVariant != kMips64r6) { | 1368       if (kArchVariant != kMips64r6) { | 
| 1360         Format(instr, "clz     'rd, 'rs"); | 1369         Format(instr, "clz     'rd, 'rs"); | 
| 1361       } | 1370       } | 
| 1362       break; | 1371       break; | 
|  | 1372     case DCLZ: | 
|  | 1373       if (kArchVariant != kMips64r6) { | 
|  | 1374         Format(instr, "dclz    'rd, 'rs"); | 
|  | 1375       } | 
|  | 1376       break; | 
| 1363     default: | 1377     default: | 
| 1364       UNREACHABLE(); | 1378       UNREACHABLE(); | 
| 1365   } | 1379   } | 
| 1366 } | 1380 } | 
| 1367 | 1381 | 
| 1368 | 1382 | 
| 1369 void Decoder::DecodeTypeRegisterSPECIAL3(Instruction* instr) { | 1383 void Decoder::DecodeTypeRegisterSPECIAL3(Instruction* instr) { | 
| 1370   switch (instr->FunctionFieldRaw()) { | 1384   switch (instr->FunctionFieldRaw()) { | 
| 1371     case INS: { | 1385     case INS: { | 
| 1372       Format(instr, "ins     'rt, 'rs, 'sa, 'ss2"); | 1386       Format(instr, "ins     'rt, 'rs, 'sa, 'ss2"); | 
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1925         prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1939         prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 
| 1926   } | 1940   } | 
| 1927 } | 1941 } | 
| 1928 | 1942 | 
| 1929 | 1943 | 
| 1930 #undef UNSUPPORTED | 1944 #undef UNSUPPORTED | 
| 1931 | 1945 | 
| 1932 }  // namespace disasm | 1946 }  // namespace disasm | 
| 1933 | 1947 | 
| 1934 #endif  // V8_TARGET_ARCH_MIPS64 | 1948 #endif  // V8_TARGET_ARCH_MIPS64 | 
| OLD | NEW | 
|---|