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 } | |
1125 } else if (*data == 0x2E || *data == 0x2F) { | 1110 } else if (*data == 0x2E || *data == 0x2F) { |
1126 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; | 1111 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; |
1127 data++; | 1112 data++; |
1128 int mod, regop, rm; | 1113 int mod, regop, rm; |
1129 get_modrm(*data, &mod, ®op, &rm); | 1114 get_modrm(*data, &mod, ®op, &rm); |
1130 if (mod == 0x3) { | 1115 if (mod == 0x3) { |
1131 AppendToBuffer("%s %s,%s", mnem, | 1116 AppendToBuffer("%s %s,%s", mnem, |
1132 NameOfXMMRegister(regop), | 1117 NameOfXMMRegister(regop), |
1133 NameOfXMMRegister(rm)); | 1118 NameOfXMMRegister(rm)); |
1134 data++; | 1119 data++; |
1135 } else { | 1120 } else { |
1136 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); | 1121 AppendToBuffer("%s %s,", mnem, NameOfXMMRegister(regop)); |
1137 data += PrintRightOperand(data); | 1122 data += PrintRightOperand(data); |
1138 } | 1123 } |
1139 } else if (*data == 0x50) { | 1124 } else if (*data == 0x50) { |
1140 data++; | 1125 data++; |
1141 int mod, regop, rm; | 1126 int mod, regop, rm; |
1142 get_modrm(*data, &mod, ®op, &rm); | 1127 get_modrm(*data, &mod, ®op, &rm); |
1143 AppendToBuffer("movmskpd %s,%s", | 1128 AppendToBuffer("movmskpd %s,%s", |
1144 NameOfCPURegister(regop), | 1129 NameOfCPURegister(regop), |
1145 NameOfXMMRegister(rm)); | 1130 NameOfXMMRegister(rm)); |
1146 data++; | 1131 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++; | |
1155 } else if (*data == 0x57) { | 1132 } else if (*data == 0x57) { |
1156 data++; | 1133 data++; |
1157 int mod, regop, rm; | 1134 int mod, regop, rm; |
1158 get_modrm(*data, &mod, ®op, &rm); | 1135 get_modrm(*data, &mod, ®op, &rm); |
1159 AppendToBuffer("xorpd %s,%s", | 1136 AppendToBuffer("xorpd %s,%s", |
1160 NameOfXMMRegister(regop), | 1137 NameOfXMMRegister(regop), |
1161 NameOfXMMRegister(rm)); | 1138 NameOfXMMRegister(rm)); |
1162 data++; | 1139 data++; |
1163 } else if (*data == 0x6E) { | 1140 } else if (*data == 0x6E) { |
1164 data++; | 1141 data++; |
1165 int mod, regop, rm; | 1142 int mod, regop, rm; |
1166 get_modrm(*data, &mod, ®op, &rm); | 1143 get_modrm(*data, &mod, ®op, &rm); |
1167 AppendToBuffer("movd %s,", NameOfXMMRegister(regop)); | 1144 AppendToBuffer("movd %s,", NameOfXMMRegister(regop)); |
1168 data += PrintRightOperand(data); | 1145 data += PrintRightOperand(data); |
1169 } else if (*data == 0x6F) { | 1146 } else if (*data == 0x6F) { |
1170 data++; | 1147 data++; |
1171 int mod, regop, rm; | 1148 int mod, regop, rm; |
1172 get_modrm(*data, &mod, ®op, &rm); | 1149 get_modrm(*data, &mod, ®op, &rm); |
1173 AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop)); | 1150 AppendToBuffer("movdqa %s,", NameOfXMMRegister(regop)); |
1174 data += PrintRightOperand(data); | 1151 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; | |
1194 } else if (*data == 0x7F) { | 1152 } else if (*data == 0x7F) { |
1195 AppendToBuffer("movdqa "); | 1153 AppendToBuffer("movdqa "); |
1196 data++; | 1154 data++; |
1197 int mod, regop, rm; | 1155 int mod, regop, rm; |
1198 get_modrm(*data, &mod, ®op, &rm); | 1156 get_modrm(*data, &mod, ®op, &rm); |
1199 data += PrintRightOperand(data); | 1157 data += PrintRightOperand(data); |
1200 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1158 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++; | |
1216 } else if (*data == 0xE7) { | 1159 } else if (*data == 0xE7) { |
1217 AppendToBuffer("movntdq "); | 1160 AppendToBuffer("movntdq "); |
1218 data++; | 1161 data++; |
1219 int mod, regop, rm; | 1162 int mod, regop, rm; |
1220 get_modrm(*data, &mod, ®op, &rm); | 1163 get_modrm(*data, &mod, ®op, &rm); |
1221 data += PrintRightOperand(data); | 1164 data += PrintRightOperand(data); |
1222 AppendToBuffer(",%s", NameOfXMMRegister(regop)); | 1165 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
1223 } else if (*data == 0xEF) { | 1166 } else if (*data == 0xEF) { |
1224 data++; | 1167 data++; |
1225 int mod, regop, rm; | 1168 int mod, regop, rm; |
1226 get_modrm(*data, &mod, ®op, &rm); | 1169 get_modrm(*data, &mod, ®op, &rm); |
1227 AppendToBuffer("pxor %s,%s", | 1170 AppendToBuffer("pxor %s,%s", |
1228 NameOfXMMRegister(regop), | 1171 NameOfXMMRegister(regop), |
1229 NameOfXMMRegister(rm)); | 1172 NameOfXMMRegister(rm)); |
1230 data++; | 1173 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++; |
1231 } else { | 1199 } else { |
1232 UnimplementedInstruction(); | 1200 UnimplementedInstruction(); |
1233 } | 1201 } |
1234 } else { | 1202 } else { |
1235 UnimplementedInstruction(); | 1203 UnimplementedInstruction(); |
1236 } | 1204 } |
1237 break; | 1205 break; |
1238 | 1206 |
1239 case 0xFE: | 1207 case 0xFE: |
1240 { data++; | 1208 { data++; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 fprintf(f, " "); | 1520 fprintf(f, " "); |
1553 } | 1521 } |
1554 fprintf(f, " %s\n", buffer.start()); | 1522 fprintf(f, " %s\n", buffer.start()); |
1555 } | 1523 } |
1556 } | 1524 } |
1557 | 1525 |
1558 | 1526 |
1559 } // namespace disasm | 1527 } // namespace disasm |
1560 | 1528 |
1561 #endif // V8_TARGET_ARCH_IA32 | 1529 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |