OLD | NEW |
---|---|
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1062 data++; | 1062 data++; |
1063 int mod, regop, rm; | 1063 int mod, regop, rm; |
1064 get_modrm(*data, &mod, ®op, &rm); | 1064 get_modrm(*data, &mod, ®op, &rm); |
1065 AppendToBuffer("ptest %s,%s", | 1065 AppendToBuffer("ptest %s,%s", |
1066 NameOfXMMRegister(regop), | 1066 NameOfXMMRegister(regop), |
1067 NameOfXMMRegister(rm)); | 1067 NameOfXMMRegister(rm)); |
1068 data++; | 1068 data++; |
1069 } else { | 1069 } else { |
1070 UnimplementedInstruction(); | 1070 UnimplementedInstruction(); |
1071 } | 1071 } |
1072 } else if (*data == 0x2F) { | 1072 } else if (*data == 0x2E || *data == 0x2F) { |
1073 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; | |
1073 data++; | 1074 data++; |
1074 int mod, regop, rm; | 1075 int mod, regop, rm; |
1075 get_modrm(*data, &mod, ®op, &rm); | 1076 get_modrm(*data, &mod, ®op, &rm); |
1076 AppendToBuffer("comisd %s,%s", | 1077 if (mod == 0x3) { |
1077 NameOfXMMRegister(regop), | 1078 AppendToBuffer("%s %s,%s", mnem, |
1079 NameOfXMMRegister(regop), | |
1080 NameOfXMMRegister(rm)); | |
1081 data++; | |
1082 } else { | |
1083 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); | |
1084 data += PrintRightOperand(data); | |
1085 } | |
1086 } else if (*data == 0x50) { | |
1087 data++; | |
1088 int mod, regop, rm; | |
1089 get_modrm(*data, &mod, ®op, &rm); | |
1090 AppendToBuffer("movmskpd %s,%s", | |
1091 NameOfCPURegister(regop), | |
1078 NameOfXMMRegister(rm)); | 1092 NameOfXMMRegister(rm)); |
1079 data++; | 1093 data++; |
1080 } else if (*data == 0x57) { | 1094 } else if (*data == 0x57) { |
1081 data++; | 1095 data++; |
1082 int mod, regop, rm; | 1096 int mod, regop, rm; |
1083 get_modrm(*data, &mod, ®op, &rm); | 1097 get_modrm(*data, &mod, ®op, &rm); |
1084 AppendToBuffer("xorpd %s,%s", | 1098 AppendToBuffer("xorpd %s,%s", |
1085 NameOfXMMRegister(regop), | 1099 NameOfXMMRegister(regop), |
1086 NameOfXMMRegister(rm)); | 1100 NameOfXMMRegister(rm)); |
1087 data++; | 1101 data++; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1191 } else if (b2 == 0x10) { | 1205 } else if (b2 == 0x10) { |
1192 data += 3; | 1206 data += 3; |
1193 int mod, regop, rm; | 1207 int mod, regop, rm; |
1194 get_modrm(*data, &mod, ®op, &rm); | 1208 get_modrm(*data, &mod, ®op, &rm); |
1195 AppendToBuffer("movsd %s,", NameOfXMMRegister(regop)); | 1209 AppendToBuffer("movsd %s,", NameOfXMMRegister(regop)); |
1196 data += PrintRightOperand(data); | 1210 data += PrintRightOperand(data); |
1197 } else { | 1211 } else { |
1198 const char* mnem = "?"; | 1212 const char* mnem = "?"; |
1199 switch (b2) { | 1213 switch (b2) { |
1200 case 0x2A: mnem = "cvtsi2sd"; break; | 1214 case 0x2A: mnem = "cvtsi2sd"; break; |
1215 case 0x2C: mnem = "cvttsd2si"; break; | |
1201 case 0x51: mnem = "sqrtsd"; break; | 1216 case 0x51: mnem = "sqrtsd"; break; |
1202 case 0x58: mnem = "addsd"; break; | 1217 case 0x58: mnem = "addsd"; break; |
1203 case 0x59: mnem = "mulsd"; break; | 1218 case 0x59: mnem = "mulsd"; break; |
1204 case 0x5C: mnem = "subsd"; break; | 1219 case 0x5C: mnem = "subsd"; break; |
1205 case 0x5E: mnem = "divsd"; break; | 1220 case 0x5E: mnem = "divsd"; break; |
1206 } | 1221 } |
1207 data += 3; | 1222 data += 3; |
1208 int mod, regop, rm; | 1223 int mod, regop, rm; |
1209 get_modrm(*data, &mod, ®op, &rm); | 1224 get_modrm(*data, &mod, ®op, &rm); |
1210 if (b2 == 0x2A) { | 1225 if (b2 == 0x2A) { |
1211 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); | 1226 if (mod != 0x3) { |
1212 data += PrintRightOperand(data); | 1227 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); |
1228 data += PrintRightOperand(data); | |
1229 } else { | |
1230 AppendToBuffer("%s %s,%s", | |
1231 mnem, | |
1232 NameOfXMMRegister(regop), | |
1233 NameOfCPURegister(rm)); | |
1234 data++; | |
1235 } | |
1236 } else if (b2 == 0x2C) { | |
1237 if (mod != 0x3) { | |
1238 AppendToBuffer("%s %s,", mnem, NameOfCPURegister(regop)); | |
1239 data += PrintRightOperand(data); | |
1240 } else { | |
1241 AppendToBuffer("%s %s,%s", | |
1242 mnem, | |
1243 NameOfCPURegister(regop), | |
1244 NameOfXMMRegister(rm)); | |
1245 data++; | |
1246 } | |
1213 } else { | 1247 } else { |
1214 AppendToBuffer("%s %s,%s", | 1248 if (mod != 0x3) { |
1215 mnem, | 1249 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); |
1216 NameOfXMMRegister(regop), | 1250 data += PrintRightOperand(data); |
1217 NameOfXMMRegister(rm)); | 1251 } else { |
1218 data++; | 1252 AppendToBuffer("%s %s,%s", |
1253 mnem, | |
1254 NameOfXMMRegister(regop), | |
1255 NameOfXMMRegister(rm)); | |
1256 data++; | |
1257 } | |
ricowindcs_gmail.com
2010/03/11 18:20:04
The conditionals above could potentially be made m
| |
1219 } | 1258 } |
1220 } | 1259 } |
1221 } else { | 1260 } else { |
1222 UnimplementedInstruction(); | 1261 UnimplementedInstruction(); |
1223 } | 1262 } |
1224 break; | 1263 break; |
1225 | 1264 |
1226 case 0xF3: | 1265 case 0xF3: |
1227 if (*(data+1) == 0x0F) { | 1266 if (*(data+1) == 0x0F) { |
1228 if (*(data+2) == 0x2C) { | 1267 if (*(data+2) == 0x2C) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1392 } | 1431 } |
1393 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { | 1432 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { |
1394 fprintf(f, " "); | 1433 fprintf(f, " "); |
1395 } | 1434 } |
1396 fprintf(f, " %s\n", buffer.start()); | 1435 fprintf(f, " %s\n", buffer.start()); |
1397 } | 1436 } |
1398 } | 1437 } |
1399 | 1438 |
1400 | 1439 |
1401 } // namespace disasm | 1440 } // namespace disasm |
OLD | NEW |