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 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 AppendToBuffer("%s", mnem); | 886 AppendToBuffer("%s", mnem); |
887 } | 887 } |
888 return 2; | 888 return 2; |
889 } | 889 } |
890 | 890 |
891 | 891 |
892 // Mnemonics for instructions 0xF0 byte. | 892 // Mnemonics for instructions 0xF0 byte. |
893 // Returns NULL if the instruction is not handled here. | 893 // Returns NULL if the instruction is not handled here. |
894 static const char* F0Mnem(byte f0byte) { | 894 static const char* F0Mnem(byte f0byte) { |
895 switch (f0byte) { | 895 switch (f0byte) { |
| 896 case 0x0B: |
| 897 return "ud2"; |
896 case 0x18: return "prefetch"; | 898 case 0x18: return "prefetch"; |
897 case 0xA2: return "cpuid"; | 899 case 0xA2: return "cpuid"; |
898 case 0xBE: return "movsx_b"; | 900 case 0xBE: return "movsx_b"; |
899 case 0xBF: return "movsx_w"; | 901 case 0xBF: return "movsx_w"; |
900 case 0xB6: return "movzx_b"; | 902 case 0xB6: return "movzx_b"; |
901 case 0xB7: return "movzx_w"; | 903 case 0xB7: return "movzx_w"; |
902 case 0xAF: return "imul"; | 904 case 0xAF: return "imul"; |
903 case 0xA5: return "shld"; | 905 case 0xA5: return "shld"; |
904 case 0xAD: return "shrd"; | 906 case 0xAD: return "shrd"; |
905 case 0xAC: return "shrd"; // 3-operand version. | 907 case 0xAC: return "shrd"; // 3-operand version. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 data += 5; | 1052 data += 5; |
1051 } else if (f0byte == 0x1F && data[2] == 0x80 && data[3] == 0 && | 1053 } else if (f0byte == 0x1F && data[2] == 0x80 && data[3] == 0 && |
1052 data[4] == 0 && data[5] == 0 && data[6] == 0) { | 1054 data[4] == 0 && data[5] == 0 && data[6] == 0) { |
1053 AppendToBuffer("nop"); // 7 byte nop. | 1055 AppendToBuffer("nop"); // 7 byte nop. |
1054 data += 7; | 1056 data += 7; |
1055 } else if (f0byte == 0x1F && data[2] == 0x84 && data[3] == 0 && | 1057 } else if (f0byte == 0x1F && data[2] == 0x84 && data[3] == 0 && |
1056 data[4] == 0 && data[5] == 0 && data[6] == 0 && | 1058 data[4] == 0 && data[5] == 0 && data[6] == 0 && |
1057 data[7] == 0) { | 1059 data[7] == 0) { |
1058 AppendToBuffer("nop"); // 8 byte nop. | 1060 AppendToBuffer("nop"); // 8 byte nop. |
1059 data += 8; | 1061 data += 8; |
1060 } else if (f0byte == 0xA2 || f0byte == 0x31) { | 1062 } else if (f0byte == 0x0B || f0byte == 0xA2 || f0byte == 0x31) { |
1061 AppendToBuffer("%s", f0mnem); | 1063 AppendToBuffer("%s", f0mnem); |
1062 data += 2; | 1064 data += 2; |
1063 } else if (f0byte == 0x28) { | 1065 } else if (f0byte == 0x28) { |
1064 data += 2; | 1066 data += 2; |
1065 int mod, regop, rm; | 1067 int mod, regop, rm; |
1066 get_modrm(*data, &mod, ®op, &rm); | 1068 get_modrm(*data, &mod, ®op, &rm); |
1067 AppendToBuffer("movaps %s,%s", | 1069 AppendToBuffer("movaps %s,%s", |
1068 NameOfXMMRegister(regop), | 1070 NameOfXMMRegister(regop), |
1069 NameOfXMMRegister(rm)); | 1071 NameOfXMMRegister(rm)); |
1070 data++; | 1072 data++; |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 fprintf(f, " "); | 1789 fprintf(f, " "); |
1788 } | 1790 } |
1789 fprintf(f, " %s\n", buffer.start()); | 1791 fprintf(f, " %s\n", buffer.start()); |
1790 } | 1792 } |
1791 } | 1793 } |
1792 | 1794 |
1793 | 1795 |
1794 } // namespace disasm | 1796 } // namespace disasm |
1795 | 1797 |
1796 #endif // V8_TARGET_ARCH_X87 | 1798 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |