| OLD | NEW |
| 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 | 935 |
| 936 case CALL_JUMP_INSTR: { | 936 case CALL_JUMP_INSTR: { |
| 937 byte* addr = data + *reinterpret_cast<int32_t*>(data+1) + 5; | 937 byte* addr = data + *reinterpret_cast<int32_t*>(data+1) + 5; |
| 938 AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr)); | 938 AppendToBuffer("%s %s", idesc.mnem, NameOfAddress(addr)); |
| 939 data += 5; | 939 data += 5; |
| 940 break; | 940 break; |
| 941 } | 941 } |
| 942 | 942 |
| 943 case SHORT_IMMEDIATE_INSTR: { | 943 case SHORT_IMMEDIATE_INSTR: { |
| 944 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1)); | 944 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1)); |
| 945 AppendToBuffer("%s eax, %s", idesc.mnem, NameOfAddress(addr)); | 945 AppendToBuffer("%s eax,%s", idesc.mnem, NameOfAddress(addr)); |
| 946 data += 5; | 946 data += 5; |
| 947 break; | 947 break; |
| 948 } | 948 } |
| 949 | 949 |
| 950 case BYTE_IMMEDIATE_INSTR: { | 950 case BYTE_IMMEDIATE_INSTR: { |
| 951 AppendToBuffer("%s al, 0x%x", idesc.mnem, data[1]); | 951 AppendToBuffer("%s al,0x%x", idesc.mnem, data[1]); |
| 952 data += 2; | 952 data += 2; |
| 953 break; | 953 break; |
| 954 } | 954 } |
| 955 | 955 |
| 956 case NO_INSTR: | 956 case NO_INSTR: |
| 957 processed = false; | 957 processed = false; |
| 958 break; | 958 break; |
| 959 | 959 |
| 960 default: | 960 default: |
| 961 UNIMPLEMENTED(); // This type is not implemented. | 961 UNIMPLEMENTED(); // This type is not implemented. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 AppendToBuffer("%s", f0mnem); | 1035 AppendToBuffer("%s", f0mnem); |
| 1036 data += 2; | 1036 data += 2; |
| 1037 } else if (f0byte == 0x28) { | 1037 } else if (f0byte == 0x28) { |
| 1038 data += 2; | 1038 data += 2; |
| 1039 int mod, regop, rm; | 1039 int mod, regop, rm; |
| 1040 get_modrm(*data, &mod, ®op, &rm); | 1040 get_modrm(*data, &mod, ®op, &rm); |
| 1041 AppendToBuffer("movaps %s,%s", | 1041 AppendToBuffer("movaps %s,%s", |
| 1042 NameOfXMMRegister(regop), | 1042 NameOfXMMRegister(regop), |
| 1043 NameOfXMMRegister(rm)); | 1043 NameOfXMMRegister(rm)); |
| 1044 data++; | 1044 data++; |
| 1045 } else if (f0byte == 0x54) { |
| 1046 data += 2; |
| 1047 int mod, regop, rm; |
| 1048 get_modrm(*data, &mod, ®op, &rm); |
| 1049 AppendToBuffer("andps %s,%s", |
| 1050 NameOfXMMRegister(regop), |
| 1051 NameOfXMMRegister(rm)); |
| 1052 data++; |
| 1045 } else if (f0byte == 0x57) { | 1053 } else if (f0byte == 0x57) { |
| 1046 data += 2; | 1054 data += 2; |
| 1047 int mod, regop, rm; | 1055 int mod, regop, rm; |
| 1048 get_modrm(*data, &mod, ®op, &rm); | 1056 get_modrm(*data, &mod, ®op, &rm); |
| 1049 AppendToBuffer("xorps %s,%s", | 1057 AppendToBuffer("xorps %s,%s", |
| 1050 NameOfXMMRegister(regop), | 1058 NameOfXMMRegister(regop), |
| 1051 NameOfXMMRegister(rm)); | 1059 NameOfXMMRegister(rm)); |
| 1052 data++; | 1060 data++; |
| 1053 } else if (f0byte == 0x50) { | 1061 } else if (f0byte == 0x50) { |
| 1054 data += 2; | 1062 data += 2; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 NameOfCPURegister(regop), | 1240 NameOfCPURegister(regop), |
| 1233 NameOfXMMRegister(rm), | 1241 NameOfXMMRegister(rm), |
| 1234 static_cast<int>(imm8)); | 1242 static_cast<int>(imm8)); |
| 1235 data += 2; | 1243 data += 2; |
| 1236 } else if (*data == 0x17) { | 1244 } else if (*data == 0x17) { |
| 1237 data++; | 1245 data++; |
| 1238 int mod, regop, rm; | 1246 int mod, regop, rm; |
| 1239 get_modrm(*data, &mod, ®op, &rm); | 1247 get_modrm(*data, &mod, ®op, &rm); |
| 1240 int8_t imm8 = static_cast<int8_t>(data[1]); | 1248 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1241 AppendToBuffer("extractps %s,%s,%d", | 1249 AppendToBuffer("extractps %s,%s,%d", |
| 1242 NameOfCPURegister(regop), | 1250 NameOfCPURegister(rm), |
| 1243 NameOfXMMRegister(rm), | 1251 NameOfXMMRegister(regop), |
| 1244 static_cast<int>(imm8)); | 1252 static_cast<int>(imm8)); |
| 1245 data += 2; | 1253 data += 2; |
| 1246 } else if (*data == 0x22) { | 1254 } else if (*data == 0x22) { |
| 1247 data++; | 1255 data++; |
| 1248 int mod, regop, rm; | 1256 int mod, regop, rm; |
| 1249 get_modrm(*data, &mod, ®op, &rm); | 1257 get_modrm(*data, &mod, ®op, &rm); |
| 1250 int8_t imm8 = static_cast<int8_t>(data[1]); | 1258 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1251 AppendToBuffer("pinsrd %s,%s,%d", | 1259 AppendToBuffer("pinsrd %s,%s,%d", |
| 1252 NameOfXMMRegister(regop), | 1260 NameOfXMMRegister(regop), |
| 1253 NameOfCPURegister(rm), | 1261 NameOfCPURegister(rm), |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 fprintf(f, " "); | 1736 fprintf(f, " "); |
| 1729 } | 1737 } |
| 1730 fprintf(f, " %s\n", buffer.start()); | 1738 fprintf(f, " %s\n", buffer.start()); |
| 1731 } | 1739 } |
| 1732 } | 1740 } |
| 1733 | 1741 |
| 1734 | 1742 |
| 1735 } // namespace disasm | 1743 } // namespace disasm |
| 1736 | 1744 |
| 1737 #endif // V8_TARGET_ARCH_IA32 | 1745 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |