| 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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 } else if (*data == 0x2A) { | 1100 } else if (*data == 0x2A) { |
| 1101 // movntdqa | 1101 // movntdqa |
| 1102 data++; | 1102 data++; |
| 1103 int mod, regop, rm; | 1103 int mod, regop, rm; |
| 1104 get_modrm(*data, &mod, ®op, &rm); | 1104 get_modrm(*data, &mod, ®op, &rm); |
| 1105 AppendToBuffer("movntdqa %s,", NameOfXMMRegister(regop)); | 1105 AppendToBuffer("movntdqa %s,", NameOfXMMRegister(regop)); |
| 1106 data += PrintRightOperand(data); | 1106 data += PrintRightOperand(data); |
| 1107 } else { | 1107 } else { |
| 1108 UnimplementedInstruction(); | 1108 UnimplementedInstruction(); |
| 1109 } | 1109 } |
| 1110 } else if (*data == 0x3A) { |
| 1111 data++; |
| 1112 if (*data == 0x16) { |
| 1113 data++; |
| 1114 int mod, regop, rm; |
| 1115 get_modrm(*data, &mod, ®op, &rm); |
| 1116 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1117 AppendToBuffer("pextrd %s,%s,%d", |
| 1118 NameOfXMMRegister(regop), |
| 1119 NameOfXMMRegister(rm), |
| 1120 static_cast<int>(imm8)); |
| 1121 data += 2; |
| 1122 } else { |
| 1123 UnimplementedInstruction(); |
| 1124 } |
| 1110 } else if (*data == 0x2E || *data == 0x2F) { | 1125 } else if (*data == 0x2E || *data == 0x2F) { |
| 1111 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; | 1126 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; |
| 1112 data++; | 1127 data++; |
| 1113 int mod, regop, rm; | 1128 int mod, regop, rm; |
| 1114 get_modrm(*data, &mod, ®op, &rm); | 1129 get_modrm(*data, &mod, ®op, &rm); |
| 1115 if (mod == 0x3) { | 1130 if (mod == 0x3) { |
| 1116 AppendToBuffer("%s %s,%s", mnem, | 1131 AppendToBuffer("%s %s,%s", mnem, |
| 1117 NameOfXMMRegister(regop), | 1132 NameOfXMMRegister(regop), |
| 1118 NameOfXMMRegister(rm)); | 1133 NameOfXMMRegister(rm)); |
| 1119 data++; | 1134 data++; |
| 1120 } else { | 1135 } else { |
| 1121 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); | 1136 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); |
| 1122 data += PrintRightOperand(data); | 1137 data += PrintRightOperand(data); |
| 1123 } | 1138 } |
| 1124 } else if (*data == 0x50) { | 1139 } else if (*data == 0x50) { |
| 1125 data++; | 1140 data++; |
| 1126 int mod, regop, rm; | 1141 int mod, regop, rm; |
| 1127 get_modrm(*data, &mod, ®op, &rm); | 1142 get_modrm(*data, &mod, ®op, &rm); |
| 1128 AppendToBuffer("movmskpd %s,%s", | 1143 AppendToBuffer("movmskpd %s,%s", |
| 1129 NameOfCPURegister(regop), | 1144 NameOfCPURegister(regop), |
| 1130 NameOfXMMRegister(rm)); | 1145 NameOfXMMRegister(rm)); |
| 1131 data++; | 1146 data++; |
| 1147 } else if (*data == 0x54) { |
| 1148 data++; |
| 1149 int mod, regop, rm; |
| 1150 get_modrm(*data, &mod, ®op, &rm); |
| 1151 AppendToBuffer("andpd %s,%s", |
| 1152 NameOfXMMRegister(regop), |
| 1153 NameOfXMMRegister(rm)); |
| 1154 data++; |
| 1132 } else if (*data == 0x57) { | 1155 } else if (*data == 0x57) { |
| 1133 data++; | 1156 data++; |
| 1134 int mod, regop, rm; | 1157 int mod, regop, rm; |
| 1135 get_modrm(*data, &mod, ®op, &rm); | 1158 get_modrm(*data, &mod, ®op, &rm); |
| 1136 AppendToBuffer("xorpd %s,%s", | 1159 AppendToBuffer("xorpd %s,%s", |
| 1137 NameOfXMMRegister(regop), | 1160 NameOfXMMRegister(regop), |
| 1138 NameOfXMMRegister(rm)); | 1161 NameOfXMMRegister(rm)); |
| 1139 data++; | 1162 data++; |
| 1140 } else if (*data == 0x6E) { | 1163 } else if (*data == 0x6E) { |
| 1141 data++; | 1164 data++; |
| 1142 int mod, regop, rm; | 1165 int mod, regop, rm; |
| 1143 get_modrm(*data, &mod, ®op, &rm); | 1166 get_modrm(*data, &mod, ®op, &rm); |
| 1144 AppendToBuffer("movd %s,", NameOfXMMRegister(regop)); | 1167 AppendToBuffer("movd %s,", NameOfXMMRegister(regop)); |
| 1145 data += PrintRightOperand(data); | 1168 data += PrintRightOperand(data); |
| 1146 } else if (*data == 0x6F) { | 1169 } else if (*data == 0x6F) { |
| 1147 data++; | 1170 data++; |
| 1148 int mod, regop, rm; | 1171 int mod, regop, rm; |
| 1149 get_modrm(*data, &mod, ®op, &rm); | 1172 get_modrm(*data, &mod, ®op, &rm); |
| 1150 AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop)); | 1173 AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop)); |
| 1151 data += PrintRightOperand(data); | 1174 data += PrintRightOperand(data); |
| 1175 } else if (*data == 0x70) { |
| 1176 data++; |
| 1177 int mod, regop, rm; |
| 1178 get_modrm(*data, &mod, ®op, &rm); |
| 1179 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1180 AppendToBuffer("pshufd %s,%s,%d", |
| 1181 NameOfXMMRegister(regop), |
| 1182 NameOfXMMRegister(rm), |
| 1183 static_cast<int>(imm8)); |
| 1184 data += 2; |
| 1185 } else if (*data == 0x73) { |
| 1186 data++; |
| 1187 int mod, regop, rm; |
| 1188 get_modrm(*data, &mod, ®op, &rm); |
| 1189 int8_t imm8 = static_cast<int8_t>(data[1]); |
| 1190 AppendToBuffer("psllq %s,%d", |
| 1191 NameOfXMMRegister(rm), |
| 1192 static_cast<int>(imm8)); |
| 1193 data += 2; |
| 1152 } else if (*data == 0x7F) { | 1194 } else if (*data == 0x7F) { |
| 1153 AppendToBuffer("movdqa "); | 1195 AppendToBuffer("movdqa "); |
| 1154 data++; | 1196 data++; |
| 1155 int mod, regop, rm; | 1197 int mod, regop, rm; |
| 1156 get_modrm(*data, &mod, ®op, &rm); | 1198 get_modrm(*data, &mod, ®op, &rm); |
| 1157 data += PrintRightOperand(data); | 1199 data += PrintRightOperand(data); |
| 1158 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1200 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
| 1201 } else if (*data == 0x7E) { |
| 1202 data++; |
| 1203 int mod, regop, rm; |
| 1204 get_modrm(*data, &mod, ®op, &rm); |
| 1205 AppendToBuffer("movd "); |
| 1206 data += PrintRightOperand(data); |
| 1207 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
| 1208 } else if (*data == 0xDB) { |
| 1209 data++; |
| 1210 int mod, regop, rm; |
| 1211 get_modrm(*data, &mod, ®op, &rm); |
| 1212 AppendToBuffer("pand %s,%s", |
| 1213 NameOfXMMRegister(regop), |
| 1214 NameOfXMMRegister(rm)); |
| 1215 data++; |
| 1159 } else if (*data == 0xE7) { | 1216 } else if (*data == 0xE7) { |
| 1160 AppendToBuffer("movntdq "); | 1217 AppendToBuffer("movntdq "); |
| 1161 data++; | 1218 data++; |
| 1162 int mod, regop, rm; | 1219 int mod, regop, rm; |
| 1163 get_modrm(*data, &mod, ®op, &rm); | 1220 get_modrm(*data, &mod, ®op, &rm); |
| 1164 data += PrintRightOperand(data); | 1221 data += PrintRightOperand(data); |
| 1165 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1222 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
| 1166 } else if (*data == 0xEF) { | 1223 } else if (*data == 0xEF) { |
| 1167 data++; | 1224 data++; |
| 1168 int mod, regop, rm; | 1225 int mod, regop, rm; |
| 1169 get_modrm(*data, &mod, ®op, &rm); | 1226 get_modrm(*data, &mod, ®op, &rm); |
| 1170 AppendToBuffer("pxor %s,%s", | 1227 AppendToBuffer("pxor %s,%s", |
| 1171 NameOfXMMRegister(regop), | 1228 NameOfXMMRegister(regop), |
| 1172 NameOfXMMRegister(rm)); | 1229 NameOfXMMRegister(rm)); |
| 1173 data++; | 1230 data++; |
| 1174 } else if (*data == 0xDB) { | |
| 1175 data++; | |
| 1176 int mod, regop, rm; | |
| 1177 get_modrm(*data, &mod, ®op, &rm); | |
| 1178 AppendToBuffer("pand %s,%s", | |
| 1179 NameOfXMMRegister(regop), | |
| 1180 NameOfXMMRegister(rm)); | |
| 1181 data++; | |
| 1182 } else if (*data == 0x73) { | |
| 1183 data++; | |
| 1184 int mod, regop, rm; | |
| 1185 get_modrm(*data, &mod, ®op, &rm); | |
| 1186 int8_t imm8 = static_cast<int8_t>(data[1]); | |
| 1187 AppendToBuffer("psllq %s,%d", | |
| 1188 NameOfXMMRegister(rm), | |
| 1189 static_cast<int>(imm8)); | |
| 1190 data += 2; | |
| 1191 } else if (*data == 0x54) { | |
| 1192 data++; | |
| 1193 int mod, regop, rm; | |
| 1194 get_modrm(*data, &mod, ®op, &rm); | |
| 1195 AppendToBuffer("andpd %s,%s", | |
| 1196 NameOfXMMRegister(regop), | |
| 1197 NameOfXMMRegister(rm)); | |
| 1198 data++; | |
| 1199 } else { | 1231 } else { |
| 1200 UnimplementedInstruction(); | 1232 UnimplementedInstruction(); |
| 1201 } | 1233 } |
| 1202 } else { | 1234 } else { |
| 1203 UnimplementedInstruction(); | 1235 UnimplementedInstruction(); |
| 1204 } | 1236 } |
| 1205 break; | 1237 break; |
| 1206 | 1238 |
| 1207 case 0xFE: | 1239 case 0xFE: |
| 1208 { data++; | 1240 { data++; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 fprintf(f, " "); | 1552 fprintf(f, " "); |
| 1521 } | 1553 } |
| 1522 fprintf(f, " %s\n", buffer.start()); | 1554 fprintf(f, " %s\n", buffer.start()); |
| 1523 } | 1555 } |
| 1524 } | 1556 } |
| 1525 | 1557 |
| 1526 | 1558 |
| 1527 } // namespace disasm | 1559 } // namespace disasm |
| 1528 | 1560 |
| 1529 #endif // V8_TARGET_ARCH_IA32 | 1561 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |