Lines Matching +full:- +full:- +full:prefix
8 * http://www.apache.org/licenses/LICENSE-2.0
24 #include "android-base/logging.h"
25 #include "android-base/stringprintf.h"
73 // 64-bit opcode REX modifier.
173 uint8_t* prefix, bool load, RegFile src_reg_file, in DumpAddress() argument
181 } else { // 64-bit RIP relative addressing. in DumpAddress()
221 // 64-bit low 32-bit absolute address, redundant absolute address encoding on 32-bit. in DumpAddress()
239 prefix[2], load ? src_reg_file : dst_reg_file); in DumpAddress()
291 uint8_t prefix[4] = {0, 0, 0, 0}; in DumpInstruction() local
294 // Group 1 - lock and repeat prefixes: in DumpInstruction()
298 prefix[0] = *instr; in DumpInstruction()
300 // Group 2 - segment override prefixes: in DumpInstruction()
307 prefix[1] = *instr; in DumpInstruction()
309 // Group 3 - operand size override: in DumpInstruction()
311 prefix[2] = *instr; in DumpInstruction()
313 // Group 4 - address size override: in DumpInstruction()
315 prefix[3] = *instr; in DumpInstruction()
337 const char* opcode0 = ""; // Prefix part. in DumpInstruction()
339 const char* opcode2 = ""; // Sub-opcode. E.g., jump type. in DumpInstruction()
340 const char* opcode3 = ""; // Mod-rm part. in DumpInstruction()
351 bool reg_in_opcode = false; // low 3-bits of opcode encode register parameter in DumpInstruction()
420 // In 32-bit mode (!supports_rex_) this is ARPL, with no REX prefix the functionality is the in DumpInstruction()
456 if (prefix[0] == 0xF2) { in DumpInstruction()
458 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
459 } else if (prefix[0] == 0xF3) { in DumpInstruction()
461 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
462 } else if (prefix[2] == 0x66) { in DumpInstruction()
464 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
474 if (prefix[2] == 0x66) { in DumpInstruction()
476 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
477 } else if (prefix[0] == 0) { in DumpInstruction()
486 if (prefix[2] == 0x66) { in DumpInstruction()
488 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
489 } else if (prefix[0] == 0) { in DumpInstruction()
498 if (prefix[2] == 0x66) { in DumpInstruction()
500 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
501 } else if (prefix[0] == 0) { in DumpInstruction()
510 if (prefix[2] == 0x66) { in DumpInstruction()
512 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
513 } else if (prefix[0] == 0xF2) { in DumpInstruction()
515 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
516 } else if (prefix[0] == 0xF3) { in DumpInstruction()
518 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
527 if (prefix[2] == 0x66) { in DumpInstruction()
529 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
530 } else if (prefix[0] == 0xF2) { in DumpInstruction()
532 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
533 } else if (prefix[0] == 0xF3) { in DumpInstruction()
535 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
544 if (prefix[2] == 0x66) { in DumpInstruction()
546 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
547 } else if (prefix[0] == 0xF2) { in DumpInstruction()
549 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
550 } else if (prefix[0] == 0xF3) { in DumpInstruction()
552 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
564 if (prefix[2] == 0x66) { in DumpInstruction()
566 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
576 if (prefix[2] == 0x66) { in DumpInstruction()
580 prefix[2] = 0; in DumpInstruction()
587 prefix[2] = 0; in DumpInstruction()
594 prefix[2] = 0; in DumpInstruction()
601 prefix[2] = 0; in DumpInstruction()
608 prefix[2] = 0; in DumpInstruction()
615 prefix[2] = 0; in DumpInstruction()
622 prefix[2] = 0; in DumpInstruction()
629 prefix[2] = 0; in DumpInstruction()
636 prefix[2] = 0; in DumpInstruction()
643 prefix[2] = 0; in DumpInstruction()
650 prefix[2] = 0; in DumpInstruction()
657 prefix[2] = 0; in DumpInstruction()
664 prefix[2] = 0; in DumpInstruction()
680 if (prefix[2] == 0x66) { in DumpInstruction()
684 prefix[2] = 0; in DumpInstruction()
693 prefix[2] = 0; in DumpInstruction()
702 prefix[2] = 0; in DumpInstruction()
710 prefix[2] = 0; in DumpInstruction()
718 prefix[2] = 0; in DumpInstruction()
759 if (prefix[2] == 0x66) { in DumpInstruction()
761 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
762 } else if (prefix[0] == 0xF2) { in DumpInstruction()
764 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
765 } else if (prefix[0] == 0xF3) { in DumpInstruction()
767 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
777 if (prefix[2] == 0x66) { in DumpInstruction()
779 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
780 } else if (prefix[0] == 0xF2) { in DumpInstruction()
782 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
783 } else if (prefix[0] == 0xF3) { in DumpInstruction()
785 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
794 if (prefix[2] == 0x66) { in DumpInstruction()
796 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
797 } else if (prefix[0] == 0xF2) { in DumpInstruction()
799 } else if (prefix[0] == 0xF3) { in DumpInstruction()
801 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
811 if (prefix[2] == 0x66) { in DumpInstruction()
813 prefix[2] = 0; // Clear prefix now. It has served its purpose as part of the opcode. in DumpInstruction()
833 if (prefix[2] == 0x66) { in DumpInstruction()
835 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
844 prefix[2] = 0; in DumpInstruction()
849 if (prefix[2] == 0x66) { in DumpInstruction()
851 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
860 if (prefix[2] == 0x66) { in DumpInstruction()
863 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
864 } else if (prefix[0] == 0xF3) { in DumpInstruction()
867 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
876 if (prefix[2] == 0x66) { in DumpInstruction()
878 prefix[2] = 0; in DumpInstruction()
883 } else if (prefix[0] == 0xF2) { in DumpInstruction()
885 prefix[0] = 0; in DumpInstruction()
896 if (prefix[2] == 0x66) { in DumpInstruction()
898 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
903 "unknown-71", "unknown-71", "psrlw", "unknown-71", in DumpInstruction()
904 "psraw", "unknown-71", "psllw", "unknown-71"}; in DumpInstruction()
912 if (prefix[2] == 0x66) { in DumpInstruction()
914 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
919 "unknown-72", "unknown-72", "psrld", "unknown-72", in DumpInstruction()
920 "psrad", "unknown-72", "pslld", "unknown-72"}; in DumpInstruction()
928 if (prefix[2] == 0x66) { in DumpInstruction()
930 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
935 "unknown-73", "unknown-73", "psrlq", "psrldq", in DumpInstruction()
936 "unknown-73", "unknown-73", "psllq", "unknown-73"}; in DumpInstruction()
946 if (prefix[2] == 0x66) { in DumpInstruction()
948 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
957 prefix[2] = 0; in DumpInstruction()
962 if (prefix[0] == 0xF2) { in DumpInstruction()
964 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
965 } else if (prefix[2] == 0x66) { in DumpInstruction()
967 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
978 if (prefix[2] == 0x66) { in DumpInstruction()
980 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
989 if (prefix[2] == 0x66) { in DumpInstruction()
992 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
993 } else if (prefix[0] == 0xF3) { in DumpInstruction()
996 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1044 if (prefix[0] == 0xF3) { in DumpInstruction()
1045 prefix[0] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1048 "unknown-AE", "unknown-AE", "unknown-AE", "unknown-AE"}; in DumpInstruction()
1055 prefix[1] = kFs; in DumpInstruction()
1059 prefix[1] = kGs; in DumpInstruction()
1063 prefix[1] = kFs; in DumpInstruction()
1067 prefix[1] = kGs; in DumpInstruction()
1076 "unknown-AE", "unknown-AE", "unknown-AE", "unknown-AE", in DumpInstruction()
1077 "unknown-AE", "lfence", "mfence", "sfence"}; in DumpInstruction()
1139 if (prefix[2] == 0x66) { in DumpInstruction()
1141 prefix[2] = 0; in DumpInstruction()
1152 if (prefix[2] == 0x66) { in DumpInstruction()
1154 prefix[2] = 0; in DumpInstruction()
1165 "unknown-0f-c7", "cmpxchg8b", "unknown-0f-c7", "unknown-0f-c7", in DumpInstruction()
1166 "unknown-0f-c7", "unknown-0f-c7", "unknown-0f-c7", "unknown-0f-c7"}; in DumpInstruction()
1177 if (prefix[2] == 0x66) { in DumpInstruction()
1179 prefix[2] = 0; in DumpInstruction()
1184 prefix[2] = 0; in DumpInstruction()
1189 if (prefix[2] == 0x66) { in DumpInstruction()
1191 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1196 prefix[2] = 0; in DumpInstruction()
1201 if (prefix[2] == 0x66) { in DumpInstruction()
1203 prefix[2] = 0; in DumpInstruction()
1226 if (prefix[2] == 0x66) { in DumpInstruction()
1228 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1248 prefix[2] = 0; in DumpInstruction()
1253 if (prefix[2] == 0x66) { in DumpInstruction()
1255 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1260 prefix[2] = 0; in DumpInstruction()
1265 if (prefix[2] == 0x66) { in DumpInstruction()
1267 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1272 prefix[2] = 0; in DumpInstruction()
1285 if (prefix[2] == 0x66) { in DumpInstruction()
1287 prefix[2] = 0; // clear prefix now it's served its purpose as part of the opcode in DumpInstruction()
1302 prefix[2] = 0; in DumpInstruction()
1351 opcode1 = (prefix[2] == 0x66 ? "movsw" : "movsl"); in DumpInstruction()
1354 opcode1 = (prefix[2] == 0x66 ? "cmpsw" : "cmpsl"); in DumpInstruction()
1357 opcode1 = (prefix[2] == 0x66 ? "scasw" : "scasl"); in DumpInstruction()
1380 {"rol", "ror", "rcl", "rcr", "shl", "shr", "unknown-shift", "sar"}; in DumpInstruction()
1392 static const char* c6_opcodes[] = {"mov", "unknown-c6", "unknown-c6", in DumpInstruction()
1393 "unknown-c6", "unknown-c6", "unknown-c6", in DumpInstruction()
1394 "unknown-c6", "unknown-c6"}; in DumpInstruction()
1403 static const char* c7_opcodes[] = {"mov", "unknown-c7", "unknown-c7", in DumpInstruction()
1404 "unknown-c7", "unknown-c7", "unknown-c7", in DumpInstruction()
1405 "unknown-c7", "unknown-c7"}; in DumpInstruction()
1418 static const char* d9_opcodes[] = {"flds", "unknown-d9", "fsts", "fstps", "fldenv", "fldcw", in DumpInstruction()
1436 static const char* db_opcodes[] = {"fildl", "unknown-db", "unknown-db", in DumpInstruction()
1437 "unknown-db", "unknown-db", "unknown-db", in DumpInstruction()
1438 "unknown-db", "unknown-db"}; in DumpInstruction()
1446 "fstpl", "frstor", "unknown-dd", in DumpInstruction()
1454 static const char* df_opcodes[] = {"fild", "unknown-df", "unknown-df", in DumpInstruction()
1455 "unknown-df", "unknown-df", "fildll", in DumpInstruction()
1456 "unknown-df", "unknown-df"}; in DumpInstruction()
1469 "test", "unknown-f7", "not", "neg", "mul edx:eax, eax *", in DumpInstruction()
1482 "jmp", "jmp", "push", "unknown-ff"}; in DumpInstruction()
1500 // We force the REX prefix to be available for 64-bit target in DumpInstruction()
1503 // REX.W should be forced for 64-target and target-specific instructions (i.e., push or pop). in DumpInstruction()
1507 DumpOpcodeReg(args, rex_w, *instr & 0x7, byte_operand, prefix[2]); in DumpInstruction()
1518 byte_second_operand, prefix, load, src_reg_file, dst_reg_file, in DumpInstruction()
1530 } else if (prefix[2] == 0x66) { in DumpInstruction()
1536 DumpReg(args, rex, reg_or_opcode, byte_operand, prefix[2], dst_reg_file); in DumpInstruction()
1539 DumpSegmentOverride(args, prefix[1]); in DumpInstruction()
1544 DumpSegmentOverride(args, prefix[1]); in DumpInstruction()
1548 DumpReg(args, rex, reg_or_opcode, byte_operand, prefix[2], src_reg_file); in DumpInstruction()
1554 DumpReg(args, rex, 0 /* EAX */, byte_operand, prefix[2], GPR); in DumpInstruction()
1558 DumpReg(args, rex, 1 /* ECX */, true, prefix[2], GPR); in DumpInstruction()
1568 if (prefix[2] == 0x66) { // Operand size override from 32-bit to 16-bit. in DumpInstruction()
1595 if (prefix[1] == kFs && !supports_rex_) { in DumpInstruction()
1597 GetDisassemblerOptions()->thread_offset_name_function_(args, address_bits); in DumpInstruction()
1599 if (prefix[1] == kGs && supports_rex_) { in DumpInstruction()
1601 GetDisassemblerOptions()->thread_offset_name_function_(args, address_bits); in DumpInstruction()
1604 switch (prefix[0]) { in DumpInstruction()
1612 << StringPrintf(": %22s \t%-7s%s%s%s%s%s ", DumpCodeHex(begin_instr, instr).c_str(), in DumpInstruction()
1615 return instr - begin_instr; in DumpInstruction()