| 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 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 // Actual number of base register given the low bits and the rex.b state. | 345 // Actual number of base register given the low bits and the rex.b state. |
| 346 int base_reg(int low_bits) { return low_bits | ((rex_ & 0x01) << 3); } | 346 int base_reg(int low_bits) { return low_bits | ((rex_ & 0x01) << 3); } |
| 347 | 347 |
| 348 bool rex_x() { return (rex_ & 0x02) != 0; } | 348 bool rex_x() { return (rex_ & 0x02) != 0; } |
| 349 | 349 |
| 350 bool rex_r() { return (rex_ & 0x04) != 0; } | 350 bool rex_r() { return (rex_ & 0x04) != 0; } |
| 351 | 351 |
| 352 bool rex_w() { return (rex_ & 0x08) != 0; } | 352 bool rex_w() { return (rex_ & 0x08) != 0; } |
| 353 | 353 |
| 354 bool vex_w() { |
| 355 DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX); |
| 356 return vex_byte0_ == VEX3_PREFIX ? (vex_byte2_ & 0x80) != 0 : false; |
| 357 } |
| 358 |
| 354 bool vex_128() { | 359 bool vex_128() { |
| 355 DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX); | 360 DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX); |
| 356 byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_; | 361 byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_; |
| 357 return (checked & 4) != 1; | 362 return (checked & 4) != 1; |
| 358 } | 363 } |
| 359 | 364 |
| 360 bool vex_none() { | 365 bool vex_none() { |
| 361 DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX); | 366 DCHECK(vex_byte0_ == VEX3_PREFIX || vex_byte0_ == VEX2_PREFIX); |
| 362 byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_; | 367 byte checked = vex_byte0_ == VEX3_PREFIX ? vex_byte2_ : vex_byte1_; |
| 363 return (checked & 3) == 0; | 368 return (checked & 3) == 0; |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 case 0x54: | 1189 case 0x54: |
| 1185 AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop), | 1190 AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop), |
| 1186 NameOfXMMRegister(vvvv)); | 1191 NameOfXMMRegister(vvvv)); |
| 1187 current += PrintRightXMMOperand(current); | 1192 current += PrintRightXMMOperand(current); |
| 1188 break; | 1193 break; |
| 1189 case 0x57: | 1194 case 0x57: |
| 1190 AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop), | 1195 AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop), |
| 1191 NameOfXMMRegister(vvvv)); | 1196 NameOfXMMRegister(vvvv)); |
| 1192 current += PrintRightXMMOperand(current); | 1197 current += PrintRightXMMOperand(current); |
| 1193 break; | 1198 break; |
| 1199 case 0x6e: |
| 1200 AppendToBuffer("vmov%c %s,", vex_w() ? 'q' : 'd', |
| 1201 NameOfXMMRegister(regop)); |
| 1202 current += PrintRightOperand(current); |
| 1203 break; |
| 1204 case 0x7e: |
| 1205 AppendToBuffer("vmov%c ", vex_w() ? 'q' : 'd'); |
| 1206 current += PrintRightOperand(current); |
| 1207 AppendToBuffer(",%s", NameOfXMMRegister(regop)); |
| 1208 break; |
| 1194 default: | 1209 default: |
| 1195 UnimplementedInstruction(); | 1210 UnimplementedInstruction(); |
| 1196 } | 1211 } |
| 1197 | 1212 |
| 1198 } else { | 1213 } else { |
| 1199 UnimplementedInstruction(); | 1214 UnimplementedInstruction(); |
| 1200 } | 1215 } |
| 1201 | 1216 |
| 1202 return static_cast<int>(current - data); | 1217 return static_cast<int>(current - data); |
| 1203 } | 1218 } |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { | 2389 for (int i = 6 - static_cast<int>(pc - prev_pc); i >= 0; i--) { |
| 2375 fprintf(f, " "); | 2390 fprintf(f, " "); |
| 2376 } | 2391 } |
| 2377 fprintf(f, " %s\n", buffer.start()); | 2392 fprintf(f, " %s\n", buffer.start()); |
| 2378 } | 2393 } |
| 2379 } | 2394 } |
| 2380 | 2395 |
| 2381 } // namespace disasm | 2396 } // namespace disasm |
| 2382 | 2397 |
| 2383 #endif // V8_TARGET_ARCH_X64 | 2398 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |