Changeset 40082 in vbox
- Timestamp:
- Feb 12, 2012 1:40:29 PM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r40077 r40082 10255 10255 10256 10256 10257 /** Opcode 0xd8 11/0. */ 10258 FNIEMOP_STUB_1(iemOp_fadd_stN, uint8_t, bRm); 10259 10260 /** Opcode 0xd8 11/1. */ 10261 FNIEMOP_STUB_1(iemOp_fmul_stN, uint8_t, bRm); 10262 10263 /** Opcode 0xd8 11/2. */ 10264 FNIEMOP_STUB_1(iemOp_fcom_stN, uint8_t, bRm); 10265 10266 /** Opcode 0xd8 11/3. */ 10267 FNIEMOP_STUB_1(iemOp_fcomp_stN, uint8_t, bRm); 10268 10269 /** Opcode 0xd8 11/4. */ 10270 FNIEMOP_STUB_1(iemOp_fsub_stN, uint8_t, bRm); 10271 10272 /** Opcode 0xd8 11/5. */ 10273 FNIEMOP_STUB_1(iemOp_fsubr_stN, uint8_t, bRm); 10274 10275 /** Opcode 0xd8 11/6. */ 10276 FNIEMOP_STUB_1(iemOp_fdiv_stN, uint8_t, bRm); 10277 10278 /** Opcode 0xd8 11/7. */ 10279 FNIEMOP_STUB_1(iemOp_fdivr_stN, uint8_t, bRm); 10280 10281 /** Opcode 0xd8 !11/0. */ 10282 FNIEMOP_STUB_1(iemOp_fadd_m32r, uint8_t, bRm); 10283 10284 /** Opcode 0xd8 !11/1. */ 10285 FNIEMOP_STUB_1(iemOp_fmul_m32r, uint8_t, bRm); 10286 10287 /** Opcode 0xd8 !11/2. */ 10288 FNIEMOP_STUB_1(iemOp_fcom_m32r, uint8_t, bRm); 10289 10290 /** Opcode 0xd8 !11/3. */ 10291 FNIEMOP_STUB_1(iemOp_fcomp_m32r, uint8_t, bRm); 10292 10293 /** Opcode 0xd8 !11/4. */ 10294 FNIEMOP_STUB_1(iemOp_fsub_m32r, uint8_t, bRm); 10295 10296 /** Opcode 0xd8 !11/5. */ 10297 FNIEMOP_STUB_1(iemOp_fsubr_m32r, uint8_t, bRm); 10298 10299 /** Opcode 0xd8 !11/6. */ 10300 FNIEMOP_STUB_1(iemOp_fdiv_m32r, uint8_t, bRm); 10301 10302 /** Opcode 0xd8 !11/7. */ 10303 FNIEMOP_STUB_1(iemOp_fdivr_m32r, uint8_t, bRm); 10304 10257 10305 /** Opcode 0xd8. */ 10258 FNIEMOP_STUB(iemOp_EscF0); 10259 /** Opcode 0xd9. */ 10260 FNIEMOP_STUB(iemOp_EscF1); 10261 /** Opcode 0xda. */ 10262 FNIEMOP_STUB(iemOp_EscF2); 10263 10264 10265 /** Opcode 0xdb /0. */ 10266 FNIEMOP_STUB_1(iemOp_fild_dw, uint8_t, bRm); 10267 /** Opcode 0xdb /1. */ 10268 FNIEMOP_STUB_1(iemOp_fisttp_dw, uint8_t, bRm); 10269 /** Opcode 0xdb /2. */ 10270 FNIEMOP_STUB_1(iemOp_fist_dw, uint8_t, bRm); 10271 /** Opcode 0xdb /3. */ 10272 FNIEMOP_STUB_1(iemOp_fistp_dw, uint8_t, bRm); 10273 /** Opcode 0xdb /5. */ 10274 FNIEMOP_STUB_1(iemOp_fld_xr, uint8_t, bRm); 10275 /** Opcode 0xdb /7. */ 10276 FNIEMOP_STUB_1(iemOp_fstp_xr, uint8_t, bRm); 10277 10278 10279 /** Opcode 0xdb 0xe0. */ 10280 FNIEMOP_DEF(iemOp_fneni) 10281 { 10282 IEMOP_MNEMONIC("fneni (8087/ign)"); 10283 IEM_MC_BEGIN(0,0); 10284 IEM_MC_ADVANCE_RIP(); 10285 IEM_MC_END(); 10286 return VINF_SUCCESS; 10287 } 10288 10289 10290 /** Opcode 0xdb 0xe1. */ 10291 FNIEMOP_DEF(iemOp_fndisi) 10292 { 10293 IEMOP_MNEMONIC("fndisi (8087/ign)"); 10294 IEM_MC_BEGIN(0,0); 10295 IEM_MC_ADVANCE_RIP(); 10296 IEM_MC_END(); 10297 return VINF_SUCCESS; 10298 } 10299 10300 10301 /** Opcode 0xdb 0xe2. */ 10302 FNIEMOP_STUB(iemOp_fnclex); 10303 10304 10305 /** Opcode 0xdb 0xe3. */ 10306 FNIEMOP_DEF(iemOp_fninit) 10307 { 10308 IEMOP_MNEMONIC("fninit"); 10309 return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_finit, false /*fCheckXcpts*/); 10310 } 10311 10312 10313 /** Opcode 0xdb 0xe4. */ 10314 FNIEMOP_DEF(iemOp_fnsetpm) 10315 { 10316 IEMOP_MNEMONIC("fnsetpm (80287/ign)"); /* set protected mode on fpu. */ 10317 IEM_MC_BEGIN(0,0); 10318 IEM_MC_ADVANCE_RIP(); 10319 IEM_MC_END(); 10320 return VINF_SUCCESS; 10321 } 10322 10323 10324 /** Opcode 0xdb 0xe5. */ 10325 FNIEMOP_DEF(iemOp_frstpm) 10326 { 10327 IEMOP_MNEMONIC("frstpm (80287XL/ign)"); /* reset pm, back to real mode. */ 10328 IEM_MC_BEGIN(0,0); 10329 IEM_MC_ADVANCE_RIP(); 10330 IEM_MC_END(); 10331 return VINF_SUCCESS; 10332 } 10333 10334 10335 /** Opcode 0xdb. */ 10336 FNIEMOP_DEF(iemOp_EscF3) 10337 { 10306 FNIEMOP_DEF(iemOp_EscF0) 10307 { 10308 pIemCpu->offFpuOpcode = pIemCpu->offOpcode - 1; 10338 10309 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10310 10339 10311 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 10340 10312 { 10341 switch ( bRm & 0xf8)10313 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10342 10314 { 10343 case 0xc0: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fcmovnb 10344 case 0xc8: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fcmovne 10345 case 0xd0: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fcmovnbe 10346 case 0xd8: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fcmovnu 10347 case 0xe0: 10348 IEMOP_HLP_NO_LOCK_PREFIX(); 10349 switch (bRm) 10350 { 10351 case 0xe0: return FNIEMOP_CALL(iemOp_fneni); 10352 case 0xe1: return FNIEMOP_CALL(iemOp_fndisi); 10353 case 0xe2: return FNIEMOP_CALL(iemOp_fnclex); 10354 case 0xe3: return FNIEMOP_CALL(iemOp_fninit); 10355 case 0xe4: return FNIEMOP_CALL(iemOp_fnsetpm); 10356 case 0xe5: return FNIEMOP_CALL(iemOp_frstpm); 10357 default: return IEMOP_RAISE_INVALID_OPCODE(); 10358 } 10359 break; 10360 case 0xe8: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fucomi 10361 case 0xf0: AssertFailedReturn(VERR_IEM_INSTR_NOT_IMPLEMENTED); // fcomi 10362 case 0xf8: return IEMOP_RAISE_INVALID_OPCODE(); 10315 case 0: return FNIEMOP_CALL_1(iemOp_fadd_stN, bRm); 10316 case 1: return FNIEMOP_CALL_1(iemOp_fmul_stN, bRm); 10317 case 2: return FNIEMOP_CALL_1(iemOp_fcom_stN, bRm); 10318 case 3: return FNIEMOP_CALL_1(iemOp_fcomp_stN, bRm); 10319 case 4: return FNIEMOP_CALL_1(iemOp_fsub_stN, bRm); 10320 case 5: return FNIEMOP_CALL_1(iemOp_fsubr_stN, bRm); 10321 case 6: return FNIEMOP_CALL_1(iemOp_fdiv_stN, bRm); 10322 case 7: return FNIEMOP_CALL_1(iemOp_fdivr_stN, bRm); 10363 10323 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10364 10324 } … … 10368 10328 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10369 10329 { 10370 case 0: return FNIEMOP_CALL_1(iemOp_f ild_dw, bRm);10371 case 1: return FNIEMOP_CALL_1(iemOp_f isttp_dw,bRm);10372 case 2: return FNIEMOP_CALL_1(iemOp_f ist_dw, bRm);10373 case 3: return FNIEMOP_CALL_1(iemOp_f istp_dw, bRm);10374 case 4: return IEMOP_RAISE_INVALID_OPCODE();10375 case 5: return FNIEMOP_CALL_1(iemOp_f ld_xr,bRm);10376 case 6: return IEMOP_RAISE_INVALID_OPCODE();10377 case 7: return FNIEMOP_CALL_1(iemOp_f stp_xr,bRm);10330 case 0: return FNIEMOP_CALL_1(iemOp_fadd_m32r, bRm); 10331 case 1: return FNIEMOP_CALL_1(iemOp_fmul_m32r, bRm); 10332 case 2: return FNIEMOP_CALL_1(iemOp_fcom_m32r, bRm); 10333 case 3: return FNIEMOP_CALL_1(iemOp_fcomp_m32r, bRm); 10334 case 4: return FNIEMOP_CALL_1(iemOp_fsub_m32r, bRm); 10335 case 5: return FNIEMOP_CALL_1(iemOp_fsubr_m32r, bRm); 10336 case 6: return FNIEMOP_CALL_1(iemOp_fdiv_m32r, bRm); 10337 case 7: return FNIEMOP_CALL_1(iemOp_fdivr_m32r, bRm); 10378 10338 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10379 10339 } … … 10381 10341 } 10382 10342 10383 /** Opcode 0xdc. */ 10384 FNIEMOP_STUB(iemOp_EscF4); 10385 10386 10387 /** Opcode 0xdd /0 mem32real */ 10343 10344 /** Opcode 0xd9 /0 mem32real */ 10388 10345 FNIEMOP_DEF_1(iemOp_fld_m32r, uint8_t, bRm) 10389 10346 { … … 10397 10354 IEM_MC_ARG(RTFLOAT32U, r32Val, 1); 10398 10355 10399 #ifdef LOG_ENABLED10400 Log(("r32Val=%#x\n", r32Val.u32));10401 #endif10402 10356 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm); 10403 10357 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); … … 10414 10368 10415 10369 10416 /** Opcode 0xd d/0 stN */10370 /** Opcode 0xd9 /0 stN */ 10417 10371 FNIEMOP_STUB_1(iemOp_fld_stN, uint8_t, bRm); 10418 10372 10419 /** Opcode 0xd d/2 mem32real */10373 /** Opcode 0xd9 /2 mem32real */ 10420 10374 FNIEMOP_STUB_1(iemOp_fst_m32r, uint8_t, bRm); 10421 10375 10422 /** Opcode 0xd d /0stN */10376 /** Opcode 0xd9 /3 stN */ 10423 10377 FNIEMOP_STUB_1(iemOp_fxch_stN, uint8_t, bRm); 10424 10378 10425 /** Opcode 0xd d/3 */10379 /** Opcode 0xd9 /3 */ 10426 10380 FNIEMOP_STUB_1(iemOp_fstp_m32r, uint8_t, bRm); 10427 10381 10428 /** Opcode 0xd d/4 */10382 /** Opcode 0xd9 /4 */ 10429 10383 FNIEMOP_STUB_1(iemOp_fldenv, uint8_t, bRm); 10430 10384 10431 /** Opcode 0xd d/5 */10385 /** Opcode 0xd9 /5 */ 10432 10386 FNIEMOP_STUB_1(iemOp_fldcw, uint8_t, bRm); 10433 10387 10434 /** Opcode 0xd d/6 */10388 /** Opcode 0xd9 /6 */ 10435 10389 FNIEMOP_STUB_1(iemOp_fstenv, uint8_t, bRm); 10436 10390 10437 /** Opcode 0xd d/7 */10391 /** Opcode 0xd9 /7 */ 10438 10392 FNIEMOP_STUB_1(iemOp_fstcw, uint8_t, bRm); 10439 10393 10440 /** Opcode 0xd d 0xc9, 0xdd0xd8-0xdf. */10394 /** Opcode 0xd9 0xc9, 0xd9 0xd8-0xdf. */ 10441 10395 FNIEMOP_STUB(iemOp_fnop); 10442 10396 10443 /** Opcode 0xd d0xe0. */10397 /** Opcode 0xd9 0xe0. */ 10444 10398 FNIEMOP_STUB(iemOp_fchs); 10445 10399 10446 /** Opcode 0xd d0xe1. */10400 /** Opcode 0xd9 0xe1. */ 10447 10401 FNIEMOP_STUB(iemOp_fabs); 10448 10402 10449 /** Opcode 0xd d0xe4. */10403 /** Opcode 0xd9 0xe4. */ 10450 10404 FNIEMOP_STUB(iemOp_ftst); 10451 10405 10452 /** Opcode 0xd d0xe5. */10406 /** Opcode 0xd9 0xe5. */ 10453 10407 FNIEMOP_STUB(iemOp_fxam); 10454 10408 10455 /** Opcode 0xd d0xe8. */10409 /** Opcode 0xd9 0xe8. */ 10456 10410 FNIEMOP_STUB(iemOp_fld1); 10457 10411 10458 /** Opcode 0xd d0xe9. */10412 /** Opcode 0xd9 0xe9. */ 10459 10413 FNIEMOP_STUB(iemOp_fldl2t); 10460 10414 10461 /** Opcode 0xd d0xea. */10415 /** Opcode 0xd9 0xea. */ 10462 10416 FNIEMOP_STUB(iemOp_fldl2e); 10463 10417 10464 /** Opcode 0xd d0xeb. */10418 /** Opcode 0xd9 0xeb. */ 10465 10419 FNIEMOP_STUB(iemOp_fldpi); 10466 10420 10467 /** Opcode 0xd d0xec. */10421 /** Opcode 0xd9 0xec. */ 10468 10422 FNIEMOP_STUB(iemOp_fldlg2); 10469 10423 10470 /** Opcode 0xd d0xed. */10424 /** Opcode 0xd9 0xed. */ 10471 10425 FNIEMOP_STUB(iemOp_fldln2); 10472 10426 10473 /** Opcode 0xd d0xee. */10427 /** Opcode 0xd9 0xee. */ 10474 10428 FNIEMOP_STUB(iemOp_fldz); 10475 10429 10476 /** Opcode 0xd d0xf0. */10430 /** Opcode 0xd9 0xf0. */ 10477 10431 FNIEMOP_STUB(iemOp_f2xm1); 10478 10432 10479 /** Opcode 0xd d0xf1. */10433 /** Opcode 0xd9 0xf1. */ 10480 10434 FNIEMOP_STUB(iemOp_fylx2); 10481 10435 10482 /** Opcode 0xd d0xf2. */10436 /** Opcode 0xd9 0xf2. */ 10483 10437 FNIEMOP_STUB(iemOp_fptan); 10484 10438 10485 /** Opcode 0xd d0xf3. */10439 /** Opcode 0xd9 0xf3. */ 10486 10440 FNIEMOP_STUB(iemOp_fpatan); 10487 10441 10488 /** Opcode 0xd d0xf4. */10442 /** Opcode 0xd9 0xf4. */ 10489 10443 FNIEMOP_STUB(iemOp_fxtract); 10490 10444 10491 /** Opcode 0xd d0xf5. */10445 /** Opcode 0xd9 0xf5. */ 10492 10446 FNIEMOP_STUB(iemOp_fprem1); 10493 10447 10494 /** Opcode 0xd d0xf6. */10448 /** Opcode 0xd9 0xf6. */ 10495 10449 FNIEMOP_STUB(iemOp_fdecstp); 10496 10450 10497 /** Opcode 0xd d0xf7. */10451 /** Opcode 0xd9 0xf7. */ 10498 10452 FNIEMOP_STUB(iemOp_fincstp); 10499 10453 10500 /** Opcode 0xd d0xf8. */10454 /** Opcode 0xd9 0xf8. */ 10501 10455 FNIEMOP_STUB(iemOp_fprem); 10502 10456 10503 /** Opcode 0xd d0xf9. */10457 /** Opcode 0xd9 0xf9. */ 10504 10458 FNIEMOP_STUB(iemOp_fyl2xp1); 10505 10459 10506 /** Opcode 0xd d0xfa. */10460 /** Opcode 0xd9 0xfa. */ 10507 10461 FNIEMOP_STUB(iemOp_fsqrt); 10508 10462 10509 /** Opcode 0xd d0xfb. */10463 /** Opcode 0xd9 0xfb. */ 10510 10464 FNIEMOP_STUB(iemOp_fsincos); 10511 10465 10512 /** Opcode 0xd d0xfc. */10466 /** Opcode 0xd9 0xfc. */ 10513 10467 FNIEMOP_STUB(iemOp_frndint); 10514 10468 10515 /** Opcode 0xd d0xfd. */10469 /** Opcode 0xd9 0xfd. */ 10516 10470 FNIEMOP_STUB(iemOp_fscale); 10517 10471 10518 /** Opcode 0xd d0xfe. */10472 /** Opcode 0xd9 0xfe. */ 10519 10473 FNIEMOP_STUB(iemOp_fsin); 10520 10474 10521 /** Opcode 0xd d0xff. */10475 /** Opcode 0xd9 0xff. */ 10522 10476 FNIEMOP_STUB(iemOp_fcos); 10523 10477 10524 10478 10525 /** Used by iemOp_EscF 5. */10526 static const PFNIEMOP g_apfnEscF 5_E0toFF[32] =10479 /** Used by iemOp_EscF1. */ 10480 static const PFNIEMOP g_apfnEscF1_E0toFF[32] = 10527 10481 { 10528 10482 /* 0xe0 */ iemOp_fchs, … … 10561 10515 10562 10516 10563 /** Opcode 0xdd. */ 10564 FNIEMOP_DEF(iemOp_EscF5) 10565 { 10517 /** Opcode 0xd9. */ 10518 FNIEMOP_DEF(iemOp_EscF1) 10519 { 10520 pIemCpu->offFpuOpcode = pIemCpu->offOpcode - 1; 10566 10521 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10567 10522 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 10569 10524 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10570 10525 { 10571 case 0: 10572 return FNIEMOP_CALL_1(iemOp_fld_stN, bRm); 10573 case 1: 10574 return FNIEMOP_CALL_1(iemOp_fxch_stN, bRm); 10526 case 0: return FNIEMOP_CALL_1(iemOp_fld_stN, bRm); 10527 case 1: return FNIEMOP_CALL_1(iemOp_fxch_stN, bRm); 10575 10528 case 2: 10576 10529 if (bRm == 0xc9) … … 10579 10532 case 3: 10580 10533 return FNIEMOP_CALL(iemOp_fnop); /* AMD says reserved; tests on intel indicates FNOP. */ 10581 case 4: case 5: case 6: case 7: 10582 return FNIEMOP_CALL(g_apfnEscF5_E0toFF[(bRm & (X86_MODRM_REG_MASK |X86_MODRM_RM_MASK)) - 0xe0]); 10534 case 4: 10535 case 5: 10536 case 6: 10537 case 7: 10538 return FNIEMOP_CALL(g_apfnEscF1_E0toFF[(bRm & (X86_MODRM_REG_MASK |X86_MODRM_RM_MASK)) - 0xe0]); 10583 10539 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10584 10540 } 10585 10586 10541 } 10587 10542 else … … 10590 10545 { 10591 10546 case 0: return FNIEMOP_CALL_1(iemOp_fld_m32r, bRm); 10592 case 1: return IEMOP_RAISE_INVALID_OPCODE(); /** @todo Check if 0xdd /1 is a valid instruction which does/did something. */10547 case 1: return IEMOP_RAISE_INVALID_OPCODE(); 10593 10548 case 2: return FNIEMOP_CALL_1(iemOp_fst_m32r, bRm); 10594 10549 case 3: return FNIEMOP_CALL_1(iemOp_fstp_m32r, bRm); … … 10597 10552 case 6: return FNIEMOP_CALL_1(iemOp_fstenv, bRm); 10598 10553 case 7: return FNIEMOP_CALL_1(iemOp_fstcw, bRm); 10554 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10555 } 10556 } 10557 } 10558 10559 10560 /** Opcode 0xda 11/0. */ 10561 FNIEMOP_STUB_1(iemOp_fcmovb_stN, uint8_t, bRm); 10562 /** Opcode 0xda 11/1. */ 10563 FNIEMOP_STUB_1(iemOp_fcmove_stN, uint8_t, bRm); 10564 /** Opcode 0xda 11/2. */ 10565 FNIEMOP_STUB_1(iemOp_fcmovbe_stN, uint8_t, bRm); 10566 /** Opcode 0xda 11/3. */ 10567 FNIEMOP_STUB_1(iemOp_fcmovu_stN, uint8_t, bRm); 10568 /** Opcode 0xda 0xe9. */ 10569 FNIEMOP_STUB(iemOp_fucompp); 10570 /** Opcode 0xda !11/0. */ 10571 FNIEMOP_STUB_1(iemOp_fiadd_m32i, uint8_t, bRm); 10572 /** Opcode 0xda !11/1. */ 10573 FNIEMOP_STUB_1(iemOp_fimul_m32i, uint8_t, bRm); 10574 /** Opcode 0xda !11/2. */ 10575 FNIEMOP_STUB_1(iemOp_ficom_m32i, uint8_t, bRm); 10576 /** Opcode 0xda !11/3. */ 10577 FNIEMOP_STUB_1(iemOp_ficomp_m32i, uint8_t, bRm); 10578 /** Opcode 0xda !11/4. */ 10579 FNIEMOP_STUB_1(iemOp_fisub_m32i, uint8_t, bRm); 10580 /** Opcode 0xda !11/5. */ 10581 FNIEMOP_STUB_1(iemOp_fisubr_m32i, uint8_t, bRm); 10582 /** Opcode 0xda !11/6. */ 10583 FNIEMOP_STUB_1(iemOp_fidiv_m32i, uint8_t, bRm); 10584 /** Opcode 0xda !11/7. */ 10585 FNIEMOP_STUB_1(iemOp_fidivr_m32i, uint8_t, bRm); 10586 10587 /** Opcode 0xda. */ 10588 FNIEMOP_DEF(iemOp_EscF2) 10589 { 10590 pIemCpu->offFpuOpcode = pIemCpu->offOpcode - 1; 10591 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10592 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 10593 { 10594 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10595 { 10596 case 0: return FNIEMOP_CALL_1(iemOp_fcmovb_stN, bRm); 10597 case 1: return FNIEMOP_CALL_1(iemOp_fcmove_stN, bRm); 10598 case 2: return FNIEMOP_CALL_1(iemOp_fcmovbe_stN, bRm); 10599 case 3: return FNIEMOP_CALL_1(iemOp_fcmovu_stN, bRm); 10600 case 4: return IEMOP_RAISE_INVALID_OPCODE(); 10601 case 5: 10602 if (bRm == 0xe9) 10603 return FNIEMOP_CALL(iemOp_fucompp); 10604 return IEMOP_RAISE_INVALID_OPCODE(); 10605 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 10606 case 7: return IEMOP_RAISE_INVALID_OPCODE(); 10607 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10608 } 10609 } 10610 else 10611 { 10612 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10613 { 10614 case 0: return FNIEMOP_CALL_1(iemOp_fiadd_m32i, bRm); 10615 case 1: return FNIEMOP_CALL_1(iemOp_fimul_m32i, bRm); 10616 case 2: return FNIEMOP_CALL_1(iemOp_ficom_m32i, bRm); 10617 case 3: return FNIEMOP_CALL_1(iemOp_ficomp_m32i, bRm); 10618 case 4: return FNIEMOP_CALL_1(iemOp_fisub_m32i, bRm); 10619 case 5: return FNIEMOP_CALL_1(iemOp_fisubr_m32i, bRm); 10620 case 6: return FNIEMOP_CALL_1(iemOp_fidiv_m32i, bRm); 10621 case 7: return FNIEMOP_CALL_1(iemOp_fidivr_m32i, bRm); 10622 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10623 } 10624 } 10625 } 10626 10627 10628 /** Opcode 0xdb !11/0. */ 10629 FNIEMOP_STUB_1(iemOp_fild_m32i, uint8_t, bRm); 10630 10631 /** Opcode 0xdb !11/1. */ 10632 FNIEMOP_STUB_1(iemOp_fisttp_m32i, uint8_t, bRm); 10633 10634 /** Opcode 0xdb !11/2. */ 10635 FNIEMOP_STUB_1(iemOp_fist_m32i, uint8_t, bRm); 10636 10637 /** Opcode 0xdb !11/3. */ 10638 FNIEMOP_STUB_1(iemOp_fistp_m32i, uint8_t, bRm); 10639 10640 /** Opcode 0xdb !11/5. */ 10641 FNIEMOP_STUB_1(iemOp_fld_r80, uint8_t, bRm); 10642 10643 /** Opcode 0xdb !11/7. */ 10644 FNIEMOP_STUB_1(iemOp_fstp_r80, uint8_t, bRm); 10645 10646 /** Opcode 0xdb 11/0. */ 10647 FNIEMOP_STUB_1(iemOp_fcmovnb, uint8_t, bRm); 10648 10649 /** Opcode 0xdb 11/1. */ 10650 FNIEMOP_STUB_1(iemOp_fcmovne, uint8_t, bRm); 10651 10652 /** Opcode 0xdb 11/2. */ 10653 FNIEMOP_STUB_1(iemOp_fcmovnbe, uint8_t, bRm); 10654 10655 /** Opcode 0xdb 11/3. */ 10656 FNIEMOP_STUB_1(iemOp_fcmovnnu, uint8_t, bRm); 10657 10658 10659 /** Opcode 0xdb 0xe0. */ 10660 FNIEMOP_DEF(iemOp_fneni) 10661 { 10662 IEMOP_MNEMONIC("fneni (8087/ign)"); 10663 IEM_MC_BEGIN(0,0); 10664 IEM_MC_ADVANCE_RIP(); 10665 IEM_MC_END(); 10666 return VINF_SUCCESS; 10667 } 10668 10669 10670 /** Opcode 0xdb 0xe1. */ 10671 FNIEMOP_DEF(iemOp_fndisi) 10672 { 10673 IEMOP_MNEMONIC("fndisi (8087/ign)"); 10674 IEM_MC_BEGIN(0,0); 10675 IEM_MC_ADVANCE_RIP(); 10676 IEM_MC_END(); 10677 return VINF_SUCCESS; 10678 } 10679 10680 10681 /** Opcode 0xdb 0xe2. */ 10682 FNIEMOP_STUB(iemOp_fnclex); 10683 10684 10685 /** Opcode 0xdb 0xe3. */ 10686 FNIEMOP_DEF(iemOp_fninit) 10687 { 10688 IEMOP_MNEMONIC("fninit"); 10689 return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_finit, false /*fCheckXcpts*/); 10690 } 10691 10692 10693 /** Opcode 0xdb 0xe4. */ 10694 FNIEMOP_DEF(iemOp_fnsetpm) 10695 { 10696 IEMOP_MNEMONIC("fnsetpm (80287/ign)"); /* set protected mode on fpu. */ 10697 IEM_MC_BEGIN(0,0); 10698 IEM_MC_ADVANCE_RIP(); 10699 IEM_MC_END(); 10700 return VINF_SUCCESS; 10701 } 10702 10703 10704 /** Opcode 0xdb 0xe5. */ 10705 FNIEMOP_DEF(iemOp_frstpm) 10706 { 10707 IEMOP_MNEMONIC("frstpm (80287XL/ign)"); /* reset pm, back to real mode. */ 10708 #if 0 /* #UDs on newer CPUs */ 10709 IEM_MC_BEGIN(0,0); 10710 IEM_MC_ADVANCE_RIP(); 10711 IEM_MC_END(); 10712 return VINF_SUCCESS; 10713 #else 10714 return IEMOP_RAISE_INVALID_OPCODE(); 10715 #endif 10716 } 10717 10718 10719 /** Opcode 0xdb 11/5. */ 10720 FNIEMOP_STUB_1(iemOp_fucomi, uint8_t, bRm); 10721 10722 /** Opcode 0xdb 11/6. */ 10723 FNIEMOP_STUB_1(iemOp_fcomi, uint8_t, bRm); 10724 10725 10726 /** Opcode 0xdb. */ 10727 FNIEMOP_DEF(iemOp_EscF3) 10728 { 10729 pIemCpu->offFpuOpcode = pIemCpu->offOpcode - 1; 10730 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10731 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 10732 { 10733 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10734 { 10735 case 0: FNIEMOP_CALL_1(iemOp_fcmovnb, bRm); 10736 case 1: FNIEMOP_CALL_1(iemOp_fcmovne, bRm); 10737 case 2: FNIEMOP_CALL_1(iemOp_fcmovnbe, bRm); 10738 case 3: FNIEMOP_CALL_1(iemOp_fcmovnnu, bRm); 10739 case 4: 10740 IEMOP_HLP_NO_LOCK_PREFIX(); 10741 switch (bRm) 10742 { 10743 case 0xe0: return FNIEMOP_CALL(iemOp_fneni); 10744 case 0xe1: return FNIEMOP_CALL(iemOp_fndisi); 10745 case 0xe2: return FNIEMOP_CALL(iemOp_fnclex); 10746 case 0xe3: return FNIEMOP_CALL(iemOp_fninit); 10747 case 0xe4: return FNIEMOP_CALL(iemOp_fnsetpm); 10748 case 0xe5: return FNIEMOP_CALL(iemOp_frstpm); 10749 case 0xe6: return IEMOP_RAISE_INVALID_OPCODE(); 10750 case 0xe7: return IEMOP_RAISE_INVALID_OPCODE(); 10751 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10752 } 10753 break; 10754 case 5: return FNIEMOP_CALL_1(iemOp_fucomi, bRm); 10755 case 6: return FNIEMOP_CALL_1(iemOp_fcomi, bRm); 10756 case 7: return IEMOP_RAISE_INVALID_OPCODE(); 10757 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10758 } 10759 } 10760 else 10761 { 10762 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10763 { 10764 case 0: return FNIEMOP_CALL_1(iemOp_fild_m32i, bRm); 10765 case 1: return FNIEMOP_CALL_1(iemOp_fisttp_m32i,bRm); 10766 case 2: return FNIEMOP_CALL_1(iemOp_fist_m32i, bRm); 10767 case 3: return FNIEMOP_CALL_1(iemOp_fistp_m32i, bRm); 10768 case 4: return IEMOP_RAISE_INVALID_OPCODE(); 10769 case 5: return FNIEMOP_CALL_1(iemOp_fld_r80, bRm); 10770 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 10771 case 7: return FNIEMOP_CALL_1(iemOp_fstp_r80, bRm); 10772 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10773 } 10774 } 10775 } 10776 10777 /** Opcode 0xdc. */ 10778 FNIEMOP_STUB(iemOp_EscF4); 10779 10780 10781 /** Opcode 0xdd !11/0. */ 10782 FNIEMOP_STUB_1(iemOp_fld_m64r, uint8_t, bRm); 10783 10784 /** Opcode 0xdd !11/0. */ 10785 FNIEMOP_STUB_1(iemOp_fisttp_m64i, uint8_t, bRm); 10786 10787 /** Opcode 0xdd !11/0. */ 10788 FNIEMOP_STUB_1(iemOp_fst_m64r, uint8_t, bRm); 10789 10790 /** Opcode 0xdd !11/0. */ 10791 FNIEMOP_STUB_1(iemOp_fstp_m64r, uint8_t, bRm); 10792 10793 /** Opcode 0xdd !11/0. */ 10794 FNIEMOP_STUB_1(iemOp_frstor, uint8_t, bRm); 10795 10796 /** Opcode 0xdd !11/0. */ 10797 FNIEMOP_STUB_1(iemOp_fnsave, uint8_t, bRm); 10798 10799 /** Opcode 0xdd !11/0. */ 10800 FNIEMOP_STUB_1(iemOp_fnstsw, uint8_t, bRm); 10801 10802 /** Opcode 0xdd 11/0. */ 10803 FNIEMOP_STUB_1(iemOp_ffree_stN, uint8_t, bRm); 10804 10805 /** Opcode 0xdd 11/1. */ 10806 FNIEMOP_STUB_1(iemOp_fst_stN, uint8_t, bRm); 10807 10808 /** Opcode 0xdd 11/2. */ 10809 FNIEMOP_STUB_1(iemOp_fstp_stN, uint8_t, bRm); 10810 10811 /** Opcode 0xdd 11/3. */ 10812 FNIEMOP_STUB_1(iemOp_fucom_stN, uint8_t, bRm); 10813 10814 /** Opcode 0xdd 11/4. */ 10815 FNIEMOP_STUB_1(iemOp_fucomp_stN, uint8_t, bRm); 10816 10817 /** Opcode 0xdd. */ 10818 FNIEMOP_DEF(iemOp_EscF5) 10819 { 10820 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10821 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 10822 { 10823 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10824 { 10825 case 0: return FNIEMOP_CALL_1(iemOp_ffree_stN, bRm); 10826 case 1: return FNIEMOP_CALL( iemOp_fnop); 10827 case 2: return FNIEMOP_CALL_1(iemOp_fst_stN, bRm); 10828 case 3: return FNIEMOP_CALL_1(iemOp_fstp_stN, bRm); 10829 case 4: return FNIEMOP_CALL_1(iemOp_fucom_stN, bRm); 10830 case 5: return FNIEMOP_CALL_1(iemOp_fucomp_stN, bRm); 10831 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 10832 case 7: return IEMOP_RAISE_INVALID_OPCODE(); 10833 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10834 } 10835 } 10836 else 10837 { 10838 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 10839 { 10840 case 0: return FNIEMOP_CALL_1(iemOp_fld_m64r, bRm); 10841 case 1: return FNIEMOP_CALL_1(iemOp_fisttp_m64i, bRm); 10842 case 2: return FNIEMOP_CALL_1(iemOp_fst_m64r, bRm); 10843 case 3: return FNIEMOP_CALL_1(iemOp_fstp_m64r, bRm); 10844 case 4: return FNIEMOP_CALL_1(iemOp_frstor, bRm); 10845 case 5: return IEMOP_RAISE_INVALID_OPCODE(); 10846 case 6: return FNIEMOP_CALL_1(iemOp_fnsave, bRm); 10847 case 7: return FNIEMOP_CALL_1(iemOp_fnstsw, bRm); 10599 10848 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 10600 10849 } -
trunk/src/VBox/VMM/include/IEMInternal.h
r40077 r40082 244 244 /** The opcode bytes. */ 245 245 uint8_t abOpcode[15]; 246 /** Offset into abOpcodes where the FPU instruction starts. 247 * Only set by the FPU escape opcodes (0xd8-0xdf) and used later on when the 248 * instruction result is committed. */ 249 uint8_t offFpuOpcode; 246 250 247 251 /** @}*/ 248 252 249 253 /** Alignment padding for aMemMappings. */ 250 uint8_t abAlignment2[ 5];254 uint8_t abAlignment2[4]; 251 255 252 256 /** The number of active guest memory mappings. */ -
trunk/src/VBox/VMM/testcase/tstX86-1.cpp
r40057 r40082 239 239 if (rc != 0) 240 240 RTTestFailed(hTest, "x861_Test4 -> %d", rc); 241 #endif 241 242 242 243 RTTestSub(hTest, "Odd floating point encodings"); … … 244 245 if (rc != 0) 245 246 RTTestFailed(hTest, "x861_Test5 -> %d", rc); 246 #endif247 247 248 248 RTTestSub(hTest, "Floating point exceptions ++"); -
trunk/src/VBox/VMM/testcase/tstX86-1A.asm
r40070 r40082 1366 1366 fld tword REF(.r80V1) 1367 1367 1368 ; the 0xd9 block 1368 1369 ShouldTrap X86_XCPT_UD, db 0d9h, 008h 1369 1370 ShouldTrap X86_XCPT_UD, db 0d9h, 009h … … 1395 1396 ShouldTrap X86_XCPT_UD, db 0d9h, 0e7h 1396 1397 ShouldTrap X86_XCPT_UD, db 0d9h, 0efh 1398 ShouldTrap X86_XCPT_UD, db 0d9h, 008h 1399 ShouldTrap X86_XCPT_UD, db 0d9h, 00fh 1400 1401 ; the 0xda block 1402 ShouldTrap X86_XCPT_UD, db 0dah, 0e0h 1403 ShouldTrap X86_XCPT_UD, db 0dah, 0e1h 1404 ShouldTrap X86_XCPT_UD, db 0dah, 0e2h 1405 ShouldTrap X86_XCPT_UD, db 0dah, 0e3h 1406 ShouldTrap X86_XCPT_UD, db 0dah, 0e4h 1407 ShouldTrap X86_XCPT_UD, db 0dah, 0e5h 1408 ShouldTrap X86_XCPT_UD, db 0dah, 0e6h 1409 ShouldTrap X86_XCPT_UD, db 0dah, 0e7h 1410 ShouldTrap X86_XCPT_UD, db 0dah, 0e8h 1411 ShouldTrap X86_XCPT_UD, db 0dah, 0eah 1412 ShouldTrap X86_XCPT_UD, db 0dah, 0ebh 1413 ShouldTrap X86_XCPT_UD, db 0dah, 0ech 1414 ShouldTrap X86_XCPT_UD, db 0dah, 0edh 1415 ShouldTrap X86_XCPT_UD, db 0dah, 0eeh 1416 ShouldTrap X86_XCPT_UD, db 0dah, 0efh 1417 ShouldTrap X86_XCPT_UD, db 0dah, 0f0h 1418 ShouldTrap X86_XCPT_UD, db 0dah, 0f1h 1419 ShouldTrap X86_XCPT_UD, db 0dah, 0f2h 1420 ShouldTrap X86_XCPT_UD, db 0dah, 0f3h 1421 ShouldTrap X86_XCPT_UD, db 0dah, 0f4h 1422 ShouldTrap X86_XCPT_UD, db 0dah, 0f5h 1423 ShouldTrap X86_XCPT_UD, db 0dah, 0f6h 1424 ShouldTrap X86_XCPT_UD, db 0dah, 0f7h 1425 ShouldTrap X86_XCPT_UD, db 0dah, 0f8h 1426 ShouldTrap X86_XCPT_UD, db 0dah, 0f9h 1427 ShouldTrap X86_XCPT_UD, db 0dah, 0fah 1428 ShouldTrap X86_XCPT_UD, db 0dah, 0fbh 1429 ShouldTrap X86_XCPT_UD, db 0dah, 0fch 1430 ShouldTrap X86_XCPT_UD, db 0dah, 0fdh 1431 ShouldTrap X86_XCPT_UD, db 0dah, 0feh 1432 ShouldTrap X86_XCPT_UD, db 0dah, 0ffh 1433 1434 ; the 0xdb block 1435 db 0dbh, 0e0h ; fneni 1436 db 0dbh, 0e1h ; fndisi 1437 db 0dbh, 0e4h ; fnsetpm 1438 ShouldTrap X86_XCPT_UD, db 0dbh, 0e5h 1439 ShouldTrap X86_XCPT_UD, db 0dbh, 0e6h 1440 ShouldTrap X86_XCPT_UD, db 0dbh, 0e7h 1441 ShouldTrap X86_XCPT_UD, db 0dbh, 0f8h 1442 ShouldTrap X86_XCPT_UD, db 0dbh, 0f9h 1443 ShouldTrap X86_XCPT_UD, db 0dbh, 0fah 1444 ShouldTrap X86_XCPT_UD, db 0dbh, 0fbh 1445 ShouldTrap X86_XCPT_UD, db 0dbh, 0fch 1446 ShouldTrap X86_XCPT_UD, db 0dbh, 0fdh 1447 ShouldTrap X86_XCPT_UD, db 0dbh, 0feh 1448 ShouldTrap X86_XCPT_UD, db 0dbh, 0ffh 1449 ShouldTrap X86_XCPT_UD, db 0dbh, 020h 1450 ShouldTrap X86_XCPT_UD, db 0dbh, 023h 1451 ShouldTrap X86_XCPT_UD, db 0dbh, 030h 1452 ShouldTrap X86_XCPT_UD, db 0dbh, 032h 1453 1454 ; the 0xdd block 1455 db 0ddh, 0c0h ; fnop? 1456 db 0ddh, 0c1h ; fnop? 1457 db 0ddh, 0c2h ; fnop? 1458 db 0ddh, 0c3h ; fnop? 1459 db 0ddh, 0c4h ; fnop? 1460 db 0ddh, 0c5h ; fnop? 1461 db 0ddh, 0c6h ; fnop? 1462 db 0ddh, 0c7h ; fnop? 1463 ShouldTrap X86_XCPT_UD, db 0ddh, 0f0h 1464 ShouldTrap X86_XCPT_UD, db 0ddh, 0f1h 1465 ShouldTrap X86_XCPT_UD, db 0ddh, 0f2h 1466 ShouldTrap X86_XCPT_UD, db 0ddh, 0f3h 1467 ShouldTrap X86_XCPT_UD, db 0ddh, 0f4h 1468 ShouldTrap X86_XCPT_UD, db 0ddh, 0f5h 1469 ShouldTrap X86_XCPT_UD, db 0ddh, 0f6h 1470 ShouldTrap X86_XCPT_UD, db 0ddh, 0f7h 1471 ShouldTrap X86_XCPT_UD, db 0ddh, 0f8h 1472 ShouldTrap X86_XCPT_UD, db 0ddh, 0f9h 1473 ShouldTrap X86_XCPT_UD, db 0ddh, 0fah 1474 ShouldTrap X86_XCPT_UD, db 0ddh, 0fbh 1475 ShouldTrap X86_XCPT_UD, db 0ddh, 0fch 1476 ShouldTrap X86_XCPT_UD, db 0ddh, 0fdh 1477 ShouldTrap X86_XCPT_UD, db 0ddh, 0feh 1478 ShouldTrap X86_XCPT_UD, db 0ddh, 0ffh 1479 ShouldTrap X86_XCPT_UD, db 0ddh, 028h 1480 ShouldTrap X86_XCPT_UD, db 0ddh, 02fh 1397 1481 1398 1482
Note:
See TracChangeset
for help on using the changeset viewer.