- Timestamp:
- Apr 5, 2024 2:45:23 PM (10 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl-arm64.S
r104173 r104195 191 191 */ 192 192 193 /* void iemAImpl_cmp_u8(uint8_t const *puDst, uint8_t uSrc, uint32_t *pEFlags); */193 /* uint32_t iemAImpl_cmp_u8(uint32_t fEFlags, uint8_t const *puDst, uint8_t uSrc); */ 194 194 .p2align 2 195 195 .private_extern NAME(iemAImpl_sub_u8) … … 198 198 .cfi_startproc 199 199 /* Do the subtraction. */ 200 ldrb w8, [x0] 201 /*and w1, w1, #0xff - should not be necessary. */ 202 subs w9, w8, w1 /* w9 = w8 (*puDst) - w1 (uSrc) */ 200 ldrb w8, [x1] 201 /*and w2, w2, #0xff - should not be necessary. */ 202 subs w9, w8, w2 /* w9 = w8 (*puDst) - w2 (uSrc) */ 203 strb w9, [x1] 203 204 setf8 w9 204 strb w9, [x0] 205 206 /* Load EFLAGS. */ 207 ldr w10, [x2] /* w10 = eflags; CF=0 PF=2 AF=4 ZF=6 SF=7 OF=11 */ 205 206 /* Calculate EFLAGS (passed in and returned via x0). */ 208 207 and w9, w9, #0xffff 209 CALC_EFLAGS x 10, x9, x8, x1, x11, X86_EFL_OF208 CALC_EFLAGS x0, x9, x8, x2, x11, X86_EFL_OF 210 209 211 210 /* The overflow flag calc done by setf16 isn't correct for subtraction, so we have to 212 211 figure it out ourselves. (See IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC for details.) */ 213 eor w11, w8, w 1/* input dst ^ source (simplified from ~(dst ^ (source ^ 0x8000)) ). */212 eor w11, w8, w2 /* input dst ^ source (simplified from ~(dst ^ (source ^ 0x8000)) ). */ 214 213 eor w12, w8, w9 215 214 and w11, w12, w11 216 215 lsr w11, w11, #7 217 bfi w10, w11, #X86_EFL_OF_BIT, #1 218 219 /* Done with EFLAGS. */ 220 str w10, [x2] 221 ret 222 .cfi_endproc 223 224 225 /* void iemAImpl_cmp_u16(uint16_t const *puDst, uint16_t uSrc, uint32_t *pEFlags); */ 216 bfi w0, w11, #X86_EFL_OF_BIT, #1 217 218 ret 219 .cfi_endproc 220 221 222 /* uint32_t iemAImpl_cmp_u16(uint32_t fEFlags, uint16_t const *puDst, uint16_t uSrc); */ 226 223 .p2align 2 227 224 .private_extern NAME(iemAImpl_sub_u16) … … 230 227 .cfi_startproc 231 228 /* Do the subtraction. */ 232 ldrh w8, [x 0]233 /*and w 1, w1, #0xffff - should not be necessary. */234 subs w9, w8, w 1 /* w9 = w8 (*puDst) - w1(uSrc) */229 ldrh w8, [x1] 230 /*and w2, w2, #0xffff - should not be necessary. */ 231 subs w9, w8, w2 /* w9 = w8 (*puDst) - w2 (uSrc) */ 235 232 setf16 w9 236 strh w9, [x0] 237 238 /* Load EFLAGS. */ 239 ldr w10, [x2] /* w10 = eflags; CF=0 PF=2 AF=4 ZF=6 SF=7 OF=11 */ 233 strh w9, [x1] 234 235 /* Calculate EFLAGS (passed in and returned via x0). */ 240 236 and w9, w9, #0xffff 241 CALC_EFLAGS x 10, x9, x8, x1, x11, X86_EFL_OF237 CALC_EFLAGS x0, x9, x8, x2, x11, X86_EFL_OF 242 238 243 239 /* The overflow flag calc done by setf16 isn't correct for subtraction, so we have to 244 240 figure it out ourselves. (See IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC for details.) */ 245 eor w11, w8, w 1/* input dst ^ source (simplified from ~(dst ^ (source ^ 0x8000)) ). */241 eor w11, w8, w2 /* input dst ^ source (simplified from ~(dst ^ (source ^ 0x8000)) ). */ 246 242 eor w12, w8, w9 247 243 and w11, w12, w11 248 244 lsr w11, w11, #15 249 bfi w10, w11, #X86_EFL_OF_BIT, #1 250 251 /* Done with EFLAGS. */ 252 str w10, [x2] 253 ret 254 .cfi_endproc 255 256 257 /* void iemAImpl_cmp_u32(uint32_t const *puDst, uint32_t uSrc, uint32_t *pEFlags); */ 245 bfi w0, w11, #X86_EFL_OF_BIT, #1 246 247 ret 248 .cfi_endproc 249 250 251 /* uint32_t iemAImpl_cmp_u32(uint32_t fEFlags, uint32_t const *puDst, uint32_t uSrc); */ 258 252 .p2align 2 259 253 .private_extern NAME(iemAImpl_sub_u32) … … 262 256 .cfi_startproc 263 257 /* Do the subtraction. */ 264 ldr w8, [x0] 265 subs w9, w8, w1 /* w9 = w8 (*puDst) - w1 (uSrc) */ 266 str w9, [x0] 267 268 /* Load EFLAGS. */ 269 ldr w10, [x2] /* w10 = eflags; CF=0 PF=2 AF=4 ZF=6 SF=7 OF=11 */ 258 ldr w8, [x1] 259 subs w9, w8, w2 /* w9 = w8 (*puDst) - w2 (uSrc) */ 260 str w9, [x1] 261 262 /* Calculate EFLAGS (passed in and returned via x0). */ 270 263 271 264 #if 0 … … 274 267 mrs x11, NZCV /* w11[31] = N; w11[30] = Z; w11[29] = C; w11[29] = V */ 275 268 lsr w11, w11, #28 276 bfi w 10, w11, #X86_EFL_OF_BIT, #1269 bfi w0, w11, #X86_EFL_OF_BIT, #1 277 270 lsr w11, w11, #1 278 271 eor w11, w11, #1 /* inverts the carry flag to x86 style. */ 279 bfi w 10, w11, #X86_EFL_CF_BIT, #1/* CF(0) = C */272 bfi w0, w11, #X86_EFL_CF_BIT, #1 /* CF(0) = C */ 280 273 lsr w11, w11, #1 281 bfi w 10, w11, #X86_EFL_ZF_BIT, #2/* SF(7),ZF(6) = NZ */274 bfi w0, w11, #X86_EFL_ZF_BIT, #2 /* SF(7),ZF(6) = NZ */ 282 275 #elif 1 /* seems the faster one... */ 283 276 cfinv 284 277 mrs x11, NZCV /* w11[31] = N; w11[30] = Z; w11[29] = C; w11[29] = V */ 285 278 lsr w11, w11, #28 286 bfi w 10, w11, #X86_EFL_OF_BIT, #1279 bfi w0, w11, #X86_EFL_OF_BIT, #1 287 280 lsr w11, w11, #1 288 bfi w 10, w11, #X86_EFL_CF_BIT, #1/* CF(0) = C */281 bfi w0, w11, #X86_EFL_CF_BIT, #1 /* CF(0) = C */ 289 282 lsr w11, w11, #1 290 bfi w 10, w11, #X86_EFL_ZF_BIT, #2/* SF(7),ZF(6) = NZ */283 bfi w0, w11, #X86_EFL_ZF_BIT, #2 /* SF(7),ZF(6) = NZ */ 291 284 #else 292 285 cset w11, eq 293 bfi w 10, w11, #X86_EFL_ZF_BIT, #1286 bfi w0, w11, #X86_EFL_ZF_BIT, #1 294 287 cset w11, cc 295 bfi w 10, w11, #X86_EFL_CF_BIT, #1288 bfi w0, w11, #X86_EFL_CF_BIT, #1 296 289 cset w11, vs 297 bfi w 10, w11, #X86_EFL_OF_BIT, #1290 bfi w0, w11, #X86_EFL_OF_BIT, #1 298 291 cset w11, mi 299 bfi w 10, w11, #X86_EFL_SF_BIT, #1292 bfi w0, w11, #X86_EFL_SF_BIT, #1 300 293 #endif 301 294 … … 305 298 eor w11, w11, w11, LSR #1 306 299 eor w11, w11, #1 307 bfi w 10, w11, #X86_EFL_PF_BIT, #1/* PF(2) = popcount(w9 & 0xff) & 1 ^ 1 */300 bfi w0, w11, #X86_EFL_PF_BIT, #1 /* PF(2) = popcount(w9 & 0xff) & 1 ^ 1 */ 308 301 309 302 /* Auxilary carry / borrow flag. This is related to 8-bit BCD. */ 310 eor w11, w8, w 1303 eor w11, w8, w2 311 304 eor w11, w11, w9 312 305 lsr w11, w11, #X86_EFL_AF_BIT 313 bfi w 10, w11, #X86_EFL_AF_BIT, #1 /* AF(4) = (w8 ^ w1^ w9 & X86_EFL_AF) >> X86_EFL_AF_BIT */306 bfi w0, w11, #X86_EFL_AF_BIT, #1 /* AF(4) = (w8 ^ w2 ^ w9 & X86_EFL_AF) >> X86_EFL_AF_BIT */ 314 307 #else 315 CALC_EFLAGS x 10, x9, x8, x1, x11308 CALC_EFLAGS x0, x9, x8, x2, x11 316 309 #endif 317 310 318 str w10, [x2] 319 ret 320 .cfi_endproc 321 322 323 /* void iemAImpl_cmp_u64(uint64_t const *puDst, uint64_t uSrc, uint32_t *pEFlags); */ 311 ret 312 .cfi_endproc 313 314 315 /* uint32_t iemAImpl_cmp_u64(uint32_t fEFlags, uint64_t const *puDst, uint64_t uSrc); */ 324 316 .p2align 2 325 317 .private_extern NAME(iemAImpl_sub_u64) … … 328 320 .cfi_startproc 329 321 /* Do the subtraction. */ 330 ldr x8, [x0] 331 subs x9, x8, x1 /* x9 = x8 (*puDst) - x1 (uSrc) */ 332 str x9, [x0] 333 334 /* Load EFLAGS. */ 335 ldr w10, [x2] /* w10 = eflags; CF=0 PF=2 AF=4 ZF=6 SF=7 OF=11 */ 336 CALC_EFLAGS x10, x9, x8, x1, x11 337 338 str w10, [x2] 322 ldr x8, [x1] 323 subs x9, x8, x2 /* x9 = x8 (*puDst) - x2 (uSrc) */ 324 str x9, [x1] 325 326 /* Calculate EFLAGS (passed in and returned via x0). */ 327 CALC_EFLAGS x0, x9, x8, x2, x11 328 339 329 ret 340 330 .cfi_endproc -
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r104188 r104195 41 41 ;; 42 42 ; This is handy for generating absolutly correct EFLAGS. 43 %define IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS43 ;%define IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 44 44 45 45 … … 291 291 ; 292 292 ; @remarks Clobbers T0, stack. Changes EFLAGS. 293 ; @param 1 The parameter (A0..A3) holding the eflags value. 294 ; @param 2 The set of modified flags. 295 ; @param 3 The set of undefined flags. 296 ; @param 4 The flags that must be loaded. 297 ; 298 %macro IEM_MAYBE_LOAD_FLAGS 4 299 %ifdef IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 300 pushf ; store current flags 301 mov T0_32, %1 ; load the guest flags 302 and dword [xSP], ~(%2 | %3 | X86_EFL_STATUS_BITS) ; mask out the modified and undefined flags 303 and T0_32, (%2 | %3 | X86_EFL_STATUS_BITS) ; select the modified and undefined flags. 304 or [xSP], T0 ; merge guest flags with host flags. 305 popf ; load the mixed flags. 306 307 %elif (%3 + %4) != 0 308 %if 1 ; This approach seems faster on intel 10980XE 309 %if (%3 | %4) == X86_EFL_CF 310 ; Use bt to load bit into CF 311 bt %1, X86_EFL_CF_BIT 312 %else 313 ; Use ADD to set OF and SHAF for the rest. ASSUMES T0_32 is eax! 314 mov eax, %1 315 %if (%3 | %4) == X86_EFL_OF 316 ; Use ADD to set OF. 317 shl eax, 31 - X86_EFL_OF_BIT 318 add eax, 80000000h 319 %elif ((%3 | %4) & X86_EFL_OF) != 0 320 ; Use ADD to set OF. 321 xchg al, ah 322 shl al, 15 - X86_EFL_OF_BIT 323 add al, 80h 324 ; Use SAHF to set the other status flags. 325 sahf 326 %else ; OF not needed; so al -> ah and load ah into eflags. 327 %if 1 ; Pretty similar on 10980XE, but shl seems faster on average. 328 shl eax, 8 329 %else 330 xchg al, ah 331 %endif 332 sahf 333 %endif 334 %endif 335 336 %else 337 pushf ; store current flags 338 mov T0_32, %1 ; load the guest flags 339 and dword [xSP], ~(%2 | %3) ; mask out the modified and undefined flags 340 and T0_32, (%2 | %3) ; select the modified and undefined flags. 341 or [xSP], T0 ; merge guest flags with host flags. 342 popf ; load the mixed flags. 343 %endif 344 %endif 345 %endmacro 346 347 ;; 348 ; Load the relevant flags from [%1]. 349 ; 350 ; @remarks Clobbers T0, stack. Changes EFLAGS. 351 ; @param 1 The parameter (A0..A3) holding the eflags value. 352 ; @param 2 The set of flags to load. 353 ; @param 3 The set of undefined flags. 354 ; 355 %macro IEM_LOAD_FLAGS 3 356 %ifdef IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 357 pushf ; store current flags 358 mov T0_32, %1 ; load the guest flags 359 and dword [xSP], ~(%2 | %3 | X86_EFL_STATUS_BITS) ; mask out the modified, undefined and status flags 360 and T0_32, (%2 | %3 | X86_EFL_STATUS_BITS) ; select the modified, undefined and status flags. 361 or [xSP], T0 ; merge guest flags with host flags. 362 popf ; load the mixed flags. 363 364 %elif 1 ; This approach seems faster on intel 10980XE 365 %if (%3 | %2) == X86_EFL_CF 366 ; Use bt to load bit into CF 367 bt %1, X86_EFL_CF_BIT 368 %else 369 mov eax, %1 ; ASSUMES T0_32 is eax!! 370 %if (%3 | %2) == X86_EFL_OF 371 ; Use ADD to set OF. 372 shl eax, 31 - X86_EFL_OF_BIT 373 add eax, 80000000h 374 %elif ((%3 | %2) & X86_EFL_OF) != 0 375 ; Use ADD to set OF. 376 xchg al, ah 377 shl al, 15 - X86_EFL_OF_BIT 378 add al, 80h 379 ; Use SAHF to set the other status flags. 380 sahf 381 %else ; OF not needed; so al -> ah and load ah into eflags. 382 %if 1 ; Pretty similar on 10980XE, but shl seems faster on average. 383 shl eax, 8 384 %else 385 xchg al, ah 386 %endif 387 sahf 388 %endif 389 %endif ; (%3 | %2) != X86_EFL_CF 390 391 %else 392 pushf ; store current flags 393 mov T0_32, %1 ; load the guest flags 394 and dword [xSP], ~(%2 | %3) ; mask out the modified and undefined flags 395 and T0_32, (%2 | %3) ; select the modified and undefined flags. 396 or [xSP], T0 ; merge guest flags with host flags. 397 popf ; load the mixed flags. 398 %endif 399 %endmacro 400 401 ;; 402 ; Merge incoming guest EFLAGS (%1) with host EFLAGS into EAX (T0). 403 ; 404 ; @remarks Clobbers T0, T1, %1, stack. 405 ; @param 1 The parameter (A0..A3) holding the OLD eflags value. Clobbered. 406 ; @param 2 The mask of modified flags to save. 407 ; @param 3 The mask of undefined flags to (maybe) save. 408 ; @param 4 The mask of flags that are zeroed (and thus doesn't require loading, just clearing) 409 ; 410 %macro IEM_SAVE_FLAGS_RETVAL 4 0 411 %if (%2 | %3 | %4) != 0 412 mov T1_32, %1 ; flags 413 %ifdef IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 414 pushf 415 pop T0 416 and %1, ~(%2 | %3 | %4 | X86_EFL_STATUS_BITS) ; clear the modified & undefined & zeroed & status flags. 417 and T0_32, (%2 | %3 | X86_EFL_STATUS_BITS) ; select the modified, undefined and status flags. 418 %else 419 %if (%2 | %3 | %4) == X86_EFL_CF 420 setc T0_8 421 %elif (%2 | %3) == X86_EFL_OF 422 seto T0_8 423 shl T0_32, X86_EFL_OF_BIT 424 %elif (%2 | %3) == X86_EFL_ZF 425 setz T0_8 ; On 10980XE this is faster than the next option 5596 vs 5936 ps/call (cmpxchg8b-positive). 426 shl T0_32, X86_EFL_ZF_BIT 427 %elif (%2 | %3) <= 0xff 428 lahf 429 movzx eax, ah ; ASSUMES T0_32 is eax! 430 %elif 1 ; The locked functions are generally faster on 10980XE with this approach 431 lahf ; while there seems only to be a tiny advantage in most other test. 432 movzx eax, ah ; ASSUMES T0_32 is eax! 433 jno .of_is_clear 434 or eax, X86_EFL_OF 435 .of_is_clear: 436 %else 437 pushf ; this is a bit slow 438 pop T0 439 %endif 440 and %1, ~(%2 | %3 | %4) ; clear the modified & undefined & zeroed flags. 441 and T0_32, (%2 | %3) ; select the modified and undefined flags. 442 %endif 443 or T0_32, %1 ; combine the flags. ASSUMES T0 = eax! 444 ;mov %1, T0_32 ; save the flags. 445 %endif 446 %endmacro 447 448 ;; 449 ; Calculates the new EFLAGS based on the CPU EFLAGS and fixed clear and set bit masks. 450 ; 451 ; @remarks Clobbers T0, T1, stack. 452 ; @param 1 The parameter (A0..A3) holding the eflags value. 453 ; @param 2 The mask of modified flags to save. 454 ; @param 3 Mask of additional flags to always clear 455 ; @param 4 Mask of additional flags to always set. 456 ; 457 ;; @todo make it stuff the result into EAX? 458 %macro IEM_SAVE_AND_ADJUST_FLAGS 4 459 %if (%2 | %3 | %4) != 0 460 pushf 461 pop T1 462 mov T0_32, %1 ; load flags. 463 and T0_32, ~(%2 | %3) ; clear the modified and always cleared flags. 464 and T1_32, (%2) ; select the modified flags. 465 or T0_32, T1_32 ; combine the flags. 466 %if (%4) != 0 467 or T0_32, %4 ; add the always set flags. 468 %endif 469 mov %1, T0_32 ; save the result. 470 %endif 471 %endmacro 472 473 ;; 474 ; Calculates the new EFLAGS based on the CPU EFLAGS (%2), a clear mask (%3), 475 ; signed input (%4[%5]) and parity index (%6). 476 ; 477 ; This is used by MUL and IMUL, where we got result (%4 & %6) in xAX which is 478 ; also T0. So, we have to use T1 for the EFLAGS calculation and save T0/xAX 479 ; while we extract the %2 flags from the CPU EFLAGS or use T2 (only AMD64). 480 ; 481 ; @remarks Clobbers T0, T1, stack, %6, EFLAGS. 482 ; @param 1 The parameter (A0..A3) holding the eflags value. 483 ; @param 2 The mask of modified flags to save. 484 ; @param 3 Mask of additional flags to always clear 485 ; @param 4 The result register to set SF by. 486 ; @param 5 The width of the %4 register in bits (8, 16, 32, or 64). 487 ; @param 6 The (full) register containing the parity table index. Will be modified! 488 489 %macro IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF 6 490 %ifdef RT_ARCH_AMD64 491 pushf 492 pop T2 493 %else 494 push T0 495 pushf 496 pop T0 497 %endif 498 mov T1_32, %1 ; load flags. 499 and T1_32, ~(%2 | %3 | X86_EFL_PF | X86_EFL_SF) ; clear the modified, always cleared flags and the two flags we calc. 500 %ifdef RT_ARCH_AMD64 501 and T2_32, (%2) ; select the modified flags. 502 or T1_32, T2_32 ; combine the flags. 503 %else 504 and T0_32, (%2) ; select the modified flags. 505 or T1_32, T0_32 ; combine the flags. 506 pop T0 507 %endif 508 509 ; First calculate SF as it's likely to be refereing to the same register as %6 does. 510 bt %4, %5 - 1 511 jnc %%sf_clear 512 or T1_32, X86_EFL_SF 513 %%sf_clear: 514 515 ; Parity last. 516 and %6, 0xff 517 %ifdef RT_ARCH_AMD64 518 lea T2, [NAME(g_afParity) xWrtRIP] 519 or T1_8, [T2 + %6] 520 %else 521 or T1_8, [NAME(g_afParity) + %6] 522 %endif 523 524 mov %1, T1_32 ; save the result. 525 %endmacro 526 527 ;; 528 ; Calculates the new EFLAGS using fixed clear and set bit masks. 529 ; 530 ; @remarks Clobbers T0. 531 ; @param 1 The parameter (A0..A3) holding the eflags value. 532 ; @param 2 Mask of additional flags to always clear 533 ; @param 3 Mask of additional flags to always set. 534 ; 535 %macro IEM_ADJUST_FLAGS 3 536 %if (%2 | %3) != 0 537 mov T0_32, %1 ; Load flags. 538 %if (%2) != 0 539 and T0_32, ~(%2) ; Remove the always cleared flags. 540 %endif 541 %if (%3) != 0 542 or T0_32, %3 ; Add the always set flags. 543 %endif 544 mov %1, T0_32 ; Save the result. 545 %endif 546 %endmacro 547 548 ;; 549 ; Calculates the new EFLAGS using fixed clear and set bit masks. 550 ; 551 ; @remarks Clobbers T0, %4, EFLAGS. 552 ; @param 1 The parameter (A0..A3) holding the eflags value. 553 ; @param 2 Mask of additional flags to always clear 554 ; @param 3 Mask of additional flags to always set. 555 ; @param 4 The (full) register containing the parity table index. Will be modified! 556 ; 557 %macro IEM_ADJUST_FLAGS_WITH_PARITY 4 558 mov T0_32, %1 ; Load flags. 559 and T0_32, ~(%2 | X86_EFL_PF) ; Remove PF and the always cleared flags. 560 %if (%3) != 0 561 or T0_32, %3 ; Add the always set flags. 562 %endif 563 and %4, 0xff 564 %ifdef RT_ARCH_AMD64 565 lea T2, [NAME(g_afParity) xWrtRIP] 566 or T0_8, [T2 + %4] 567 %else 568 or T0_8, [NAME(g_afParity) + %4] 569 %endif 570 mov %1, T0_32 ; Save the result. 571 %endmacro 572 573 574 ;;;; OLD EFLAGS macros. 575 ;;;; OLD EFLAGS macros. 576 ;;;; OLD EFLAGS macros. 577 ;;;; OLD EFLAGS macros. 578 ;;;; OLD EFLAGS macros. 579 580 ;; 581 ; Load the relevant flags from [%1] if there are undefined flags (%3). 582 ; 583 ; @remarks Clobbers T0, stack. Changes EFLAGS. 293 584 ; @param 1 The parameter (A0..A3) pointing to the eflags. 294 585 ; @param 2 The set of modified flags. … … 296 587 ; @param 4 The flags that must be loaded. 297 588 ; 298 %macro IEM_MAYBE_LOAD_FLAGS 4589 %macro IEM_MAYBE_LOAD_FLAGS_OLD 4 299 590 %ifdef IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 300 591 pushf ; store current flags … … 353 644 ; @param 3 The set of undefined flags. 354 645 ; 355 %macro IEM_LOAD_FLAGS 3646 %macro IEM_LOAD_FLAGS_OLD 3 356 647 %ifdef IEM_AIMPL_WITH_LOAD_AND_SAVE_ALL_STATUS_FLAGS 357 648 pushf ; store current flags … … 408 699 ; @param 4 The mask of flags that are zeroed (and thus doesn't require loading, just clearing) 409 700 ; 410 %macro IEM_SAVE_FLAGS 4 0701 %macro IEM_SAVE_FLAGS_OLD 4 0 411 702 %if (%2 | %3 | %4) != 0 412 703 mov T1_32, [%1] ; flags … … 455 746 ; @param 4 Mask of additional flags to always set. 456 747 ; 457 %macro IEM_SAVE_AND_ADJUST_FLAGS 4748 %macro IEM_SAVE_AND_ADJUST_FLAGS_OLD 4 458 749 %if (%2 | %3 | %4) != 0 459 750 pushf … … 486 777 ; @param 6 The (full) register containing the parity table index. Will be modified! 487 778 488 %macro IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF 6779 %macro IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD 6 489 780 %ifdef RT_ARCH_AMD64 490 781 pushf … … 532 823 ; @param 3 Mask of additional flags to always set. 533 824 ; 534 %macro IEM_ADJUST_FLAGS 3825 %macro IEM_ADJUST_FLAGS_OLD 3 535 826 %if (%2 | %3) != 0 536 827 mov T0_32, [%1] ; Load flags. … … 554 845 ; @param 4 The (full) register containing the parity table index. Will be modified! 555 846 ; 556 %macro IEM_ADJUST_FLAGS_WITH_PARITY 4847 %macro IEM_ADJUST_FLAGS_WITH_PARITY_OLD 4 557 848 mov T0_32, [%1] ; Load flags. 558 849 and T0_32, ~(%2 | X86_EFL_PF) ; Remove PF and the always cleared flags. … … 569 860 mov [%1], T0_32 ; Save the result. 570 861 %endmacro 862 571 863 572 864 … … 676 968 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8, 12 677 969 PROLOGUE_3_ARGS 678 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5679 %1 byte [A 0], A1_8680 IEM_SAVE_FLAGS A2, %3, %4, %6970 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 971 %1 byte [A1], A2_8 972 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 681 973 EPILOGUE_3_ARGS 682 974 ENDPROC iemAImpl_ %+ %1 %+ _u8 … … 684 976 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 685 977 PROLOGUE_3_ARGS 686 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5687 %1 word [A 0], A1_16688 IEM_SAVE_FLAGS A2, %3, %4, %6978 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 979 %1 word [A1], A2_16 980 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 689 981 EPILOGUE_3_ARGS 690 982 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 692 984 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 693 985 PROLOGUE_3_ARGS 694 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5695 %1 dword [A 0], A1_32696 IEM_SAVE_FLAGS A2, %3, %4, %6986 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 987 %1 dword [A1], A2_32 988 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 697 989 EPILOGUE_3_ARGS 698 990 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 701 993 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 16 702 994 PROLOGUE_3_ARGS 703 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5704 %1 qword [A 0], A1705 IEM_SAVE_FLAGS A2, %3, %4, %6995 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 996 %1 qword [A1], A2 997 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 706 998 EPILOGUE_3_ARGS_EX 8 707 999 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 712 1004 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8_locked, 12 713 1005 PROLOGUE_3_ARGS 714 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5715 lock %1 byte [A 0], A1_8716 IEM_SAVE_FLAGS A2, %3, %4, %61006 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 1007 lock %1 byte [A1], A2_8 1008 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 717 1009 EPILOGUE_3_ARGS 718 1010 ENDPROC iemAImpl_ %+ %1 %+ _u8_locked … … 720 1012 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16_locked, 12 721 1013 PROLOGUE_3_ARGS 722 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5723 lock %1 word [A 0], A1_16724 IEM_SAVE_FLAGS A2, %3, %4, %61014 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 1015 lock %1 word [A1], A2_16 1016 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 725 1017 EPILOGUE_3_ARGS 726 1018 ENDPROC iemAImpl_ %+ %1 %+ _u16_locked … … 728 1020 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32_locked, 12 729 1021 PROLOGUE_3_ARGS 730 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5731 lock %1 dword [A 0], A1_32732 IEM_SAVE_FLAGS A2, %3, %4, %61022 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 1023 lock %1 dword [A1], A2_32 1024 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 733 1025 EPILOGUE_3_ARGS 734 1026 ENDPROC iemAImpl_ %+ %1 %+ _u32_locked … … 737 1029 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64_locked, 16 738 1030 PROLOGUE_3_ARGS 739 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, %5740 lock %1 qword [A 0], A1741 IEM_SAVE_FLAGS A2, %3, %4, %61031 IEM_MAYBE_LOAD_FLAGS A0_32, %3, %4, %5 1032 lock %1 qword [A1], A2 1033 IEM_SAVE_FLAGS_RETVAL A0_32, %3, %4, %6 742 1034 EPILOGUE_3_ARGS_EX 8 743 1035 ENDPROC iemAImpl_ %+ %1 %+ _u64_locked … … 776 1068 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 16 777 1069 PROLOGUE_4_ARGS 778 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, 0 ;; @todo do we need to load undefined flags for any platform?1070 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, 0 ;; @todo do we need to load undefined flags for any platform? 779 1071 %1 T0_32, A1_32, A2_32 780 1072 mov [A0], T0_32 781 IEM_SAVE_FLAGS A3, %2, %3, %41073 IEM_SAVE_FLAGS_OLD A3, %2, %3, %4 782 1074 EPILOGUE_4_ARGS 783 1075 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 786 1078 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 16 787 1079 PROLOGUE_4_ARGS 788 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, 01080 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, 0 789 1081 %1 T0, A1, A2 790 1082 mov [A0], T0 791 IEM_SAVE_FLAGS A3, %2, %3, %41083 IEM_SAVE_FLAGS_OLD A3, %2, %3, %4 792 1084 EPILOGUE_4_ARGS 793 1085 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 817 1109 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 818 1110 PROLOGUE_4_ARGS 819 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, 0 ;; @todo check if any undefined flags are passed thru1111 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, 0 ;; @todo check if any undefined flags are passed thru 820 1112 mov T0_32, [A0] 821 1113 %1 T0_32, A1_32 822 1114 mov [A0], T0_32 823 IEM_SAVE_FLAGS A2, %2, %3, %41115 IEM_SAVE_FLAGS_OLD A2, %2, %3, %4 824 1116 EPILOGUE_4_ARGS 825 1117 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 828 1120 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 12 829 1121 PROLOGUE_4_ARGS 830 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, 01122 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, 0 831 1123 mov T0, [A0] 832 1124 %1 T0, A1 833 1125 mov [A0], T0 834 IEM_SAVE_FLAGS A2, %2, %3, %41126 IEM_SAVE_FLAGS_OLD A2, %2, %3, %4 835 1127 EPILOGUE_4_ARGS 836 1128 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 1052 1344 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 1053 1345 PROLOGUE_3_ARGS 1054 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01346 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1055 1347 %1 word [A0], A1_16 1056 IEM_SAVE_FLAGS A2, %3, %4, 01348 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1057 1349 EPILOGUE_3_ARGS 1058 1350 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 1060 1352 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 1061 1353 PROLOGUE_3_ARGS 1062 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01354 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1063 1355 %1 dword [A0], A1_32 1064 IEM_SAVE_FLAGS A2, %3, %4, 01356 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1065 1357 EPILOGUE_3_ARGS 1066 1358 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 1069 1361 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 16 1070 1362 PROLOGUE_3_ARGS 1071 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01363 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1072 1364 %1 qword [A0], A1 1073 IEM_SAVE_FLAGS A2, %3, %4, 01365 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1074 1366 EPILOGUE_3_ARGS_EX 8 1075 1367 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 1080 1372 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16_locked, 12 1081 1373 PROLOGUE_3_ARGS 1082 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01374 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1083 1375 lock %1 word [A0], A1_16 1084 IEM_SAVE_FLAGS A2, %3, %4, 01376 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1085 1377 EPILOGUE_3_ARGS 1086 1378 ENDPROC iemAImpl_ %+ %1 %+ _u16_locked … … 1088 1380 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32_locked, 12 1089 1381 PROLOGUE_3_ARGS 1090 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01382 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1091 1383 lock %1 dword [A0], A1_32 1092 IEM_SAVE_FLAGS A2, %3, %4, 01384 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1093 1385 EPILOGUE_3_ARGS 1094 1386 ENDPROC iemAImpl_ %+ %1 %+ _u32_locked … … 1097 1389 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64_locked, 16 1098 1390 PROLOGUE_3_ARGS 1099 IEM_MAYBE_LOAD_FLAGS A2, %3, %4, 01391 IEM_MAYBE_LOAD_FLAGS_OLD A2, %3, %4, 0 1100 1392 lock %1 qword [A0], A1 1101 IEM_SAVE_FLAGS A2, %3, %4, 01393 IEM_SAVE_FLAGS_OLD A2, %3, %4, 0 1102 1394 EPILOGUE_3_ARGS_EX 8 1103 1395 ENDPROC iemAImpl_ %+ %1 %+ _u64_locked … … 1142 1434 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 1143 1435 PROLOGUE_3_ARGS 1144 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru1436 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru 1145 1437 %1 T0_16, A1_16 1146 1438 %if %4 != 0 … … 1149 1441 mov [A0], T0_16 1150 1442 .unchanged_dst: 1151 IEM_SAVE_FLAGS A2, %2, %3, 01443 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 1152 1444 EPILOGUE_3_ARGS 1153 1445 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 1158 1450 ;bad; jz .unchanged_dst 1159 1451 ;bad; mov [A0], T1_16 1160 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T11452 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T1 1161 1453 ;bad; EPILOGUE_3_ARGS 1162 1454 ;bad;.unchanged_dst: … … 1164 1456 ;bad; mov [A0], T1_16 1165 1457 ;bad;%endif 1166 ;bad; IEM_ADJUST_FLAGS A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF1458 ;bad; IEM_ADJUST_FLAGS_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF 1167 1459 ;bad; EPILOGUE_3_ARGS 1168 1460 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u16_intel … … 1176 1468 ;bad; mov [A0], T0_16 1177 1469 ;bad;.unchanged_dst: 1178 ;bad; IEM_SAVE_AND_ADJUST_FLAGS A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2.1470 ;bad; IEM_SAVE_AND_ADJUST_FLAGS_OLD A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2. 1179 1471 ;bad; EPILOGUE_3_ARGS 1180 1472 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u16_amd … … 1184 1476 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 1185 1477 PROLOGUE_3_ARGS 1186 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru1478 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru 1187 1479 %1 T0_32, A1_32 1188 1480 %if %4 != 0 … … 1191 1483 mov [A0], T0_32 1192 1484 .unchanged_dst: 1193 IEM_SAVE_FLAGS A2, %2, %3, 01485 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 1194 1486 EPILOGUE_3_ARGS 1195 1487 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 1202 1494 ;bad;%endif 1203 1495 ;bad; mov [A0], T1_32 1204 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T11496 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T1 1205 1497 ;bad; EPILOGUE_3_ARGS 1206 1498 ;bad;.unchanged_dst: 1207 ;bad; IEM_ADJUST_FLAGS A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF1499 ;bad; IEM_ADJUST_FLAGS_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF 1208 1500 ;bad; EPILOGUE_3_ARGS 1209 1501 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u32_intel … … 1217 1509 ;bad; mov [A0], T0_32 1218 1510 ;bad;.unchanged_dst: 1219 ;bad; IEM_SAVE_AND_ADJUST_FLAGS A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2.1511 ;bad; IEM_SAVE_AND_ADJUST_FLAGS_OLD A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2. 1220 1512 ;bad; EPILOGUE_3_ARGS 1221 1513 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u32_amd … … 1227 1519 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 16 1228 1520 PROLOGUE_3_ARGS 1229 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru1521 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %3 ; Must load undefined flags since AMD passes them thru 1230 1522 %1 T0, A1 1231 1523 %if %4 != 0 … … 1234 1526 mov [A0], T0 1235 1527 .unchanged_dst: 1236 IEM_SAVE_FLAGS A2, %2, %3, 01528 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 1237 1529 EPILOGUE_3_ARGS_EX 8 1238 1530 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 1245 1537 ;bad;%endif 1246 1538 ;bad; mov [A0], T1 1247 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T11539 ;bad; IEM_ADJUST_FLAGS_WITH_PARITY_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF | X86_EFL_ZF, 0, T1 1248 1540 ;bad; EPILOGUE_3_ARGS 1249 1541 ;bad;.unchanged_dst: 1250 ;bad; IEM_ADJUST_FLAGS A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF1542 ;bad; IEM_ADJUST_FLAGS_OLD A2, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_CF, X86_EFL_ZF | X86_EFL_PF 1251 1543 ;bad; EPILOGUE_3_ARGS 1252 1544 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u64_intel … … 1260 1552 ;bad; mov [A0], T0 1261 1553 ;bad;.unchanged_dst: 1262 ;bad; IEM_SAVE_AND_ADJUST_FLAGS A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2.1554 ;bad; IEM_SAVE_AND_ADJUST_FLAGS_OLD A2, %2, 0, 0 ; Only the ZF flag is modified on AMD Zen 2. 1263 1555 ;bad; EPILOGUE_3_ARGS_EX 8 1264 1556 ;bad;ENDPROC iemAImpl_ %+ %1 %+ _u64_amd … … 1295 1587 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 1296 1588 PROLOGUE_3_ARGS 1297 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, 01589 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, 0 1298 1590 %1 T0_16, A1_16 1299 1591 mov [A0], T0_16 1300 IEM_SAVE_FLAGS A2, %2, %3, %41592 IEM_SAVE_FLAGS_OLD A2, %2, %3, %4 1301 1593 EPILOGUE_3_ARGS 1302 1594 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 1304 1596 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 1305 1597 PROLOGUE_3_ARGS 1306 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, 01598 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, 0 1307 1599 %1 T0_32, A1_32 1308 1600 mov [A0], T0_32 1309 IEM_SAVE_FLAGS A2, %2, %3, %41601 IEM_SAVE_FLAGS_OLD A2, %2, %3, %4 1310 1602 EPILOGUE_3_ARGS 1311 1603 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 1314 1606 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 16 1315 1607 PROLOGUE_3_ARGS 1316 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, 01608 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, 0 1317 1609 %1 T0, A1 1318 1610 mov [A0], T0 1319 IEM_SAVE_FLAGS A2, %2, %3, %41611 IEM_SAVE_FLAGS_OLD A2, %2, %3, %4 1320 1612 EPILOGUE_3_ARGS_EX 8 1321 1613 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 1338 1630 BEGINPROC_FASTCALL iemAImpl_imul_two_u16 %+ %3, 12 1339 1631 PROLOGUE_3_ARGS 1340 IEM_MAYBE_LOAD_FLAGS A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD)1632 IEM_MAYBE_LOAD_FLAGS_OLD A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD) 1341 1633 imul A1_16, word [A0] 1342 1634 mov [A0], A1_16 1343 1635 %if %4 != 1 1344 IEM_SAVE_FLAGS A2, %1, %2, 01636 IEM_SAVE_FLAGS_OLD A2, %1, %2, 0 1345 1637 %else 1346 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_16, 16, A1 ; intel1638 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_16, 16, A1 ; intel 1347 1639 %endif 1348 1640 EPILOGUE_3_ARGS … … 1351 1643 BEGINPROC_FASTCALL iemAImpl_imul_two_u32 %+ %3, 12 1352 1644 PROLOGUE_3_ARGS 1353 IEM_MAYBE_LOAD_FLAGS A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD)1645 IEM_MAYBE_LOAD_FLAGS_OLD A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD) 1354 1646 imul A1_32, dword [A0] 1355 1647 mov [A0], A1_32 1356 1648 %if %4 != 1 1357 IEM_SAVE_FLAGS A2, %1, %2, 01649 IEM_SAVE_FLAGS_OLD A2, %1, %2, 0 1358 1650 %else 1359 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_32, 32, A1 ; intel1651 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_32, 32, A1 ; intel 1360 1652 %endif 1361 1653 EPILOGUE_3_ARGS … … 1365 1657 BEGINPROC_FASTCALL iemAImpl_imul_two_u64 %+ %3, 16 1366 1658 PROLOGUE_3_ARGS 1367 IEM_MAYBE_LOAD_FLAGS A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD)1659 IEM_MAYBE_LOAD_FLAGS_OLD A2, %1, %2, %2 ; Undefined flags may be passed thru (AMD) 1368 1660 imul A1, qword [A0] 1369 1661 mov [A0], A1 1370 1662 %if %4 != 1 1371 IEM_SAVE_FLAGS A2, %1, %2, 01663 IEM_SAVE_FLAGS_OLD A2, %1, %2, 0 1372 1664 %else 1373 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1, 64, A1 ; intel1665 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A2, %1, X86_EFL_AF | X86_EFL_ZF, A1, 64, A1 ; intel 1374 1666 %endif 1375 1667 EPILOGUE_3_ARGS_EX 8 … … 1477 1769 BEGINPROC_FASTCALL iemAImpl_xadd_u8, 12 1478 1770 PROLOGUE_3_ARGS 1479 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01771 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1480 1772 mov T0_8, [A1] 1481 1773 xadd [A0], T0_8 1482 1774 mov [A1], T0_8 1483 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01775 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1484 1776 EPILOGUE_3_ARGS 1485 1777 ENDPROC iemAImpl_xadd_u8 … … 1487 1779 BEGINPROC_FASTCALL iemAImpl_xadd_u16, 12 1488 1780 PROLOGUE_3_ARGS 1489 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01781 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1490 1782 mov T0_16, [A1] 1491 1783 xadd [A0], T0_16 1492 1784 mov [A1], T0_16 1493 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01785 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1494 1786 EPILOGUE_3_ARGS 1495 1787 ENDPROC iemAImpl_xadd_u16 … … 1497 1789 BEGINPROC_FASTCALL iemAImpl_xadd_u32, 12 1498 1790 PROLOGUE_3_ARGS 1499 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01791 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1500 1792 mov T0_32, [A1] 1501 1793 xadd [A0], T0_32 1502 1794 mov [A1], T0_32 1503 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01795 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1504 1796 EPILOGUE_3_ARGS 1505 1797 ENDPROC iemAImpl_xadd_u32 … … 1508 1800 BEGINPROC_FASTCALL iemAImpl_xadd_u64, 12 1509 1801 PROLOGUE_3_ARGS 1510 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01802 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1511 1803 mov T0, [A1] 1512 1804 xadd [A0], T0 1513 1805 mov [A1], T0 1514 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01806 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1515 1807 EPILOGUE_3_ARGS 1516 1808 ENDPROC iemAImpl_xadd_u64 … … 1519 1811 BEGINPROC_FASTCALL iemAImpl_xadd_u8_locked, 12 1520 1812 PROLOGUE_3_ARGS 1521 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01813 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1522 1814 mov T0_8, [A1] 1523 1815 lock xadd [A0], T0_8 1524 1816 mov [A1], T0_8 1525 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01817 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1526 1818 EPILOGUE_3_ARGS 1527 1819 ENDPROC iemAImpl_xadd_u8_locked … … 1529 1821 BEGINPROC_FASTCALL iemAImpl_xadd_u16_locked, 12 1530 1822 PROLOGUE_3_ARGS 1531 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01823 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1532 1824 mov T0_16, [A1] 1533 1825 lock xadd [A0], T0_16 1534 1826 mov [A1], T0_16 1535 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01827 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1536 1828 EPILOGUE_3_ARGS 1537 1829 ENDPROC iemAImpl_xadd_u16_locked … … 1539 1831 BEGINPROC_FASTCALL iemAImpl_xadd_u32_locked, 12 1540 1832 PROLOGUE_3_ARGS 1541 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01833 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1542 1834 mov T0_32, [A1] 1543 1835 lock xadd [A0], T0_32 1544 1836 mov [A1], T0_32 1545 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01837 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1546 1838 EPILOGUE_3_ARGS 1547 1839 ENDPROC iemAImpl_xadd_u32_locked … … 1550 1842 BEGINPROC_FASTCALL iemAImpl_xadd_u64_locked, 12 1551 1843 PROLOGUE_3_ARGS 1552 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01844 IEM_MAYBE_LOAD_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1553 1845 mov T0, [A1] 1554 1846 lock xadd [A0], T0 1555 1847 mov [A1], T0 1556 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 01848 IEM_SAVE_FLAGS_OLD A2, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0, 0 1557 1849 EPILOGUE_3_ARGS 1558 1850 ENDPROC iemAImpl_xadd_u64_locked … … 1585 1877 mov ebx, [r8] 1586 1878 mov ecx, [r8 + 4] 1587 IEM_MAYBE_LOAD_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)1879 IEM_MAYBE_LOAD_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1588 1880 mov eax, [r11] 1589 1881 mov edx, [r11 + 4] … … 1593 1885 mov [r11], eax 1594 1886 mov [r11 + 4], edx 1595 IEM_SAVE_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)1887 IEM_SAVE_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1596 1888 1597 1889 pop rbx … … 1605 1897 mov ebx, [r11] 1606 1898 mov ecx, [r11 + 4] 1607 IEM_MAYBE_LOAD_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)1899 IEM_MAYBE_LOAD_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1608 1900 mov eax, [rsi] 1609 1901 mov edx, [rsi + 4] … … 1613 1905 mov [rsi], eax 1614 1906 mov [rsi + 4], edx 1615 IEM_SAVE_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)1907 IEM_SAVE_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1616 1908 1617 1909 pop rbx … … 1632 1924 mov ebx, [ecx] 1633 1925 mov ecx, [ecx + 4] 1634 IEM_MAYBE_LOAD_FLAGS ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)1926 IEM_MAYBE_LOAD_FLAGS_OLD ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1635 1927 mov eax, [esi] 1636 1928 mov edx, [esi + 4] … … 1640 1932 mov [esi], eax 1641 1933 mov [esi + 4], edx 1642 IEM_SAVE_FLAGS ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, edi)1934 IEM_SAVE_FLAGS_OLD ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, edi) 1643 1935 1644 1936 pop ebp … … 1660 1952 mov ebx, [r8] 1661 1953 mov ecx, [r8 + 4] 1662 IEM_MAYBE_LOAD_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)1954 IEM_MAYBE_LOAD_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1663 1955 mov eax, [r11] 1664 1956 mov edx, [r11 + 4] … … 1668 1960 mov [r11], eax 1669 1961 mov [r11 + 4], edx 1670 IEM_SAVE_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)1962 IEM_SAVE_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1671 1963 1672 1964 pop rbx … … 1680 1972 mov ebx, [r11] 1681 1973 mov ecx, [r11 + 4] 1682 IEM_MAYBE_LOAD_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)1974 IEM_MAYBE_LOAD_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1683 1975 mov eax, [rsi] 1684 1976 mov edx, [rsi + 4] … … 1688 1980 mov [rsi], eax 1689 1981 mov [rsi + 4], edx 1690 IEM_SAVE_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)1982 IEM_SAVE_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1691 1983 1692 1984 pop rbx … … 1707 1999 mov ebx, [ecx] 1708 2000 mov ecx, [ecx + 4] 1709 IEM_MAYBE_LOAD_FLAGS ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)2001 IEM_MAYBE_LOAD_FLAGS_OLD ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1710 2002 mov eax, [esi] 1711 2003 mov edx, [esi + 4] … … 1715 2007 mov [esi], eax 1716 2008 mov [esi + 4], edx 1717 IEM_SAVE_FLAGS ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, edi)2009 IEM_SAVE_FLAGS_OLD ebp, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, edi) 1718 2010 1719 2011 pop ebp … … 1751 2043 mov rbx, [r8] 1752 2044 mov rcx, [r8 + 8] 1753 IEM_MAYBE_LOAD_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)2045 IEM_MAYBE_LOAD_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1754 2046 mov rax, [r11] 1755 2047 mov rdx, [r11 + 8] … … 1759 2051 mov [r11], rax 1760 2052 mov [r11 + 8], rdx 1761 IEM_SAVE_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)2053 IEM_SAVE_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1762 2054 1763 2055 pop rbx … … 1771 2063 mov rbx, [r11] 1772 2064 mov rcx, [r11 + 8] 1773 IEM_MAYBE_LOAD_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)2065 IEM_MAYBE_LOAD_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1774 2066 mov rax, [rsi] 1775 2067 mov rdx, [rsi + 8] … … 1779 2071 mov [rsi], rax 1780 2072 mov [rsi + 8], rdx 1781 IEM_SAVE_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)2073 IEM_SAVE_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1782 2074 1783 2075 pop rbx … … 1796 2088 mov rbx, [r8] 1797 2089 mov rcx, [r8 + 8] 1798 IEM_MAYBE_LOAD_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)2090 IEM_MAYBE_LOAD_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1799 2091 mov rax, [r11] 1800 2092 mov rdx, [r11 + 8] … … 1804 2096 mov [r11], rax 1805 2097 mov [r11 + 8], rdx 1806 IEM_SAVE_FLAGS r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)2098 IEM_SAVE_FLAGS_OLD r9, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1807 2099 1808 2100 pop rbx … … 1816 2108 mov rbx, [r11] 1817 2109 mov rcx, [r11 + 8] 1818 IEM_MAYBE_LOAD_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax)2110 IEM_MAYBE_LOAD_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0 (eax) 1819 2111 mov rax, [rsi] 1820 2112 mov rdx, [rsi + 8] … … 1824 2116 mov [rsi], rax 1825 2117 mov [rsi + 8], rdx 1826 IEM_SAVE_FLAGS r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11)2118 IEM_SAVE_FLAGS_OLD r10, (X86_EFL_ZF), 0, 0 ; clobbers T0+T1 (eax, r11) 1827 2119 1828 2120 pop rbx … … 1847 2139 BEGINPROC_FASTCALL iemAImpl_cmpxchg_u8 %+ %2, 16 1848 2140 PROLOGUE_4_ARGS 1849 IEM_MAYBE_LOAD_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax)2141 IEM_MAYBE_LOAD_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax) 1850 2142 mov al, [A1] 1851 2143 %1 cmpxchg [A0], A2_8 1852 2144 mov [A1], al 1853 IEM_SAVE_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi)2145 IEM_SAVE_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi) 1854 2146 EPILOGUE_4_ARGS 1855 2147 ENDPROC iemAImpl_cmpxchg_u8 %+ %2 … … 1857 2149 BEGINPROC_FASTCALL iemAImpl_cmpxchg_u16 %+ %2, 16 1858 2150 PROLOGUE_4_ARGS 1859 IEM_MAYBE_LOAD_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax)2151 IEM_MAYBE_LOAD_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax) 1860 2152 mov ax, [A1] 1861 2153 %1 cmpxchg [A0], A2_16 1862 2154 mov [A1], ax 1863 IEM_SAVE_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi)2155 IEM_SAVE_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi) 1864 2156 EPILOGUE_4_ARGS 1865 2157 ENDPROC iemAImpl_cmpxchg_u16 %+ %2 … … 1867 2159 BEGINPROC_FASTCALL iemAImpl_cmpxchg_u32 %+ %2, 16 1868 2160 PROLOGUE_4_ARGS 1869 IEM_MAYBE_LOAD_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax)2161 IEM_MAYBE_LOAD_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax) 1870 2162 mov eax, [A1] 1871 2163 %1 cmpxchg [A0], A2_32 1872 2164 mov [A1], eax 1873 IEM_SAVE_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi)2165 IEM_SAVE_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi) 1874 2166 EPILOGUE_4_ARGS 1875 2167 ENDPROC iemAImpl_cmpxchg_u32 %+ %2 … … 1878 2170 %ifdef RT_ARCH_AMD64 1879 2171 PROLOGUE_4_ARGS 1880 IEM_MAYBE_LOAD_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax)2172 IEM_MAYBE_LOAD_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax) 1881 2173 mov rax, [A1] 1882 2174 %1 cmpxchg [A0], A2 1883 2175 mov [A1], rax 1884 IEM_SAVE_FLAGS A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi)2176 IEM_SAVE_FLAGS_OLD A3, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, r11/edi) 1885 2177 EPILOGUE_4_ARGS 1886 2178 %else … … 1900 2192 mov ebx, [ecx] 1901 2193 mov ecx, [ecx + 4] 1902 IEM_MAYBE_LOAD_FLAGS ebp, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax)2194 IEM_MAYBE_LOAD_FLAGS_OLD ebp, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0 (eax) 1903 2195 mov eax, [esi] 1904 2196 mov edx, [esi + 4] … … 1913 2205 mov [esi], eax 1914 2206 mov [esi + 4], edx 1915 IEM_SAVE_FLAGS ebp, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, edi)2207 IEM_SAVE_FLAGS_OLD ebp, (X86_EFL_ZF | X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_SF | X86_EFL_OF), 0, 0 ; clobbers T0+T1 (eax, edi) 1916 2208 1917 2209 pop ebp … … 1954 2246 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8, 8 1955 2247 PROLOGUE_2_ARGS 1956 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02248 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1957 2249 %1 byte [A0] 1958 IEM_SAVE_FLAGS A1, %2, %3, 02250 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1959 2251 EPILOGUE_2_ARGS 1960 2252 ENDPROC iemAImpl_ %+ %1 %+ _u8 … … 1962 2254 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8_locked, 8 1963 2255 PROLOGUE_2_ARGS 1964 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02256 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1965 2257 lock %1 byte [A0] 1966 IEM_SAVE_FLAGS A1, %2, %3, 02258 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1967 2259 EPILOGUE_2_ARGS 1968 2260 ENDPROC iemAImpl_ %+ %1 %+ _u8_locked … … 1970 2262 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 8 1971 2263 PROLOGUE_2_ARGS 1972 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02264 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1973 2265 %1 word [A0] 1974 IEM_SAVE_FLAGS A1, %2, %3, 02266 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1975 2267 EPILOGUE_2_ARGS 1976 2268 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 1978 2270 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16_locked, 8 1979 2271 PROLOGUE_2_ARGS 1980 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02272 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1981 2273 lock %1 word [A0] 1982 IEM_SAVE_FLAGS A1, %2, %3, 02274 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1983 2275 EPILOGUE_2_ARGS 1984 2276 ENDPROC iemAImpl_ %+ %1 %+ _u16_locked … … 1986 2278 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 8 1987 2279 PROLOGUE_2_ARGS 1988 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02280 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1989 2281 %1 dword [A0] 1990 IEM_SAVE_FLAGS A1, %2, %3, 02282 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1991 2283 EPILOGUE_2_ARGS 1992 2284 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 1994 2286 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32_locked, 8 1995 2287 PROLOGUE_2_ARGS 1996 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02288 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 1997 2289 lock %1 dword [A0] 1998 IEM_SAVE_FLAGS A1, %2, %3, 02290 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 1999 2291 EPILOGUE_2_ARGS 2000 2292 ENDPROC iemAImpl_ %+ %1 %+ _u32_locked … … 2003 2295 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 8 2004 2296 PROLOGUE_2_ARGS 2005 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02297 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 2006 2298 %1 qword [A0] 2007 IEM_SAVE_FLAGS A1, %2, %3, 02299 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 2008 2300 EPILOGUE_2_ARGS 2009 2301 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 2011 2303 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64_locked, 8 2012 2304 PROLOGUE_2_ARGS 2013 IEM_MAYBE_LOAD_FLAGS A1, %2, %3, 02305 IEM_MAYBE_LOAD_FLAGS_OLD A1, %2, %3, 0 2014 2306 lock %1 qword [A0] 2015 IEM_SAVE_FLAGS A1, %2, %3, 02307 IEM_SAVE_FLAGS_OLD A1, %2, %3, 0 2016 2308 EPILOGUE_2_ARGS 2017 2309 ENDPROC iemAImpl_ %+ %1 %+ _u64_locked … … 2091 2383 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8, 12 2092 2384 PROLOGUE_3_ARGS 2093 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %42385 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %4 2094 2386 %ifdef ASM_CALL64_GCC 2095 2387 mov cl, A1_8 … … 2099 2391 %1 byte [A1], cl 2100 2392 %endif 2101 IEM_SAVE_FLAGS A2, %2, %3, 02393 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2102 2394 .zero_shift: 2103 2395 EPILOGUE_3_ARGS … … 2106 2398 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 12 2107 2399 PROLOGUE_3_ARGS 2108 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %42400 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %4 2109 2401 %ifdef ASM_CALL64_GCC 2110 2402 mov cl, A1_8 … … 2114 2406 %1 word [A1], cl 2115 2407 %endif 2116 IEM_SAVE_FLAGS A2, %2, %3, 02408 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2117 2409 EPILOGUE_3_ARGS 2118 2410 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 2120 2412 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 12 2121 2413 PROLOGUE_3_ARGS 2122 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %42414 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %4 2123 2415 %ifdef ASM_CALL64_GCC 2124 2416 mov cl, A1_8 … … 2128 2420 %1 dword [A1], cl 2129 2421 %endif 2130 IEM_SAVE_FLAGS A2, %2, %3, 02422 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2131 2423 EPILOGUE_3_ARGS 2132 2424 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 2135 2427 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 12 2136 2428 PROLOGUE_3_ARGS 2137 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %42429 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %4 2138 2430 %ifdef ASM_CALL64_GCC 2139 2431 mov cl, A1_8 … … 2143 2435 %1 qword [A1], cl 2144 2436 %endif 2145 IEM_SAVE_FLAGS A2, %2, %3, 02437 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2146 2438 EPILOGUE_3_ARGS 2147 2439 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 2184 2476 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16, 16 2185 2477 PROLOGUE_4_ARGS 2186 ;IEM_LOAD_FLAGS A3, %4, %32187 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %42478 ;IEM_LOAD_FLAGS_OLD A3, %4, %3 2479 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %4 2188 2480 %ifdef ASM_CALL64_GCC 2189 2481 xchg A3, A2 … … 2194 2486 %1 [A2], A1_16, cl 2195 2487 %endif 2196 IEM_SAVE_FLAGS A3, %2, %3, 02488 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2197 2489 EPILOGUE_4_ARGS 2198 2490 ENDPROC iemAImpl_ %+ %1 %+ _u16 … … 2200 2492 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32, 16 2201 2493 PROLOGUE_4_ARGS 2202 ;IEM_LOAD_FLAGS A3, %4, %32203 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %42494 ;IEM_LOAD_FLAGS_OLD A3, %4, %3 2495 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %4 2204 2496 %ifdef ASM_CALL64_GCC 2205 2497 xchg A3, A2 … … 2210 2502 %1 [A2], A1_32, cl 2211 2503 %endif 2212 IEM_SAVE_FLAGS A3, %2, %3, 02504 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2213 2505 EPILOGUE_4_ARGS 2214 2506 ENDPROC iemAImpl_ %+ %1 %+ _u32 … … 2217 2509 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 20 2218 2510 PROLOGUE_4_ARGS 2219 ;IEM_LOAD_FLAGS A3, %4, %32220 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %42511 ;IEM_LOAD_FLAGS_OLD A3, %4, %3 2512 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %4 2221 2513 %ifdef ASM_CALL64_GCC 2222 2514 xchg A3, A2 … … 2227 2519 %1 [A2], A1, cl 2228 2520 %endif 2229 IEM_SAVE_FLAGS A3, %2, %3, 02521 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2230 2522 EPILOGUE_4_ARGS_EX 12 2231 2523 ENDPROC iemAImpl_ %+ %1 %+ _u64 … … 2266 2558 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8 %+ %4, 12 2267 2559 PROLOGUE_3_ARGS 2268 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2560 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2269 2561 mov al, [A0] 2270 2562 %1 A1_8 2271 2563 mov [A0], ax 2272 2564 %if %5 != 1 2273 IEM_SAVE_FLAGS A2, %2, %3, 02565 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2274 2566 %else 2275 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %2, X86_EFL_AF | X86_EFL_ZF, ax, 8, xAX ; intel2567 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A2, %2, X86_EFL_AF | X86_EFL_ZF, ax, 8, xAX ; intel 2276 2568 %endif 2277 2569 xor eax, eax … … 2281 2573 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u16 %+ %4, 16 2282 2574 PROLOGUE_4_ARGS 2283 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2575 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2284 2576 mov ax, [A0] 2285 2577 %ifdef ASM_CALL64_GCC … … 2294 2586 %endif 2295 2587 %if %5 != 1 2296 IEM_SAVE_FLAGS A3, %2, %3, 02588 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2297 2589 %else 2298 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A3, %2, X86_EFL_AF | X86_EFL_ZF, ax, 16, xAX ; intel2590 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A3, %2, X86_EFL_AF | X86_EFL_ZF, ax, 16, xAX ; intel 2299 2591 %endif 2300 2592 xor eax, eax … … 2304 2596 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u32 %+ %4, 16 2305 2597 PROLOGUE_4_ARGS 2306 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2598 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2307 2599 mov eax, [A0] 2308 2600 %ifdef ASM_CALL64_GCC … … 2317 2609 %endif 2318 2610 %if %5 != 1 2319 IEM_SAVE_FLAGS A3, %2, %3, 02611 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2320 2612 %else 2321 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A3, %2, X86_EFL_AF | X86_EFL_ZF, eax, 32, xAX ; intel2613 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A3, %2, X86_EFL_AF | X86_EFL_ZF, eax, 32, xAX ; intel 2322 2614 %endif 2323 2615 xor eax, eax … … 2328 2620 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64 %+ %4, 20 2329 2621 PROLOGUE_4_ARGS 2330 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2622 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2331 2623 mov rax, [A0] 2332 2624 %ifdef ASM_CALL64_GCC … … 2341 2633 %endif 2342 2634 %if %5 != 1 2343 IEM_SAVE_FLAGS A3, %2, %3, 02635 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2344 2636 %else 2345 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A3, %2, X86_EFL_AF | X86_EFL_ZF, rax, 64, xAX ; intel2637 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF_OLD A3, %2, X86_EFL_AF | X86_EFL_ZF, rax, 64, xAX ; intel 2346 2638 %endif 2347 2639 xor eax, eax … … 2462 2754 %endif 2463 2755 2464 IEM_MAYBE_LOAD_FLAGS A2, %2, %3, %3 ; Undefined flags may be passed thru (Intel)2756 IEM_MAYBE_LOAD_FLAGS_OLD A2, %2, %3, %3 ; Undefined flags may be passed thru (Intel) 2465 2757 mov ax, [A0] 2466 2758 %1 A1_8 2467 2759 mov [A0], ax 2468 2760 %if %6 == 2 ; AMD64 3990X: Set AF and clear PF, ZF and SF. 2469 IEM_ADJUST_FLAGS A2, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF2761 IEM_ADJUST_FLAGS_OLD A2, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF 2470 2762 %else 2471 IEM_SAVE_FLAGS A2, %2, %3, 02763 IEM_SAVE_FLAGS_OLD A2, %2, %3, 0 2472 2764 %endif 2473 2765 xor eax, eax … … 2528 2820 %endif 2529 2821 2530 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2822 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2531 2823 %ifdef ASM_CALL64_GCC 2532 2824 mov T1, A2 … … 2545 2837 %endif 2546 2838 %if %6 == 2 ; AMD64 3990X: Set AF and clear PF, ZF and SF. 2547 IEM_ADJUST_FLAGS A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF2839 IEM_ADJUST_FLAGS_OLD A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF 2548 2840 %else 2549 IEM_SAVE_FLAGS A3, %2, %3, 02841 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2550 2842 %endif 2551 2843 xor eax, eax … … 2614 2906 %endif 2615 2907 2616 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2908 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2617 2909 mov eax, [A0] 2618 2910 %ifdef ASM_CALL64_GCC … … 2632 2924 %endif 2633 2925 %if %6 == 2 ; AMD64 3990X: Set AF and clear PF, ZF and SF. 2634 IEM_ADJUST_FLAGS A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF2926 IEM_ADJUST_FLAGS_OLD A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF 2635 2927 %else 2636 IEM_SAVE_FLAGS A3, %2, %3, 02928 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2637 2929 %endif 2638 2930 xor eax, eax … … 2702 2994 %endif 2703 2995 2704 IEM_MAYBE_LOAD_FLAGS A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD)2996 IEM_MAYBE_LOAD_FLAGS_OLD A3, %2, %3, %3 ; Undefined flags may be passed thru (AMD) 2705 2997 mov rax, [A0] 2706 2998 %ifdef ASM_CALL64_GCC … … 2720 3012 %endif 2721 3013 %if %6 == 2 ; AMD64 3990X: Set AF and clear PF, ZF and SF. 2722 IEM_ADJUST_FLAGS A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF3014 IEM_ADJUST_FLAGS_OLD A3, X86_EFL_PF | X86_EFL_ZF | X86_EFL_SF, X86_EFL_AF 2723 3015 %else 2724 IEM_SAVE_FLAGS A3, %2, %3, 03016 IEM_SAVE_FLAGS_OLD A3, %2, %3, 0 2725 3017 %endif 2726 3018 xor eax, eax … … 4756 5048 movdqu xmm1, [A1] 4757 5049 ptest xmm0, xmm1 4758 IEM_SAVE_FLAGS A2, X86_EFL_ZF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_AF | X86_EFL_PF | X86_EFL_SF5050 IEM_SAVE_FLAGS_OLD A2, X86_EFL_ZF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_AF | X86_EFL_PF | X86_EFL_SF 4759 5051 4760 5052 IEMIMPL_SSE_EPILOGUE … … 4769 5061 vmovdqu ymm1, [A1] 4770 5062 vptest ymm0, ymm1 4771 IEM_SAVE_FLAGS A2, X86_EFL_ZF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_AF | X86_EFL_PF | X86_EFL_SF5063 IEM_SAVE_FLAGS_OLD A2, X86_EFL_ZF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_AF | X86_EFL_PF | X86_EFL_SF 4772 5064 4773 5065 IEMIMPL_SSE_EPILOGUE … … 5643 5935 IEMIMPL_CALL_JUMP_TABLE_TARGET T1, A3, 8 5644 5936 5645 IEM_SAVE_FLAGS A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF5937 IEM_SAVE_FLAGS_OLD A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF 5646 5938 mov [T2], ecx 5647 5939 … … 5684 5976 5685 5977 pop xDX 5686 IEM_SAVE_FLAGS A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF5978 IEM_SAVE_FLAGS_OLD A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF 5687 5979 mov [T2], ecx 5688 5980 … … 5718 6010 IEMIMPL_CALL_JUMP_TABLE_TARGET T1, A3, 8 5719 6011 5720 IEM_SAVE_FLAGS A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF6012 IEM_SAVE_FLAGS_OLD A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF 5721 6013 movdqu [A0], xmm0 5722 6014 … … 5758 6050 5759 6051 pop xDX 5760 IEM_SAVE_FLAGS A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF6052 IEM_SAVE_FLAGS_OLD A1, X86_EFL_CF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF, 0, X86_EFL_AF | X86_EFL_PF 5761 6053 movdqu [A0], xmm0 5762 6054 … … 6102 6394 movd xmm1, A3_32 6103 6395 ucomiss xmm0, xmm1 6104 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6396 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6105 6397 6106 6398 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6117 6409 movd xmm1, A3_32 6118 6410 vucomiss xmm0, xmm1 6119 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6411 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6120 6412 6121 6413 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6142 6434 movq xmm1, A3 6143 6435 ucomisd xmm0, xmm1 6144 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6436 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6145 6437 6146 6438 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6157 6449 movq xmm1, A3 6158 6450 vucomisd xmm0, xmm1 6159 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6451 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6160 6452 6161 6453 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6181 6473 movd xmm1, A3_32 6182 6474 comiss xmm0, xmm1 6183 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6475 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6184 6476 6185 6477 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6196 6488 movd xmm1, A3_32 6197 6489 vcomiss xmm0, xmm1 6198 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6490 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6199 6491 6200 6492 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6221 6513 movq xmm1, A3 6222 6514 comisd xmm0, xmm1 6223 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6515 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6224 6516 6225 6517 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6236 6528 movq xmm1, A3 6237 6529 vcomisd xmm0, xmm1 6238 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF6530 IEM_SAVE_FLAGS_OLD A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6239 6531 6240 6532 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 6488 6780 %1 %2 6489 6781 mov [A0], %2 6490 IEM_SAVE_FLAGS A1, X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF6782 IEM_SAVE_FLAGS_OLD A1, X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF 6491 6783 6492 6784 EPILOGUE_2_ARGS … … 6570 6862 PROLOGUE_4_ARGS 6571 6863 6572 IEM_LOAD_FLAGS A2, %2, 06864 IEM_LOAD_FLAGS_OLD A2, %2, 0 6573 6865 %1 A1_32, [A0] 6574 6866 mov [A0], A1_32 6575 IEM_SAVE_FLAGS A2, %2, 0, 06867 IEM_SAVE_FLAGS_OLD A2, %2, 0, 0 6576 6868 6577 6869 EPILOGUE_4_ARGS … … 6590 6882 PROLOGUE_4_ARGS 6591 6883 6592 IEM_LOAD_FLAGS A2, %2, 06884 IEM_LOAD_FLAGS_OLD A2, %2, 0 6593 6885 %1 A1, [A0] 6594 6886 mov [A0], A1 6595 IEM_SAVE_FLAGS A2, %2, 0, 06887 IEM_SAVE_FLAGS_OLD A2, %2, 0, 0 6596 6888 6597 6889 EPILOGUE_4_ARGS -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r104188 r104195 120 120 * 121 121 * @returns Status bits. 122 * @param a_ pfEFlags Pointer to the 32-bit EFLAGS value to update.122 * @param a_fEFlagsVar The 32-bit EFLAGS variable to update. 123 123 * @param a_uResult Unsigned result value. 124 124 * @param a_uSrc The source value (for AF calc). … … 128 128 * @param a_uSrcOf The a_uSrc value to use for overflow calculation. 129 129 */ 130 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(a_ pfEFlags, a_uResult, a_uDst, a_uSrc, a_cBitsWidth, a_CfExpr, a_uSrcOf) \130 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(a_fEFlagsVar, a_uResult, a_uDst, a_uSrc, a_cBitsWidth, a_CfExpr, a_uSrcOf) \ 131 131 do { \ 132 uint32_t fEflTmp = *(a_pfEFlags); \ 133 fEflTmp &= ~X86_EFL_STATUS_BITS; \ 134 fEflTmp |= (a_CfExpr) << X86_EFL_CF_BIT; \ 135 fEflTmp |= IEM_EFL_CALC_PARITY(a_uResult); \ 136 fEflTmp |= ((uint32_t)(a_uResult) ^ (uint32_t)(a_uSrc) ^ (uint32_t)(a_uDst)) & X86_EFL_AF; \ 137 fEflTmp |= X86_EFL_CALC_ZF(a_uResult); \ 138 fEflTmp |= X86_EFL_CALC_SF(a_uResult, a_cBitsWidth); \ 132 a_fEFlagsVar &= ~X86_EFL_STATUS_BITS; \ 133 a_fEFlagsVar |= (a_CfExpr) << X86_EFL_CF_BIT; \ 134 a_fEFlagsVar |= IEM_EFL_CALC_PARITY(a_uResult); \ 135 a_fEFlagsVar |= ((uint32_t)(a_uResult) ^ (uint32_t)(a_uSrc) ^ (uint32_t)(a_uDst)) & X86_EFL_AF; \ 136 a_fEFlagsVar |= X86_EFL_CALC_ZF(a_uResult); \ 137 a_fEFlagsVar |= X86_EFL_CALC_SF(a_uResult, a_cBitsWidth); \ 139 138 \ 140 139 /* Overflow during ADDition happens when both inputs have the same signed \ … … 147 146 \ 148 147 See also: http://teaching.idallen.com/dat2343/10f/notes/040_overflow.txt */ \ 149 fEflTmp |= X86_EFL_GET_OF_ ## a_cBitsWidth( ( ((uint ## a_cBitsWidth ## _t)~((a_uDst) ^ (a_uSrcOf))) \ 150 & RT_BIT_64(a_cBitsWidth - 1)) \ 151 & ((a_uResult) ^ (a_uDst)) ); \ 152 *(a_pfEFlags) = fEflTmp; \ 148 a_fEFlagsVar |= X86_EFL_GET_OF_ ## a_cBitsWidth( ( ((uint ## a_cBitsWidth ## _t)~((a_uDst) ^ (a_uSrcOf))) \ 149 & RT_BIT_64(a_cBitsWidth - 1)) \ 150 & ((a_uResult) ^ (a_uDst)) ); \ 153 151 } while (0) 154 152 … … 161 159 * 162 160 * @returns Status bits. 163 * @param a_ pfEFlags Pointer to the 32-bit EFLAGS value to update.161 * @param a_fEFlagsVar The 32-bit EFLAGS variable to update. 164 162 * @param a_uResult Unsigned result value. 165 163 * @param a_cBitsWidth The width of the result (8, 16, 32, 64). 166 164 * @param a_fExtra Additional bits to set. 167 165 */ 168 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(a_ pfEFlags, a_uResult, a_cBitsWidth, a_fExtra) \166 #define IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(a_fEFlagsVar, a_uResult, a_cBitsWidth, a_fExtra) \ 169 167 do { \ 170 uint32_t fEflTmp = *(a_pfEFlags); \ 171 fEflTmp &= ~X86_EFL_STATUS_BITS; \ 172 fEflTmp |= IEM_EFL_CALC_PARITY(a_uResult); \ 173 fEflTmp |= X86_EFL_CALC_ZF(a_uResult); \ 174 fEflTmp |= X86_EFL_CALC_SF(a_uResult, a_cBitsWidth); \ 175 fEflTmp |= (a_fExtra); \ 176 *(a_pfEFlags) = fEflTmp; \ 168 a_fEFlagsVar &= ~X86_EFL_STATUS_BITS; \ 169 a_fEFlagsVar |= IEM_EFL_CALC_PARITY(a_uResult); \ 170 a_fEFlagsVar |= X86_EFL_CALC_ZF(a_uResult); \ 171 a_fEFlagsVar |= X86_EFL_CALC_SF(a_uResult, a_cBitsWidth); \ 172 a_fEFlagsVar |= (a_fExtra); \ 177 173 } while (0) 178 174 … … 676 672 */ 677 673 678 IEM_DECL_IMPL_DEF( void, iemAImpl_add_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))674 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_add_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 679 675 { 680 676 uint64_t uDst = *puDst; 681 677 uint64_t uResult = uDst + uSrc; 682 678 *puDst = uResult; 683 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 64, uResult < uDst, uSrc); 679 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 64, uResult < uDst, uSrc); 680 return fEFlags; 684 681 } 685 682 686 683 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 687 684 688 IEM_DECL_IMPL_DEF( void, iemAImpl_add_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))685 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_add_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 689 686 { 690 687 uint32_t uDst = *puDst; 691 688 uint32_t uResult = uDst + uSrc; 692 689 *puDst = uResult; 693 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 32, uResult < uDst, uSrc); 694 } 695 696 697 IEM_DECL_IMPL_DEF(void, iemAImpl_add_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 690 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 32, uResult < uDst, uSrc); 691 return fEFlags; 692 } 693 694 695 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_add_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 698 696 { 699 697 uint16_t uDst = *puDst; 700 698 uint16_t uResult = uDst + uSrc; 701 699 *puDst = uResult; 702 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 16, uResult < uDst, uSrc); 703 } 704 705 706 IEM_DECL_IMPL_DEF(void, iemAImpl_add_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 700 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 16, uResult < uDst, uSrc); 701 return fEFlags; 702 } 703 704 705 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_add_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 707 706 { 708 707 uint8_t uDst = *puDst; 709 708 uint8_t uResult = uDst + uSrc; 710 709 *puDst = uResult; 711 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 8, uResult < uDst, uSrc); 710 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 8, uResult < uDst, uSrc); 711 return fEFlags; 712 712 } 713 713 … … 718 718 */ 719 719 720 IEM_DECL_IMPL_DEF( void, iemAImpl_adc_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))721 { 722 if (!( *pfEFlags & X86_EFL_CF))723 iemAImpl_add_u64(puDst, uSrc, pfEFlags);720 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_adc_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 721 { 722 if (!(fEFlags & X86_EFL_CF)) 723 fEFlags = iemAImpl_add_u64(fEFlags, puDst, uSrc); 724 724 else 725 725 { … … 727 727 uint64_t uResult = uDst + uSrc + 1; 728 728 *puDst = uResult; 729 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 64, uResult <= uDst, uSrc); 730 } 729 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 64, uResult <= uDst, uSrc); 730 } 731 return fEFlags; 731 732 } 732 733 733 734 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 734 735 735 IEM_DECL_IMPL_DEF( void, iemAImpl_adc_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))736 { 737 if (!( *pfEFlags & X86_EFL_CF))738 iemAImpl_add_u32(puDst, uSrc, pfEFlags);736 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_adc_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 737 { 738 if (!(fEFlags & X86_EFL_CF)) 739 fEFlags = iemAImpl_add_u32(fEFlags, puDst, uSrc); 739 740 else 740 741 { … … 742 743 uint32_t uResult = uDst + uSrc + 1; 743 744 *puDst = uResult; 744 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 32, uResult <= uDst, uSrc); 745 } 746 } 747 748 749 IEM_DECL_IMPL_DEF(void, iemAImpl_adc_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 750 { 751 if (!(*pfEFlags & X86_EFL_CF)) 752 iemAImpl_add_u16(puDst, uSrc, pfEFlags); 745 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 32, uResult <= uDst, uSrc); 746 } 747 return fEFlags; 748 } 749 750 751 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_adc_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 752 { 753 if (!(fEFlags & X86_EFL_CF)) 754 fEFlags = iemAImpl_add_u16(fEFlags, puDst, uSrc); 753 755 else 754 756 { … … 756 758 uint16_t uResult = uDst + uSrc + 1; 757 759 *puDst = uResult; 758 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 16, uResult <= uDst, uSrc); 759 } 760 } 761 762 763 IEM_DECL_IMPL_DEF(void, iemAImpl_adc_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 764 { 765 if (!(*pfEFlags & X86_EFL_CF)) 766 iemAImpl_add_u8(puDst, uSrc, pfEFlags); 760 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 16, uResult <= uDst, uSrc); 761 } 762 return fEFlags; 763 } 764 765 766 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_adc_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 767 { 768 if (!(fEFlags & X86_EFL_CF)) 769 fEFlags = iemAImpl_add_u8(fEFlags, puDst, uSrc); 767 770 else 768 771 { … … 770 773 uint8_t uResult = uDst + uSrc + 1; 771 774 *puDst = uResult; 772 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 8, uResult <= uDst, uSrc); 773 } 775 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 8, uResult <= uDst, uSrc); 776 } 777 return fEFlags; 774 778 } 775 779 … … 781 785 # if !defined(RT_ARCH_ARM64) 782 786 783 IEM_DECL_IMPL_DEF( void, iemAImpl_sub_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))787 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sub_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 784 788 { 785 789 uint64_t uDst = *puDst; 786 790 uint64_t uResult = uDst - uSrc; 787 791 *puDst = uResult; 788 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 64, uDst < uSrc, uSrc ^ RT_BIT_64(63)); 792 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 64, uDst < uSrc, uSrc ^ RT_BIT_64(63)); 793 return fEFlags; 789 794 } 790 795 791 796 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 792 797 793 IEM_DECL_IMPL_DEF( void, iemAImpl_sub_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))798 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sub_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 794 799 { 795 800 uint32_t uDst = *puDst; 796 801 uint32_t uResult = uDst - uSrc; 797 802 *puDst = uResult; 798 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 32, uDst < uSrc, uSrc ^ RT_BIT_32(31)); 799 } 800 801 802 IEM_DECL_IMPL_DEF(void, iemAImpl_sub_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 803 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 32, uDst < uSrc, uSrc ^ RT_BIT_32(31)); 804 return fEFlags; 805 } 806 807 808 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sub_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 803 809 { 804 810 uint16_t uDst = *puDst; 805 811 uint16_t uResult = uDst - uSrc; 806 812 *puDst = uResult; 807 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 16, uDst < uSrc, uSrc ^ (uint16_t)0x8000); 808 } 809 810 811 IEM_DECL_IMPL_DEF(void, iemAImpl_sub_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 813 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 16, uDst < uSrc, uSrc ^ (uint16_t)0x8000); 814 return fEFlags; 815 } 816 817 818 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sub_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 812 819 { 813 820 uint8_t uDst = *puDst; 814 821 uint8_t uResult = uDst - uSrc; 815 822 *puDst = uResult; 816 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 8, uDst < uSrc, uSrc ^ (uint8_t)0x80); 823 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 8, uDst < uSrc, uSrc ^ (uint8_t)0x80); 824 return fEFlags; 817 825 } 818 826 … … 824 832 */ 825 833 826 IEM_DECL_IMPL_DEF( void, iemAImpl_sbb_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))827 { 828 if (!( *pfEFlags & X86_EFL_CF))829 iemAImpl_sub_u64(puDst, uSrc, pfEFlags);834 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sbb_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 835 { 836 if (!(fEFlags & X86_EFL_CF)) 837 fEFlags = iemAImpl_sub_u64(fEFlags, puDst, uSrc); 830 838 else 831 839 { … … 833 841 uint64_t uResult = uDst - uSrc - 1; 834 842 *puDst = uResult; 835 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 64, uDst <= uSrc, uSrc ^ RT_BIT_64(63)); 836 } 843 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 64, uDst <= uSrc, uSrc ^ RT_BIT_64(63)); 844 } 845 return fEFlags; 837 846 } 838 847 839 848 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 840 849 841 IEM_DECL_IMPL_DEF( void, iemAImpl_sbb_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))842 { 843 if (!( *pfEFlags & X86_EFL_CF))844 iemAImpl_sub_u32(puDst, uSrc, pfEFlags);850 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sbb_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 851 { 852 if (!(fEFlags & X86_EFL_CF)) 853 fEFlags = iemAImpl_sub_u32(fEFlags, puDst, uSrc); 845 854 else 846 855 { … … 848 857 uint32_t uResult = uDst - uSrc - 1; 849 858 *puDst = uResult; 850 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 32, uDst <= uSrc, uSrc ^ RT_BIT_32(31)); 851 } 852 } 853 854 855 IEM_DECL_IMPL_DEF(void, iemAImpl_sbb_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 856 { 857 if (!(*pfEFlags & X86_EFL_CF)) 858 iemAImpl_sub_u16(puDst, uSrc, pfEFlags); 859 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 32, uDst <= uSrc, uSrc ^ RT_BIT_32(31)); 860 } 861 return fEFlags; 862 } 863 864 865 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sbb_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 866 { 867 if (!(fEFlags & X86_EFL_CF)) 868 fEFlags = iemAImpl_sub_u16(fEFlags, puDst, uSrc); 859 869 else 860 870 { … … 862 872 uint16_t uResult = uDst - uSrc - 1; 863 873 *puDst = uResult; 864 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 16, uDst <= uSrc, uSrc ^ (uint16_t)0x8000); 865 } 866 } 867 868 869 IEM_DECL_IMPL_DEF(void, iemAImpl_sbb_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 870 { 871 if (!(*pfEFlags & X86_EFL_CF)) 872 iemAImpl_sub_u8(puDst, uSrc, pfEFlags); 874 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 16, uDst <= uSrc, uSrc ^ (uint16_t)0x8000); 875 } 876 return fEFlags; 877 } 878 879 880 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_sbb_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 881 { 882 if (!(fEFlags & X86_EFL_CF)) 883 fEFlags = iemAImpl_sub_u8(fEFlags, puDst, uSrc); 873 884 else 874 885 { … … 876 887 uint8_t uResult = uDst - uSrc - 1; 877 888 *puDst = uResult; 878 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(pfEFlags, uResult, uDst, uSrc, 8, uDst <= uSrc, uSrc ^ (uint8_t)0x80); 879 } 889 IEM_EFL_UPDATE_STATUS_BITS_FOR_ARITHMETIC(fEFlags, uResult, uDst, uSrc, 8, uDst <= uSrc, uSrc ^ (uint8_t)0x80); 890 } 891 return fEFlags; 880 892 } 881 893 … … 887 899 */ 888 900 889 IEM_DECL_IMPL_DEF( void, iemAImpl_or_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))901 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_or_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 890 902 { 891 903 uint64_t uResult = *puDst | uSrc; 892 904 *puDst = uResult; 893 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 64, 0); 905 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 64, 0); 906 return fEFlags; 894 907 } 895 908 896 909 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 897 910 898 IEM_DECL_IMPL_DEF( void, iemAImpl_or_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))911 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_or_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 899 912 { 900 913 uint32_t uResult = *puDst | uSrc; 901 914 *puDst = uResult; 902 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 32, 0); 903 } 904 905 906 IEM_DECL_IMPL_DEF(void, iemAImpl_or_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 915 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 32, 0); 916 return fEFlags; 917 } 918 919 920 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_or_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 907 921 { 908 922 uint16_t uResult = *puDst | uSrc; 909 923 *puDst = uResult; 910 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 16, 0); 911 } 912 913 914 IEM_DECL_IMPL_DEF(void, iemAImpl_or_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 924 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 16, 0); 925 return fEFlags; 926 } 927 928 929 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_or_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 915 930 { 916 931 uint8_t uResult = *puDst | uSrc; 917 932 *puDst = uResult; 918 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 8, 0); 933 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 8, 0); 934 return fEFlags; 919 935 } 920 936 … … 925 941 */ 926 942 927 IEM_DECL_IMPL_DEF( void, iemAImpl_xor_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))943 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_xor_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 928 944 { 929 945 uint64_t uResult = *puDst ^ uSrc; 930 946 *puDst = uResult; 931 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 64, 0); 947 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 64, 0); 948 return fEFlags; 932 949 } 933 950 934 951 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 935 952 936 IEM_DECL_IMPL_DEF( void, iemAImpl_xor_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))953 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_xor_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 937 954 { 938 955 uint32_t uResult = *puDst ^ uSrc; 939 956 *puDst = uResult; 940 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 32, 0); 941 } 942 943 944 IEM_DECL_IMPL_DEF(void, iemAImpl_xor_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 957 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 32, 0); 958 return fEFlags; 959 } 960 961 962 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_xor_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 945 963 { 946 964 uint16_t uResult = *puDst ^ uSrc; 947 965 *puDst = uResult; 948 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 16, 0); 949 } 950 951 952 IEM_DECL_IMPL_DEF(void, iemAImpl_xor_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 966 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 16, 0); 967 return fEFlags; 968 } 969 970 971 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_xor_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 953 972 { 954 973 uint8_t uResult = *puDst ^ uSrc; 955 974 *puDst = uResult; 956 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 8, 0); 975 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 8, 0); 976 return fEFlags; 957 977 } 958 978 … … 963 983 */ 964 984 965 IEM_DECL_IMPL_DEF( void, iemAImpl_and_u64,(uint64_t *puDst, uint64_t uSrc, uint32_t *pfEFlags))985 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_and_u64,(uint32_t fEFlags, uint64_t *puDst, uint64_t uSrc)) 966 986 { 967 987 uint64_t const uResult = *puDst & uSrc; 968 988 *puDst = uResult; 969 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 64, 0); 989 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 64, 0); 990 return fEFlags; 970 991 } 971 992 972 993 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 973 994 974 IEM_DECL_IMPL_DEF( void, iemAImpl_and_u32,(uint32_t *puDst, uint32_t uSrc, uint32_t *pfEFlags))995 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_and_u32,(uint32_t fEFlags, uint32_t *puDst, uint32_t uSrc)) 975 996 { 976 997 uint32_t const uResult = *puDst & uSrc; 977 998 *puDst = uResult; 978 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 32, 0); 979 } 980 981 982 IEM_DECL_IMPL_DEF(void, iemAImpl_and_u16,(uint16_t *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 999 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 32, 0); 1000 return fEFlags; 1001 } 1002 1003 1004 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_and_u16,(uint32_t fEFlags, uint16_t *puDst, uint16_t uSrc)) 983 1005 { 984 1006 uint16_t const uResult = *puDst & uSrc; 985 1007 *puDst = uResult; 986 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 16, 0); 987 } 988 989 990 IEM_DECL_IMPL_DEF(void, iemAImpl_and_u8,(uint8_t *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 1008 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 16, 0); 1009 return fEFlags; 1010 } 1011 1012 1013 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_and_u8,(uint32_t fEFlags, uint8_t *puDst, uint8_t uSrc)) 991 1014 { 992 1015 uint8_t const uResult = *puDst & uSrc; 993 1016 *puDst = uResult; 994 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 8, 0); 1017 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 8, 0); 1018 return fEFlags; 995 1019 } 996 1020 … … 1006 1030 uint64_t const uResult = ~uSrc1 & uSrc2; 1007 1031 *puDst = uResult; 1008 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 64, 0); 1032 uint32_t fEFlags = *pfEFlags; 1033 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 64, 0); 1034 *pfEFlags = fEFlags; 1009 1035 } 1010 1036 … … 1014 1040 uint32_t const uResult = ~uSrc1 & uSrc2; 1015 1041 *puDst = uResult; 1016 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 32, 0); 1042 uint32_t fEFlags = *pfEFlags; 1043 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 32, 0); 1044 *pfEFlags = fEFlags; 1017 1045 } 1018 1046 … … 1039 1067 */ 1040 1068 1041 IEM_DECL_IMPL_DEF( void, iemAImpl_cmp_u64,(uint64_t const *puDst, uint64_t uSrc, uint32_t *pfEFlags))1069 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cmp_u64,(uint32_t fEFlags, uint64_t const *puDst, uint64_t uSrc)) 1042 1070 { 1043 1071 uint64_t uDstTmp = *puDst; 1044 iemAImpl_sub_u64(&uDstTmp, uSrc, pfEFlags);1072 return iemAImpl_sub_u64(fEFlags, &uDstTmp, uSrc); 1045 1073 } 1046 1074 1047 1075 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 1048 1076 1049 IEM_DECL_IMPL_DEF( void, iemAImpl_cmp_u32,(uint32_t const *puDst, uint32_t uSrc, uint32_t *pfEFlags))1077 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cmp_u32,(uint32_t fEFlags, uint32_t const *puDst, uint32_t uSrc)) 1050 1078 { 1051 1079 uint32_t uDstTmp = *puDst; 1052 iemAImpl_sub_u32(&uDstTmp, uSrc, pfEFlags);1053 } 1054 1055 1056 IEM_DECL_IMPL_DEF( void, iemAImpl_cmp_u16,(uint16_t const *puDst, uint16_t uSrc, uint32_t *pfEFlags))1080 return iemAImpl_sub_u32(fEFlags, &uDstTmp, uSrc); 1081 } 1082 1083 1084 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cmp_u16,(uint32_t fEFlags, uint16_t const *puDst, uint16_t uSrc)) 1057 1085 { 1058 1086 uint16_t uDstTmp = *puDst; 1059 iemAImpl_sub_u16(&uDstTmp, uSrc, pfEFlags);1060 } 1061 1062 1063 IEM_DECL_IMPL_DEF( void, iemAImpl_cmp_u8,(uint8_t const *puDst, uint8_t uSrc, uint32_t *pfEFlags))1087 return iemAImpl_sub_u16(fEFlags, &uDstTmp, uSrc); 1088 } 1089 1090 1091 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cmp_u8,(uint32_t fEFlags, uint8_t const *puDst, uint8_t uSrc)) 1064 1092 { 1065 1093 uint8_t uDstTmp = *puDst; 1066 iemAImpl_sub_u8(&uDstTmp, uSrc, pfEFlags);1094 return iemAImpl_sub_u8(fEFlags, &uDstTmp, uSrc); 1067 1095 } 1068 1096 … … 1073 1101 */ 1074 1102 1075 IEM_DECL_IMPL_DEF( void, iemAImpl_test_u64,(uint64_t const *puDst, uint64_t uSrc, uint32_t *pfEFlags))1103 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_test_u64,(uint32_t fEFlags, uint64_t const *puDst, uint64_t uSrc)) 1076 1104 { 1077 1105 uint64_t uResult = *puDst & uSrc; 1078 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 64, 0); 1106 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 64, 0); 1107 return fEFlags; 1079 1108 } 1080 1109 1081 1110 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 1082 1111 1083 IEM_DECL_IMPL_DEF( void, iemAImpl_test_u32,(uint32_t const *puDst, uint32_t uSrc, uint32_t *pfEFlags))1112 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_test_u32,(uint32_t fEFlags, uint32_t const *puDst, uint32_t uSrc)) 1084 1113 { 1085 1114 uint32_t uResult = *puDst & uSrc; 1086 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 32, 0); 1087 } 1088 1089 1090 IEM_DECL_IMPL_DEF(void, iemAImpl_test_u16,(uint16_t const *puDst, uint16_t uSrc, uint32_t *pfEFlags)) 1115 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 32, 0); 1116 return fEFlags; 1117 } 1118 1119 1120 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_test_u16,(uint32_t fEFlags, uint16_t const *puDst, uint16_t uSrc)) 1091 1121 { 1092 1122 uint16_t uResult = *puDst & uSrc; 1093 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 16, 0); 1094 } 1095 1096 1097 IEM_DECL_IMPL_DEF(void, iemAImpl_test_u8,(uint8_t const *puDst, uint8_t uSrc, uint32_t *pfEFlags)) 1123 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 16, 0); 1124 return fEFlags; 1125 } 1126 1127 1128 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_test_u8,(uint32_t fEFlags, uint8_t const *puDst, uint8_t uSrc)) 1098 1129 { 1099 1130 uint8_t uResult = *puDst & uSrc; 1100 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(pfEFlags, uResult, 8, 0); 1131 IEM_EFL_UPDATE_STATUS_BITS_FOR_LOGICAL(fEFlags, uResult, 8, 0); 1132 return fEFlags; 1101 1133 } 1102 1134 … … 1117 1149 { \ 1118 1150 uTmp = uOld; \ 1119 fEflTmp = *pfEFlags; \ 1120 iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth(&uTmp, uSrc, &fEflTmp); \ 1151 fEflTmp = iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth(fEFlagsIn, &uTmp, uSrc); \ 1121 1152 } while (!ASMAtomicCmpXchgExU ## a_cBitsWidth(puDst, uTmp, uOld, &uOld)); \ 1122 *pfEFlags =fEflTmp; \1153 return fEflTmp; \ 1123 1154 } while (0) 1124 1155 1125 1156 1126 1157 #define EMIT_LOCKED_BIN_OP(a_Mnemonic, a_cBitsWidth) \ 1127 IEM_DECL_IMPL_DEF( void, iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth ## _locked,(uint ## a_cBitsWidth ## _t *puDst, \1128 uint ## a_cBitsWidth ## _t uSrc, \1129 uint32_t *pfEFlags)) \1158 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth ## _locked,(uint32_t fEFlagsIn, \ 1159 uint ## a_cBitsWidth ## _t *puDst, \ 1160 uint ## a_cBitsWidth ## _t uSrc)) \ 1130 1161 { \ 1131 1162 DO_LOCKED_BIN_OP(a_Mnemonic, a_cBitsWidth); \ … … 1407 1438 1408 1439 1409 EMIT_LOCKED_BIN_OP(btc, 64) 1410 EMIT_LOCKED_BIN_OP(btr, 64) 1411 EMIT_LOCKED_BIN_OP(bts, 64) 1440 /** 64-bit locked binary operand operation. */ 1441 # define DO_LOCKED_BIN_TODO_OP(a_Mnemonic, a_cBitsWidth) \ 1442 do { \ 1443 uint ## a_cBitsWidth ## _t uOld = ASMAtomicUoReadU ## a_cBitsWidth(puDst); \ 1444 uint ## a_cBitsWidth ## _t uTmp; \ 1445 uint32_t fEflTmp; \ 1446 do \ 1447 { \ 1448 uTmp = uOld; \ 1449 fEflTmp = *pfEFlags; \ 1450 iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth(&uTmp, uSrc, &fEflTmp); \ 1451 } while (!ASMAtomicCmpXchgExU ## a_cBitsWidth(puDst, uTmp, uOld, &uOld)); \ 1452 *pfEFlags = fEflTmp; \ 1453 } while (0) 1454 1455 1456 #define EMIT_LOCKED_BIN_TODO_OP(a_Mnemonic, a_cBitsWidth) \ 1457 IEM_DECL_IMPL_DEF(void, iemAImpl_ ## a_Mnemonic ## _u ## a_cBitsWidth ## _locked,(uint ## a_cBitsWidth ## _t *puDst, \ 1458 uint ## a_cBitsWidth ## _t uSrc, \ 1459 uint32_t *pfEFlags)) \ 1460 { \ 1461 DO_LOCKED_BIN_TODO_OP(a_Mnemonic, a_cBitsWidth); \ 1462 } 1463 1464 1465 EMIT_LOCKED_BIN_TODO_OP(btc, 64) 1466 EMIT_LOCKED_BIN_TODO_OP(btr, 64) 1467 EMIT_LOCKED_BIN_TODO_OP(bts, 64) 1412 1468 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) 1413 EMIT_LOCKED_BIN_ OP(btc, 32)1414 EMIT_LOCKED_BIN_ OP(btr, 32)1415 EMIT_LOCKED_BIN_ OP(bts, 32)1416 1417 EMIT_LOCKED_BIN_ OP(btc, 16)1418 EMIT_LOCKED_BIN_ OP(btr, 16)1419 EMIT_LOCKED_BIN_ OP(bts, 16)1469 EMIT_LOCKED_BIN_TODO_OP(btc, 32) 1470 EMIT_LOCKED_BIN_TODO_OP(btr, 32) 1471 EMIT_LOCKED_BIN_TODO_OP(bts, 32) 1472 1473 EMIT_LOCKED_BIN_TODO_OP(btc, 16) 1474 EMIT_LOCKED_BIN_TODO_OP(btr, 16) 1475 EMIT_LOCKED_BIN_TODO_OP(bts, 16) 1420 1476 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */ 1421 1477 … … 1757 1813 uint32_t fEfl2 = fEfl1; \ 1758 1814 *puDst = uSrc; \ 1759 iemAImpl_sub_u ## a_cBits(&uSrc, 1, &fEfl1); \1760 iemAImpl_and_u ## a_cBits(puDst, uSrc, &fEfl2); \1815 fEfl1 = iemAImpl_sub_u ## a_cBits(fEfl1, &uSrc, 1); \ 1816 fEfl2 = iemAImpl_and_u ## a_cBits(fEfl2, puDst, uSrc); \ 1761 1817 \ 1762 1818 /* AMD: The carry flag is from the SUB operation. */ \ … … 1785 1841 uint32_t fEfl2 = fEfl1; \ 1786 1842 *puDst = uSrc; \ 1787 iemAImpl_sub_u ## a_cBits(&uSrc, 1, &fEfl1); \1788 iemAImpl_xor_u ## a_cBits(puDst, uSrc, &fEfl2); \1843 fEfl1 = iemAImpl_sub_u ## a_cBits(fEfl1, &uSrc, 1); \ 1844 fEfl2 = iemAImpl_xor_u ## a_cBits(fEfl2, puDst, uSrc); \ 1789 1845 \ 1790 1846 /* AMD: The carry flag is from the SUB operation. */ \ … … 1814 1870 *puDst = uSrc; \ 1815 1871 iemAImpl_neg_u ## a_cBits(&uSrc, &fEfl1); \ 1816 iemAImpl_and_u ## a_cBits(puDst, uSrc, &fEfl2); \1872 fEfl2 = iemAImpl_and_u ## a_cBits(fEfl2, puDst, uSrc); \ 1817 1873 \ 1818 1874 /* AMD: The carry flag is from the SUB operation. */ \ … … 2023 2079 a_Type uDst = *puDst; \ 2024 2080 a_Type uResult = uDst; \ 2025 iemAImpl_add_u ## a_cBitsWidth(&uResult, *puReg, pfEFlags); \2081 *pfEFlags = iemAImpl_add_u ## a_cBitsWidth(*pfEFlags, &uResult, *puReg); \ 2026 2082 *puDst = uResult; \ 2027 2083 *puReg = uDst; \ … … 2036 2092 { \ 2037 2093 uResult = uOld; \ 2038 fEflTmp = *pfEFlags; \ 2039 iemAImpl_add_u ## a_cBitsWidth(&uResult, *puReg, &fEflTmp); \ 2094 fEflTmp = iemAImpl_add_u ## a_cBitsWidth(*pfEFlags, &uResult, *puReg); \ 2040 2095 } while (!ASMAtomicCmpXchgExU ## a_cBitsWidth(puDst, uResult, uOld, &uOld)); \ 2041 2096 *puReg = uOld; \ … … 2064 2119 if (ASMAtomicCmpXchgExU8(pu8Dst, uSrcReg, uOld, puAl)) 2065 2120 Assert(*puAl == uOld); 2066 iemAImpl_cmp_u8(&uOld, *puAl, pEFlags);2121 *pEFlags = iemAImpl_cmp_u8(*pEFlags, &uOld, *puAl); 2067 2122 } 2068 2123 … … 2073 2128 if (ASMAtomicCmpXchgExU16(pu16Dst, uSrcReg, uOld, puAx)) 2074 2129 Assert(*puAx == uOld); 2075 iemAImpl_cmp_u16(&uOld, *puAx, pEFlags);2130 *pEFlags = iemAImpl_cmp_u16(*pEFlags, &uOld, *puAx); 2076 2131 } 2077 2132 … … 2082 2137 if (ASMAtomicCmpXchgExU32(pu32Dst, uSrcReg, uOld, puEax)) 2083 2138 Assert(*puEax == uOld); 2084 iemAImpl_cmp_u32(&uOld, *puEax, pEFlags);2139 *pEFlags = iemAImpl_cmp_u32(*pEFlags, &uOld, *puEax); 2085 2140 } 2086 2141 … … 2098 2153 if (ASMAtomicCmpXchgExU64(pu64Dst, uSrcReg, uOld, puRax)) 2099 2154 Assert(*puRax == uOld); 2100 iemAImpl_cmp_u64(&uOld, *puRax, pEFlags);2155 *pEFlags = iemAImpl_cmp_u64(*pEFlags, &uOld, *puRax); 2101 2156 } 2102 2157 … … 2185 2240 { 2186 2241 *pu16Dst = uSrcReg; 2187 iemAImpl_cmp_u16(&uOld, uOld, pEFlags);2242 *pEFlags = iemAImpl_cmp_u16(*pEFlags, &uOld, uOld); 2188 2243 } 2189 2244 else 2190 2245 { 2191 2246 *puAx = uDst; 2192 iemAImpl_cmp_u16(&uOld, uDst, pEFlags);2247 *pEFlags = iemAImpl_cmp_u16(*pEFlags, &uOld, uDst); 2193 2248 } 2194 2249 } … … 2211 2266 { 2212 2267 *pu32Dst = uSrcReg; 2213 iemAImpl_cmp_u32(&uOld, uOld, pEFlags);2268 *pEFlags = iemAImpl_cmp_u32(*pEFlags, &uOld, uOld); 2214 2269 } 2215 2270 else 2216 2271 { 2217 2272 *puEax = uDst; 2218 iemAImpl_cmp_u32(&uOld, uDst, pEFlags);2273 *pEFlags = iemAImpl_cmp_u32(*pEFlags, &uOld, uDst); 2219 2274 } 2220 2275 } … … 2239 2294 { 2240 2295 *pu64Dst = uSrc; 2241 iemAImpl_cmp_u64(&uOld, uOld, pEFlags);2296 *pEFlags = iemAImpl_cmp_u64(*pEFlags, &uOld, uOld); 2242 2297 } 2243 2298 else 2244 2299 { 2245 2300 *puRax = uDst; 2246 iemAImpl_cmp_u64(&uOld, uDst, pEFlags);2301 *pEFlags = iemAImpl_cmp_u64(*pEFlags, &uOld, uDst); 2247 2302 } 2248 2303 } … … 2264 2319 { 2265 2320 *pu64Dst = uSrcReg; 2266 iemAImpl_cmp_u64(&uOld, uOld, pEFlags);2321 *pEFlags = iemAImpl_cmp_u64(*pEFlags, &uOld, uOld); 2267 2322 } 2268 2323 else 2269 2324 { 2270 2325 *puRax = uDst; 2271 iemAImpl_cmp_u64(&uOld, uDst, pEFlags);2326 *pEFlags = iemAImpl_cmp_u64(*pEFlags, &uOld, uDst); 2272 2327 } 2273 2328 } -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp
r103734 r104195 255 255 static void iemHlpUpdateArithEFlagsU8(PVMCPUCC pVCpu, uint8_t u8Result, uint32_t fToUpdate, uint32_t fUndefined) 256 256 { 257 uint32_t fEFlags = pVCpu->cpum.GstCtx.eflags.u; 258 iemAImpl_test_u8(&u8Result, u8Result, &fEFlags); 257 uint32_t fEFlags = iemAImpl_test_u8(pVCpu->cpum.GstCtx.eflags.u, &u8Result, u8Result); 259 258 pVCpu->cpum.GstCtx.eflags.u &= ~(fToUpdate | fUndefined); 260 259 pVCpu->cpum.GstCtx.eflags.u |= (fToUpdate | fUndefined) & fEFlags; … … 272 271 static void iemHlpUpdateArithEFlagsU16(PVMCPUCC pVCpu, uint16_t u16Result, uint32_t fToUpdate, uint32_t fUndefined) 273 272 { 274 uint32_t fEFlags = pVCpu->cpum.GstCtx.eflags.u; 275 iemAImpl_test_u16(&u16Result, u16Result, &fEFlags); 273 uint32_t fEFlags = iemAImpl_test_u16(pVCpu->cpum.GstCtx.eflags.u, &u16Result, u16Result); 276 274 pVCpu->cpum.GstCtx.eflags.u &= ~(fToUpdate | fUndefined); 277 275 pVCpu->cpum.GstCtx.eflags.u |= (fToUpdate | fUndefined) & fEFlags; … … 8430 8428 || (pVCpu->cpum.GstCtx.ax & 0xf) >= 10) 8431 8429 { 8432 iemAImpl_add_u16(&pVCpu->cpum.GstCtx.ax, 0x106, &pVCpu->cpum.GstCtx.eflags.uBoth);8430 pVCpu->cpum.GstCtx.eflags.uBoth = iemAImpl_add_u16(pVCpu->cpum.GstCtx.eflags.uBoth, &pVCpu->cpum.GstCtx.ax, 0x106); 8433 8431 pVCpu->cpum.GstCtx.eflags.Bits.u1AF = 1; 8434 8432 pVCpu->cpum.GstCtx.eflags.Bits.u1CF = 1; … … 8474 8472 || (pVCpu->cpum.GstCtx.ax & 0xf) >= 10) 8475 8473 { 8476 iemAImpl_sub_u16(&pVCpu->cpum.GstCtx.ax, 0x106, &pVCpu->cpum.GstCtx.eflags.uBoth);8474 pVCpu->cpum.GstCtx.eflags.uBoth = iemAImpl_sub_u16(pVCpu->cpum.GstCtx.eflags.uBoth, &pVCpu->cpum.GstCtx.ax, 0x106); 8477 8475 pVCpu->cpum.GstCtx.eflags.Bits.u1AF = 1; 8478 8476 pVCpu->cpum.GstCtx.eflags.Bits.u1CF = 1; -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
r102430 r104195 221 221 { 222 222 /* All matches, only compare the last itme to get the right eflags. */ 223 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&puSrc1Mem[cLeftPage-1], puSrc2Mem[cLeftPage-1], &uEFlags);223 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&puSrc1Mem[cLeftPage-1], puSrc2Mem[cLeftPage-1]); 224 224 uSrc1AddrReg += cLeftPage * cbIncr; 225 225 uSrc2AddrReg += cLeftPage * cbIncr; … … 233 233 do 234 234 { 235 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&puSrc1Mem[off], puSrc2Mem[off], &uEFlags);235 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&puSrc1Mem[off], puSrc2Mem[off]); 236 236 off++; 237 237 } while ( off < cLeftPage … … 275 275 if (rcStrict != VINF_SUCCESS) 276 276 return rcStrict; 277 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(&uValue1, uValue2, &uEFlags);277 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, &uValue1, uValue2); 278 278 279 279 pVCpu->cpum.GstCtx.ADDR_rSI = uSrc1AddrReg += cbIncr; … … 387 387 { 388 388 /* All matches, only compare the last item to get the right eflags. */ 389 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&puSrc1Mem[cLeftPage-1], puSrc2Mem[cLeftPage-1], &uEFlags);389 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&puSrc1Mem[cLeftPage-1], puSrc2Mem[cLeftPage-1]); 390 390 uSrc1AddrReg += cLeftPage * cbIncr; 391 391 uSrc2AddrReg += cLeftPage * cbIncr; … … 399 399 do 400 400 { 401 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&puSrc1Mem[off], puSrc2Mem[off], &uEFlags);401 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&puSrc1Mem[off], puSrc2Mem[off]); 402 402 off++; 403 403 } while ( off < cLeftPage … … 441 441 if (rcStrict != VINF_SUCCESS) 442 442 return rcStrict; 443 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(&uValue1, uValue2, &uEFlags);443 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, &uValue1, uValue2); 444 444 445 445 pVCpu->cpum.GstCtx.ADDR_rSI = uSrc1AddrReg += cbIncr; … … 538 538 539 539 /* Update the regs. */ 540 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&uValueReg, uTmpValue, &uEFlags);540 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&uValueReg, uTmpValue); 541 541 pVCpu->cpum.GstCtx.ADDR_rCX = uCounterReg -= i; 542 542 pVCpu->cpum.GstCtx.ADDR_rDI = uAddrReg += i * cbIncr; … … 570 570 if (rcStrict != VINF_SUCCESS) 571 571 return rcStrict; 572 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&uValueReg, uTmpValue, &uEFlags);572 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&uValueReg, uTmpValue); 573 573 574 574 pVCpu->cpum.GstCtx.ADDR_rDI = uAddrReg += cbIncr; … … 666 666 667 667 /* Update the regs. */ 668 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&uValueReg, uTmpValue, &uEFlags);668 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&uValueReg, uTmpValue); 669 669 pVCpu->cpum.GstCtx.ADDR_rCX = uCounterReg -= i; 670 670 pVCpu->cpum.GstCtx.ADDR_rDI = uAddrReg += i * cbIncr; … … 698 698 if (rcStrict != VINF_SUCCESS) 699 699 return rcStrict; 700 RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)((OP_TYPE *)&uValueReg, uTmpValue, &uEFlags);700 uEFlags = RT_CONCAT(iemAImpl_cmp_u,OP_SIZE)(uEFlags, (OP_TYPE *)&uValueReg, uTmpValue); 701 701 pVCpu->cpum.GstCtx.ADDR_rDI = uAddrReg += cbIncr; 702 702 pVCpu->cpum.GstCtx.ADDR_rCX = --uCounterReg; -
trunk/src/VBox/VMM/VMMAll/IEMAllInstCommon.cpp.h
r104132 r104195 46 46 47 47 /** Function table for the BSF instruction. */ 48 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsf =48 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsf = 49 49 { 50 50 NULL, NULL, … … 55 55 56 56 /** Function table for the BSF instruction, AMD EFLAGS variant. */ 57 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsf_amd =57 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsf_amd = 58 58 { 59 59 NULL, NULL, … … 64 64 65 65 /** Function table for the BSF instruction, Intel EFLAGS variant. */ 66 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsf_intel =66 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsf_intel = 67 67 { 68 68 NULL, NULL, … … 73 73 74 74 /** EFLAGS variation selection table for the BSF instruction. */ 75 IEM_STATIC const IEMOPBIN SIZES * const g_iemAImpl_bsf_eflags[] =75 IEM_STATIC const IEMOPBINTODOSIZES * const g_iemAImpl_bsf_eflags[] = 76 76 { 77 77 &g_iemAImpl_bsf, … … 82 82 83 83 /** Function table for the BSR instruction. */ 84 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsr =84 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsr = 85 85 { 86 86 NULL, NULL, … … 91 91 92 92 /** Function table for the BSR instruction, AMD EFLAGS variant. */ 93 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsr_amd =93 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsr_amd = 94 94 { 95 95 NULL, NULL, … … 100 100 101 101 /** Function table for the BSR instruction, Intel EFLAGS variant. */ 102 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_bsr_intel =102 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_bsr_intel = 103 103 { 104 104 NULL, NULL, … … 109 109 110 110 /** EFLAGS variation selection table for the BSR instruction. */ 111 IEM_STATIC const IEMOPBIN SIZES * const g_iemAImpl_bsr_eflags[] =111 IEM_STATIC const IEMOPBINTODOSIZES * const g_iemAImpl_bsr_eflags[] = 112 112 { 113 113 &g_iemAImpl_bsr, … … 118 118 119 119 /** Function table for the IMUL instruction. */ 120 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_imul_two =120 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_imul_two = 121 121 { 122 122 NULL, NULL, … … 127 127 128 128 /** Function table for the IMUL instruction, AMD EFLAGS variant. */ 129 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_imul_two_amd =129 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_imul_two_amd = 130 130 { 131 131 NULL, NULL, … … 136 136 137 137 /** Function table for the IMUL instruction, Intel EFLAGS variant. */ 138 IEM_STATIC const IEMOPBIN SIZES g_iemAImpl_imul_two_intel =138 IEM_STATIC const IEMOPBINTODOSIZES g_iemAImpl_imul_two_intel = 139 139 { 140 140 NULL, NULL, … … 145 145 146 146 /** EFLAGS variation selection table for the IMUL instruction. */ 147 IEM_STATIC const IEMOPBIN SIZES * const g_iemAImpl_imul_two_eflags[] =147 IEM_STATIC const IEMOPBINTODOSIZES * const g_iemAImpl_imul_two_eflags[] = 148 148 { 149 149 &g_iemAImpl_imul_two, … … 154 154 155 155 /** EFLAGS variation selection table for the 16-bit IMUL instruction. */ 156 IEM_STATIC PFNIEMAIMPLBIN U16 const g_iemAImpl_imul_two_u16_eflags[] =156 IEM_STATIC PFNIEMAIMPLBINTODOU16 const g_iemAImpl_imul_two_u16_eflags[] = 157 157 { 158 158 iemAImpl_imul_two_u16, … … 163 163 164 164 /** EFLAGS variation selection table for the 32-bit IMUL instruction. */ 165 IEM_STATIC PFNIEMAIMPLBIN U32 const g_iemAImpl_imul_two_u32_eflags[] =165 IEM_STATIC PFNIEMAIMPLBINTODOU32 const g_iemAImpl_imul_two_u32_eflags[] = 166 166 { 167 167 iemAImpl_imul_two_u32, … … 172 172 173 173 /** EFLAGS variation selection table for the 64-bit IMUL instruction. */ 174 IEM_STATIC PFNIEMAIMPLBIN U64 const g_iemAImpl_imul_two_u64_eflags[] =174 IEM_STATIC PFNIEMAIMPLBINTODOU64 const g_iemAImpl_imul_two_u64_eflags[] = 175 175 { 176 176 iemAImpl_imul_two_u64, -
trunk/src/VBox/VMM/VMMAll/IEMAllInstCommonBodyMacros.h
r104018 r104195 32 32 */ 33 33 34 35 /**36 * Special case body for word/dword/qword instruction like SUB and XOR that can37 * be used to zero a register.38 *39 * This can be used both for the rv_rm and rm_rv forms since it's working on the40 * same register.41 */42 #define IEMOP_BODY_BINARY_rv_SAME_REG_ZERO(a_bRm) \43 if ( (a_bRm >> X86_MODRM_REG_SHIFT) == ((a_bRm & X86_MODRM_RM_MASK) | (X86_MOD_REG << X86_MODRM_REG_SHIFT)) \44 && pVCpu->iem.s.uRexReg == pVCpu->iem.s.uRexB) \45 { \46 switch (pVCpu->iem.s.enmEffOpSize) \47 { \48 case IEMMODE_16BIT: \49 IEM_MC_BEGIN(0, 0); \50 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \51 IEM_MC_STORE_GREG_U16_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \52 IEM_MC_LOCAL_EFLAGS(fEFlags); \53 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \54 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \55 IEM_MC_COMMIT_EFLAGS(fEFlags); \56 IEM_MC_ADVANCE_RIP_AND_FINISH(); \57 IEM_MC_END(); \58 break; \59 \60 case IEMMODE_32BIT: \61 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \62 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \63 IEM_MC_STORE_GREG_U32_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \64 IEM_MC_LOCAL_EFLAGS(fEFlags); \65 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \66 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \67 IEM_MC_COMMIT_EFLAGS(fEFlags); \68 IEM_MC_ADVANCE_RIP_AND_FINISH(); \69 IEM_MC_END(); \70 break; \71 \72 case IEMMODE_64BIT: \73 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \74 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \75 IEM_MC_STORE_GREG_U64_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \76 IEM_MC_LOCAL_EFLAGS(fEFlags); \77 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \78 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \79 IEM_MC_COMMIT_EFLAGS(fEFlags); \80 IEM_MC_ADVANCE_RIP_AND_FINISH(); \81 IEM_MC_END(); \82 break; \83 \84 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \85 } \86 } ((void)0)87 34 88 35 /** … … 103 50 IEM_MC_BEGIN(a_f16BitMcFlag, 0); \ 104 51 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 105 IEM_MC_ARG(uint16_t, u16Src, 1); \52 IEM_MC_ARG(uint16_t, u16Src, 2); \ 106 53 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 107 54 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 113 60 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 114 61 } IEM_MC_NATIVE_ELSE() { \ 115 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \62 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 116 63 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 117 IEM_MC_ARG (uint32_t *, pEFlags, 2); \118 IEM_MC_ REF_EFLAGS(pEFlags); \119 IEM_MC_C ALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \64 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 65 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU16, fEFlagsIn, pu16Dst, u16Src); \ 66 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 120 67 } IEM_MC_NATIVE_ENDIF(); \ 121 68 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 126 73 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 127 74 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 128 IEM_MC_ARG(uint32_t, u32Src, 1); \75 IEM_MC_ARG(uint32_t, u32Src, 2); \ 129 76 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 130 77 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 136 83 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 137 84 } IEM_MC_NATIVE_ELSE() { \ 138 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \85 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 139 86 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 140 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 141 IEM_MC_REF_EFLAGS(pEFlags); \ 142 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \ 87 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 88 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU32, fEFlagsIn, pu32Dst, u32Src); \ 143 89 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 90 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 144 91 } IEM_MC_NATIVE_ENDIF(); \ 145 92 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 150 97 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 151 98 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 152 IEM_MC_ARG(uint64_t, u64Src, 1); \99 IEM_MC_ARG(uint64_t, u64Src, 2); \ 153 100 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 154 101 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 160 107 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 161 108 } IEM_MC_NATIVE_ELSE() { \ 162 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \109 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 163 110 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 164 IEM_MC_ARG (uint32_t *, pEFlags, 2); \165 IEM_MC_ REF_EFLAGS(pEFlags); \166 IEM_MC_C ALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \111 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 112 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU64, fEFlagsIn, pu64Dst, u64Src); \ 113 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 167 114 } IEM_MC_NATIVE_ENDIF(); \ 168 115 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 185 132 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 186 133 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 187 IEM_MC_ARG(uint16_t, u16Src, 1); \134 IEM_MC_ARG(uint16_t, u16Src, 2); \ 188 135 IEM_MC_FETCH_MEM_U16(u16Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 189 136 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 195 142 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 196 143 } IEM_MC_NATIVE_ELSE() { \ 197 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \144 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 198 145 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 199 IEM_MC_ARG (uint32_t *, pEFlags, 2); \200 IEM_MC_ REF_EFLAGS(pEFlags); \201 IEM_MC_C ALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \146 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 147 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU16, fEFlagsIn, pu16Dst, u16Src); \ 148 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 202 149 } IEM_MC_NATIVE_ENDIF(); \ 203 150 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 210 157 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 211 158 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 212 IEM_MC_ARG(uint32_t, u32Src, 1); \159 IEM_MC_ARG(uint32_t, u32Src, 2); \ 213 160 IEM_MC_FETCH_MEM_U32(u32Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 214 161 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 220 167 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 221 168 } IEM_MC_NATIVE_ELSE() { \ 222 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \ 223 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 169 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 224 170 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 225 IEM_MC_ REF_EFLAGS(pEFlags); \226 IEM_MC_CALL_ VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \171 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 172 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU32, fEFlagsIn, pu32Dst, u32Src); \ 227 173 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 174 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 228 175 } IEM_MC_NATIVE_ENDIF(); \ 229 176 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 236 183 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 237 184 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 238 IEM_MC_ARG(uint64_t, u64Src, 1); \185 IEM_MC_ARG(uint64_t, u64Src, 2); \ 239 186 IEM_MC_FETCH_MEM_U64(u64Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 240 187 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 246 193 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 247 194 } IEM_MC_NATIVE_ELSE() { \ 248 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \ 249 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 195 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 250 196 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 251 IEM_MC_REF_EFLAGS(pEFlags); \ 252 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \ 197 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 198 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU64, fEFlagsIn, pu64Dst, u64Src); \ 199 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 253 200 } IEM_MC_NATIVE_ENDIF(); \ 254 201 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 261 208 (void)0 262 209 210 263 211 /** 264 * Body for word/dword/qword the instruction CMP, ++ with a register as the265 * destination.212 * Body for word/dword/qword instructions like ADD, AND, OR, ++ with a register 213 * as the destination. 266 214 * 267 215 * @note Used both in OneByte and TwoByte0f. 268 216 */ 269 #define IEMOP_BODY_BINARY_ rv_rm_RO(a_bRm, a_InsNm, a_fNativeArchs) \217 #define IEMOP_BODY_BINARY_TODO_rv_rm(a_bRm, a_fnNormalU16, a_fnNormalU32, a_fnNormalU64, a_f16BitMcFlag, a_EmitterBasename, a_fNativeArchs) \ 270 218 /* \ 271 219 * If rm is denoting a register, no more instruction bytes. \ … … 276 224 { \ 277 225 case IEMMODE_16BIT: \ 278 IEM_MC_BEGIN( 0, 0); \226 IEM_MC_BEGIN(a_f16BitMcFlag, 0); \ 279 227 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 280 228 IEM_MC_ARG(uint16_t, u16Src, 1); \ … … 284 232 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 285 233 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 286 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 234 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 235 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 287 236 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 288 237 } IEM_MC_NATIVE_ELSE() { \ … … 291 240 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 292 241 IEM_MC_REF_EFLAGS(pEFlags); \ 293 IEM_MC_CALL_VOID_AIMPL_3( RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \242 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \ 294 243 } IEM_MC_NATIVE_ENDIF(); \ 295 244 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 306 255 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 307 256 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 308 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 257 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 258 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 309 259 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 310 260 } IEM_MC_NATIVE_ELSE() { \ … … 313 263 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 314 264 IEM_MC_REF_EFLAGS(pEFlags); \ 315 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 265 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \ 266 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 316 267 } IEM_MC_NATIVE_ENDIF(); \ 317 268 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 328 279 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 329 280 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 330 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 281 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 282 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 331 283 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 332 284 } IEM_MC_NATIVE_ELSE() { \ … … 335 287 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 336 288 IEM_MC_REF_EFLAGS(pEFlags); \ 337 IEM_MC_CALL_VOID_AIMPL_3( RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \289 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \ 338 290 } IEM_MC_NATIVE_ENDIF(); \ 339 291 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 352 304 { \ 353 305 case IEMMODE_16BIT: \ 354 IEM_MC_BEGIN( 0, 0); \306 IEM_MC_BEGIN(a_f16BitMcFlag, 0); \ 355 307 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 356 308 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ … … 362 314 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 363 315 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 364 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 316 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 317 IEM_MC_STORE_GREG_U16(IEM_GET_MODRM_REG(pVCpu, bRm), u16Dst); \ 365 318 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 366 319 } IEM_MC_NATIVE_ELSE() { \ … … 369 322 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 370 323 IEM_MC_REF_EFLAGS(pEFlags); \ 371 IEM_MC_CALL_VOID_AIMPL_3( RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \324 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \ 372 325 } IEM_MC_NATIVE_ENDIF(); \ 373 326 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 386 339 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 387 340 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 388 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 341 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 342 IEM_MC_STORE_GREG_U32(IEM_GET_MODRM_REG(pVCpu, bRm), u32Dst); \ 389 343 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 390 344 } IEM_MC_NATIVE_ELSE() { \ … … 393 347 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 394 348 IEM_MC_REF_EFLAGS(pEFlags); \ 395 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 349 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \ 350 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 396 351 } IEM_MC_NATIVE_ENDIF(); \ 397 352 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 410 365 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 411 366 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 412 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 367 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_EmitterBasename,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 368 IEM_MC_STORE_GREG_U64(IEM_GET_MODRM_REG(pVCpu, bRm), u64Dst); \ 413 369 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 414 370 } IEM_MC_NATIVE_ELSE() { \ … … 417 373 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 418 374 IEM_MC_REF_EFLAGS(pEFlags); \ 419 IEM_MC_CALL_VOID_AIMPL_3( RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \375 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \ 420 376 } IEM_MC_NATIVE_ENDIF(); \ 421 377 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstOneByte.cpp.h
r104117 r104195 91 91 IEM_MC_BEGIN(0, 0); \ 92 92 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 93 IEM_MC_ARG(uint8_t, u8Src, 1); \93 IEM_MC_ARG(uint8_t, u8Src, 2); \ 94 94 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 95 95 IEM_MC_NATIVE_IF(a_fRegRegNativeArchs) { \ … … 101 101 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 102 102 } IEM_MC_NATIVE_ELSE() { \ 103 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \103 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 104 104 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 105 IEM_MC_ARG (uint32_t *, pEFlags, 2); \106 IEM_MC_ REF_EFLAGS(pEFlags); \107 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \105 IEM_MC_ARG_EFLAGS( fEFlags, 0); \ 106 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlags, pu8Dst, u8Src); \ 107 IEM_MC_COMMIT_EFLAGS_OPT(fEFlagsRet); \ 108 108 } IEM_MC_NATIVE_ENDIF(); \ 109 109 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 114 114 /* \ 115 115 * We're accessing memory. \ 116 * Note! We're putting the eflags on the stack here so we can commit them \117 * after the memory. \118 116 */ \ 119 117 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK) || (pVCpu->iem.s.fExec & IEM_F_X86_DISREGARD_LOCK)) \ 120 118 { \ 121 119 IEM_MC_BEGIN(0, 0); \ 122 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \ 123 IEM_MC_ARG(uint8_t, u8Src, 1); \ 124 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 125 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 126 \ 120 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 127 121 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 128 122 IEMOP_HLP_DONE_DECODING(); \ 123 \ 124 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 125 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 129 126 IEM_MC_MEM_MAP_U8_RW(pu8Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 127 IEM_MC_ARG(uint8_t, u8Src, 2); \ 130 128 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 131 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \132 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \129 IEM_MC_ARG_EFLAGS( fEFlags, 0); \ 130 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlags, pu8Dst, u8Src); \ 133 131 \ 134 132 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 135 IEM_MC_COMMIT_EFLAGS( EFlags); \133 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 136 134 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 137 135 IEM_MC_END(); \ … … 140 138 { \ 141 139 IEM_MC_BEGIN(0, 0); \ 142 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \143 IEM_MC_ARG(uint8_t, u8Src, 1); \144 140 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 145 IEM_MC_LOCAL(uint8_t, bMapInfoDst); \146 \147 141 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 148 142 IEMOP_HLP_DONE_DECODING(); \ 143 \ 144 IEM_MC_LOCAL(uint8_t, bMapInfoDst); \ 145 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 149 146 IEM_MC_MEM_MAP_U8_ATOMIC(pu8Dst, bMapInfoDst, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 147 IEM_MC_ARG(uint8_t, u8Src, 2); \ 150 148 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 151 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \152 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8_locked), pu8Dst, u8Src, pEFlags); \149 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 150 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8_locked), fEFlagsIn, pu8Dst, u8Src); \ 153 151 \ 154 152 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bMapInfoDst); \ 155 IEM_MC_COMMIT_EFLAGS( EFlags); \153 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 156 154 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 157 155 IEM_MC_END(); \ … … 172 170 IEM_MC_BEGIN(0, 0); \ 173 171 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 174 IEM_MC_ARG(uint8_t, u8Src, 1); \172 IEM_MC_ARG(uint8_t, u8Src, 2); \ 175 173 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 176 174 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 181 179 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 182 180 } IEM_MC_NATIVE_ELSE() { \ 183 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \181 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 184 182 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 185 IEM_MC_ARG (uint32_t *, pEFlags, 2); \186 IEM_MC_ REF_EFLAGS(pEFlags); \187 IEM_MC_C ALL_VOID_AIMPL_3(a_fnNormalU8, pu8Dst, u8Src, pEFlags); \183 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 184 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU8, fEFlagsIn, pu8Dst, u8Src); \ 185 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 188 186 } IEM_MC_NATIVE_ENDIF(); \ 189 187 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 194 192 /* \ 195 193 * We're accessing memory. \ 196 * Note! We're putting the eflags on the stack here so we can commit them \197 * after the memory. \198 194 */ \ 199 195 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) \ … … 213 209 } IEM_MC_NATIVE_ELSE() { \ 214 210 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 215 IEM_MC_ARG(uint8_t const *, pu8Dst, 0); \211 IEM_MC_ARG(uint8_t const *, pu8Dst, 1); \ 216 212 IEM_MC_MEM_MAP_U8_RO(pu8Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 217 IEM_MC_ARG(uint8_t, u8Src, 1); \213 IEM_MC_ARG(uint8_t, u8Src, 2); \ 218 214 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 219 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \220 IEM_MC_CALL_ VOID_AIMPL_3(a_fnNormalU8, pu8Dst, u8Src, pEFlags); \215 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 216 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, a_fnNormalU8, fEFlagsIn, pu8Dst, u8Src); \ 221 217 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 222 IEM_MC_COMMIT_EFLAGS( EFlags); \218 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 223 219 } IEM_MC_NATIVE_ENDIF(); \ 224 220 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 246 242 IEM_MC_BEGIN(0, 0); \ 247 243 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 248 IEM_MC_ARG(uint8_t, u8Src, 1); \244 IEM_MC_ARG(uint8_t, u8Src, 2); \ 249 245 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 250 246 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 256 252 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 257 253 } IEM_MC_NATIVE_ELSE() { \ 258 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \254 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 259 255 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 260 IEM_MC_ARG (uint32_t *, pEFlags, 2); \261 IEM_MC_ REF_EFLAGS(pEFlags); \262 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \256 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 257 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 258 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 263 259 } IEM_MC_NATIVE_ENDIF(); \ 264 260 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 274 270 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 275 271 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 276 IEM_MC_ARG(uint8_t, u8Src, 1); \272 IEM_MC_ARG(uint8_t, u8Src, 2); \ 277 273 IEM_MC_FETCH_MEM_U8(u8Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 278 274 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 284 280 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 285 281 } IEM_MC_NATIVE_ELSE() { \ 286 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \282 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 287 283 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 288 IEM_MC_ARG (uint32_t *, pEFlags, 2); \289 IEM_MC_ REF_EFLAGS(pEFlags); \290 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \284 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 285 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 286 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 291 287 } IEM_MC_NATIVE_ENDIF(); \ 292 288 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 306 302 IEM_MC_BEGIN(0, 0); \ 307 303 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 308 IEM_MC_ARG(uint8_t, u8Src, 1); \304 IEM_MC_ARG(uint8_t, u8Src, 2); \ 309 305 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 310 306 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 315 311 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 316 312 } IEM_MC_NATIVE_ELSE() { \ 317 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \313 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 318 314 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 319 IEM_MC_ARG (uint32_t *, pEFlags, 2); \320 IEM_MC_ REF_EFLAGS(pEFlags); \321 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \315 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 316 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 317 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 322 318 } IEM_MC_NATIVE_ENDIF(); \ 323 319 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 333 329 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 334 330 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 335 IEM_MC_ARG(uint8_t, u8Src, 1); \331 IEM_MC_ARG(uint8_t, u8Src, 2); \ 336 332 IEM_MC_FETCH_MEM_U8(u8Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 337 333 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 342 338 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 343 339 } IEM_MC_NATIVE_ELSE() { \ 344 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \340 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 345 341 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 346 IEM_MC_ARG (uint32_t *, pEFlags, 2); \347 IEM_MC_ REF_EFLAGS(pEFlags); \348 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \342 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 343 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 344 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 349 345 } IEM_MC_NATIVE_ENDIF(); \ 350 346 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 369 365 IEM_MC_BEGIN(0, 0); \ 370 366 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 371 IEM_MC_ARG(uint16_t, u16Src, 1); \367 IEM_MC_ARG(uint16_t, u16Src, 2); \ 372 368 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 373 369 IEM_MC_NATIVE_IF(a_fRegRegNativeArchs) { \ 374 IEM_MC_LOCAL(uint16_t, 370 IEM_MC_LOCAL(uint16_t, u16Dst); \ 375 371 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 376 372 IEM_MC_LOCAL_EFLAGS(uEFlags); \ … … 379 375 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 380 376 } IEM_MC_NATIVE_ELSE() { \ 381 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \377 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 382 378 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 383 IEM_MC_ARG (uint32_t *, pEFlags, 2); \384 IEM_MC_ REF_EFLAGS(pEFlags); \385 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \379 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 380 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 381 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 386 382 } IEM_MC_NATIVE_ENDIF(); \ 387 383 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 392 388 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 393 389 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 394 IEM_MC_ARG(uint32_t, u32Src, 1); \390 IEM_MC_ARG(uint32_t, u32Src, 2); \ 395 391 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 396 392 IEM_MC_NATIVE_IF(a_fRegRegNativeArchs) { \ 397 IEM_MC_LOCAL(uint32_t, 393 IEM_MC_LOCAL(uint32_t, u32Dst); \ 398 394 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 399 395 IEM_MC_LOCAL_EFLAGS(uEFlags); \ … … 402 398 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 403 399 } IEM_MC_NATIVE_ELSE() { \ 404 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \400 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 405 401 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 406 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 407 IEM_MC_REF_EFLAGS(pEFlags); \ 408 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 402 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 403 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 409 404 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 405 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 410 406 } IEM_MC_NATIVE_ENDIF(); \ 411 407 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 416 412 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 417 413 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 418 IEM_MC_ARG(uint64_t, u64Src, 1); \414 IEM_MC_ARG(uint64_t, u64Src, 2); \ 419 415 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 420 416 IEM_MC_NATIVE_IF(a_fRegRegNativeArchs) { \ … … 426 422 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 427 423 } IEM_MC_NATIVE_ELSE() { \ 428 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \424 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 429 425 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 430 IEM_MC_ARG (uint32_t *, pEFlags, 2); \431 IEM_MC_ REF_EFLAGS(pEFlags); \432 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \426 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 427 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 428 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 433 429 } IEM_MC_NATIVE_ENDIF(); \ 434 430 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 443 439 /* \ 444 440 * We're accessing memory. \ 445 * Note! We're putting the eflags on the stack here so we can commit them \446 * after the memory. \447 441 */ \ 448 442 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK) || (pVCpu->iem.s.fExec & IEM_F_X86_DISREGARD_LOCK)) \ … … 452 446 case IEMMODE_16BIT: \ 453 447 IEM_MC_BEGIN(0, 0); \ 454 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \455 IEM_MC_ARG(uint16_t, u16Src, 1); \456 448 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 457 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \458 \459 449 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 460 450 IEMOP_HLP_DONE_DECODING(); \ 451 \ 452 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 453 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 461 454 IEM_MC_MEM_MAP_U16_RW(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 455 IEM_MC_ARG(uint16_t, u16Src, 2); \ 462 456 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 463 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \464 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \457 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 458 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 465 459 \ 466 460 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 467 IEM_MC_COMMIT_EFLAGS( EFlags); \461 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 468 462 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 469 463 IEM_MC_END(); \ … … 472 466 case IEMMODE_32BIT: \ 473 467 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 474 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \475 IEM_MC_ARG(uint32_t, u32Src, 1); \476 468 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 477 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \478 \479 469 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 480 470 IEMOP_HLP_DONE_DECODING(); \ 471 \ 472 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 473 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 481 474 IEM_MC_MEM_MAP_U32_RW(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 475 IEM_MC_ARG(uint32_t, u32Src, 2); \ 482 476 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 483 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \484 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \477 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 478 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 485 479 \ 486 480 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 487 IEM_MC_COMMIT_EFLAGS( EFlags); \481 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 488 482 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 489 483 IEM_MC_END(); \ … … 492 486 case IEMMODE_64BIT: \ 493 487 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 494 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \495 IEM_MC_ARG(uint64_t, u64Src, 1); \496 488 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 497 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \498 \499 489 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 500 490 IEMOP_HLP_DONE_DECODING(); \ 491 \ 492 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 493 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 501 494 IEM_MC_MEM_MAP_U64_RW(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 495 IEM_MC_ARG(uint64_t, u64Src, 2); \ 502 496 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 503 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \504 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \497 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 498 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 505 499 \ 506 500 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 507 IEM_MC_COMMIT_EFLAGS( EFlags); \501 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 508 502 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 509 503 IEM_MC_END(); \ … … 522 516 case IEMMODE_16BIT: \ 523 517 IEM_MC_BEGIN(0, 0); \ 524 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \525 IEM_MC_ARG(uint16_t, u16Src, 1); \526 518 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 527 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \528 \529 519 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 530 520 IEMOP_HLP_DONE_DECODING(); \ 521 \ 522 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 523 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 531 524 IEM_MC_MEM_MAP_U16_ATOMIC(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 525 IEM_MC_ARG(uint16_t, u16Src, 2); \ 532 526 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 533 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \534 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), pu16Dst, u16Src, pEFlags); \527 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 528 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), fEFlagsIn, pu16Dst, u16Src); \ 535 529 \ 536 530 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 537 IEM_MC_COMMIT_EFLAGS( EFlags); \531 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 538 532 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 539 533 IEM_MC_END(); \ … … 542 536 case IEMMODE_32BIT: \ 543 537 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 544 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \545 IEM_MC_ARG(uint32_t, u32Src, 1); \546 538 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 547 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \548 \549 539 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 550 540 IEMOP_HLP_DONE_DECODING(); \ 541 \ 542 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 543 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 551 544 IEM_MC_MEM_MAP_U32_ATOMIC(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 545 IEM_MC_ARG(uint32_t, u32Src, 2); \ 552 546 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 553 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \554 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), pu32Dst, u32Src, pEFlags); \547 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 548 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), fEFlagsIn, pu32Dst, u32Src); \ 555 549 \ 556 550 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo /* CMP,TEST */); \ 557 IEM_MC_COMMIT_EFLAGS( EFlags); \551 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 558 552 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 559 553 IEM_MC_END(); \ … … 562 556 case IEMMODE_64BIT: \ 563 557 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 564 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \565 IEM_MC_ARG(uint64_t, u64Src, 1); \566 558 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 567 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \568 \569 559 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 570 560 IEMOP_HLP_DONE_DECODING(); \ 561 \ 562 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 563 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 571 564 IEM_MC_MEM_MAP_U64_ATOMIC(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 565 IEM_MC_ARG(uint64_t, u64Src, 2); \ 572 566 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 573 IEM_MC_ARG_ LOCAL_EFLAGS(pEFlags, EFlags, 2); \574 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), pu64Dst, u64Src, pEFlags); \567 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 568 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), fEFlagsIn, pu64Dst, u64Src); \ 575 569 \ 576 570 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 577 IEM_MC_COMMIT_EFLAGS( EFlags); \571 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 578 572 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 579 573 IEM_MC_END(); \ … … 601 595 IEM_MC_BEGIN(0, 0); \ 602 596 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 603 IEM_MC_ARG(uint16_t, u16Src, 1); \597 IEM_MC_ARG(uint16_t, u16Src, 2); \ 604 598 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 605 599 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 606 IEM_MC_LOCAL(uint16_t, 600 IEM_MC_LOCAL(uint16_t, u16Dst); \ 607 601 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 608 602 IEM_MC_LOCAL_EFLAGS(uEFlags); \ … … 610 604 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 611 605 } IEM_MC_NATIVE_ELSE() { \ 612 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \606 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 613 607 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 614 IEM_MC_ARG (uint32_t *, pEFlags, 2); \615 IEM_MC_ REF_EFLAGS(pEFlags); \616 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \608 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 609 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 610 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 617 611 } IEM_MC_NATIVE_ENDIF(); \ 618 612 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 623 617 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 624 618 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 625 IEM_MC_ARG(uint32_t, u32Src, 1); \619 IEM_MC_ARG(uint32_t, u32Src, 2); \ 626 620 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 627 621 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 628 IEM_MC_LOCAL(uint32_t, 622 IEM_MC_LOCAL(uint32_t, u32Dst); \ 629 623 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 630 624 IEM_MC_LOCAL_EFLAGS(uEFlags); \ … … 632 626 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 633 627 } IEM_MC_NATIVE_ELSE() { \ 634 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \628 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 635 629 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 636 IEM_MC_ARG (uint32_t *, pEFlags, 2); \637 IEM_MC_ REF_EFLAGS(pEFlags); \638 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \630 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 631 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 632 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 639 633 } IEM_MC_NATIVE_ENDIF(); \ 640 634 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 645 639 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 646 640 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 647 IEM_MC_ARG(uint64_t, u64Src, 1); \641 IEM_MC_ARG(uint64_t, u64Src, 2); \ 648 642 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 649 643 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ … … 654 648 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 655 649 } IEM_MC_NATIVE_ELSE() { \ 656 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \650 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 657 651 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 658 IEM_MC_ARG (uint32_t *, pEFlags, 2); \659 IEM_MC_ REF_EFLAGS(pEFlags); \660 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \652 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 653 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 654 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 661 655 } IEM_MC_NATIVE_ENDIF(); \ 662 656 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 671 665 /* \ 672 666 * We're accessing memory. \ 673 * Note! We're putting the eflags on the stack here so we can commit them \674 * after the memory. \675 667 */ \ 676 668 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK) || (pVCpu->iem.s.fExec & IEM_F_X86_DISREGARD_LOCK)) \ … … 692 684 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 693 685 } IEM_MC_NATIVE_ELSE() { \ 694 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \695 IEM_MC_ARG(uint16_t const *, pu16Dst, 0); \686 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 687 IEM_MC_ARG(uint16_t const *, pu16Dst, 1); \ 696 688 IEM_MC_MEM_MAP_U16_RO(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 697 IEM_MC_ARG(uint16_t, u16Src, 1); \689 IEM_MC_ARG(uint16_t, u16Src, 2); \ 698 690 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 699 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \700 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \691 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 692 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 701 693 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 702 IEM_MC_COMMIT_EFLAGS( EFlags); \694 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 703 695 } IEM_MC_NATIVE_ENDIF(); \ 704 696 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 720 712 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 721 713 } IEM_MC_NATIVE_ELSE() { \ 722 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \723 IEM_MC_ARG(uint32_t const *, pu32Dst, 0); \714 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 715 IEM_MC_ARG(uint32_t const *, pu32Dst, 1); \ 724 716 IEM_MC_MEM_MAP_U32_RO(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 725 IEM_MC_ARG(uint32_t, u32Src, 1); \717 IEM_MC_ARG(uint32_t, u32Src, 2); \ 726 718 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 727 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \728 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \719 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 720 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 729 721 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 730 IEM_MC_COMMIT_EFLAGS( EFlags); \722 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 731 723 } IEM_MC_NATIVE_ENDIF(); \ 732 724 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 748 740 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 749 741 } IEM_MC_NATIVE_ELSE() { \ 750 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \751 IEM_MC_ARG(uint64_t const *, pu64Dst, 0); \742 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 743 IEM_MC_ARG(uint64_t const *, pu64Dst, 1); \ 752 744 IEM_MC_MEM_MAP_U64_RO(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 753 IEM_MC_ARG(uint64_t, u64Src, 1); \745 IEM_MC_ARG(uint64_t, u64Src, 2); \ 754 746 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 755 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \756 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \747 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 748 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 757 749 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 758 IEM_MC_COMMIT_EFLAGS( EFlags); \750 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 759 751 } IEM_MC_NATIVE_ENDIF(); \ 760 752 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 791 783 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 792 784 } IEM_MC_NATIVE_ELSE() { \ 793 IEM_MC_ARG_CONST(uint8_t, u8Src,/*=*/ u8Imm, 1); \ 794 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \ 785 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 795 786 IEM_MC_REF_GREG_U8(pu8Dst, X86_GREG_xAX); \ 796 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 797 IEM_MC_REF_EFLAGS(pEFlags); \ 798 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \ 787 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 788 IEM_MC_ARG_CONST(uint8_t, u8Src,/*=*/ u8Imm, 2); \ 789 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 790 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 799 791 } IEM_MC_NATIVE_ENDIF(); \ 800 792 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 822 814 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 823 815 } IEM_MC_NATIVE_ELSE() { \ 824 IEM_MC_ARG_CONST(uint16_t, u16Src,/*=*/ u16Imm, 1); \825 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \816 IEM_MC_ARG_CONST(uint16_t, u16Src,/*=*/ u16Imm, 2); \ 817 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 826 818 IEM_MC_REF_GREG_U16(pu16Dst, X86_GREG_xAX); \ 827 IEM_MC_ARG (uint32_t *, pEFlags, 2); \828 IEM_MC_ REF_EFLAGS(pEFlags); \829 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \819 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 820 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 821 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 830 822 } IEM_MC_NATIVE_ENDIF(); \ 831 823 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 847 839 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 848 840 } IEM_MC_NATIVE_ELSE() { \ 849 IEM_MC_ARG_CONST(uint32_t, u32Src,/*=*/ u32Imm, 1); \850 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \841 IEM_MC_ARG_CONST(uint32_t, u32Src,/*=*/ u32Imm, 2); \ 842 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 851 843 IEM_MC_REF_GREG_U32(pu32Dst, X86_GREG_xAX); \ 852 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 853 IEM_MC_REF_EFLAGS(pEFlags); \ 854 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 844 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 845 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 855 846 IEM_MC_CLEAR_HIGH_GREG_U64(X86_GREG_xAX); \ 847 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 856 848 } IEM_MC_NATIVE_ENDIF(); \ 857 849 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 873 865 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 874 866 } IEM_MC_NATIVE_ELSE() { \ 875 IEM_MC_ARG_CONST(uint64_t, u64Src,/*=*/ u64Imm, 1); \876 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \867 IEM_MC_ARG_CONST(uint64_t, u64Src,/*=*/ u64Imm, 2); \ 868 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 877 869 IEM_MC_REF_GREG_U64(pu64Dst, X86_GREG_xAX); \ 878 IEM_MC_ARG (uint32_t *, pEFlags, 2); \879 IEM_MC_ REF_EFLAGS(pEFlags); \880 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \870 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 871 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 872 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 881 873 } IEM_MC_NATIVE_ENDIF(); \ 882 874 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 908 900 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 909 901 } IEM_MC_NATIVE_ELSE() { \ 910 IEM_MC_ARG_CONST(uint16_t, u16Src,/*=*/ u16Imm, 1); \911 IEM_MC_ARG(uint16_t const *,pu16Dst, 0); \902 IEM_MC_ARG_CONST(uint16_t, u16Src,/*=*/ u16Imm, 2); \ 903 IEM_MC_ARG(uint16_t const *,pu16Dst, 1); \ 912 904 IEM_MC_REF_GREG_U16_CONST(pu16Dst, X86_GREG_xAX); \ 913 IEM_MC_ARG (uint32_t *, pEFlags, 2); \914 IEM_MC_ REF_EFLAGS(pEFlags); \915 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \905 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 906 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 907 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 916 908 } IEM_MC_NATIVE_ENDIF(); \ 917 909 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 932 924 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 933 925 } IEM_MC_NATIVE_ELSE() { \ 934 IEM_MC_ARG_CONST(uint32_t, u32Src,/*=*/ u32Imm, 1); \935 IEM_MC_ARG(uint32_t const *,pu32Dst, 0); \926 IEM_MC_ARG_CONST(uint32_t, u32Src,/*=*/ u32Imm, 2); \ 927 IEM_MC_ARG(uint32_t const *,pu32Dst, 1); \ 936 928 IEM_MC_REF_GREG_U32_CONST(pu32Dst, X86_GREG_xAX); \ 937 IEM_MC_ARG (uint32_t *, pEFlags, 2); \938 IEM_MC_ REF_EFLAGS(pEFlags); \939 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \929 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 930 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 931 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 940 932 } IEM_MC_NATIVE_ENDIF(); \ 941 933 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 956 948 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 957 949 } IEM_MC_NATIVE_ELSE() { \ 958 IEM_MC_ARG_CONST(uint64_t, u64Src,/*=*/ u64Imm, 1); \959 IEM_MC_ARG(uint64_t const *,pu64Dst, 0); \950 IEM_MC_ARG_CONST(uint64_t, u64Src,/*=*/ u64Imm, 2); \ 951 IEM_MC_ARG(uint64_t const *,pu64Dst, 1); \ 960 952 IEM_MC_REF_GREG_U64_CONST(pu64Dst, X86_GREG_xAX); \ 961 IEM_MC_ARG (uint32_t *, pEFlags, 2); \962 IEM_MC_ REF_EFLAGS(pEFlags); \963 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \953 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 954 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 955 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 964 956 } IEM_MC_NATIVE_ENDIF(); \ 965 957 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 1612 1604 IEM_MC_DEFER_TO_CIMPL_0_RET(IEM_CIMPL_F_STATUS_FLAGS, RT_BIT_64(kIemNativeGstReg_GprFirst + X86_GREG_xAX), iemCImpl_daa); 1613 1605 } 1606 1607 1608 /** 1609 * Special case body for word/dword/qword instruction like SUB and XOR that can 1610 * be used to zero a register. 1611 * 1612 * This can be used both for the rv_rm and rm_rv forms since it's working on the 1613 * same register. 1614 */ 1615 #define IEMOP_BODY_BINARY_rv_SAME_REG_ZERO(a_bRm) \ 1616 if ( (a_bRm >> X86_MODRM_REG_SHIFT) == ((a_bRm & X86_MODRM_RM_MASK) | (X86_MOD_REG << X86_MODRM_REG_SHIFT)) \ 1617 && pVCpu->iem.s.uRexReg == pVCpu->iem.s.uRexB) \ 1618 { \ 1619 switch (pVCpu->iem.s.enmEffOpSize) \ 1620 { \ 1621 case IEMMODE_16BIT: \ 1622 IEM_MC_BEGIN(0, 0); \ 1623 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1624 IEM_MC_STORE_GREG_U16_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \ 1625 IEM_MC_LOCAL_EFLAGS(fEFlags); \ 1626 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \ 1627 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \ 1628 IEM_MC_COMMIT_EFLAGS(fEFlags); \ 1629 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 1630 IEM_MC_END(); \ 1631 break; \ 1632 \ 1633 case IEMMODE_32BIT: \ 1634 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 1635 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1636 IEM_MC_STORE_GREG_U32_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \ 1637 IEM_MC_LOCAL_EFLAGS(fEFlags); \ 1638 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \ 1639 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \ 1640 IEM_MC_COMMIT_EFLAGS(fEFlags); \ 1641 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 1642 IEM_MC_END(); \ 1643 break; \ 1644 \ 1645 case IEMMODE_64BIT: \ 1646 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 1647 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1648 IEM_MC_STORE_GREG_U64_CONST(IEM_GET_MODRM_RM(pVCpu, a_bRm), 0); \ 1649 IEM_MC_LOCAL_EFLAGS(fEFlags); \ 1650 IEM_MC_AND_LOCAL_U32(fEFlags, ~(uint32_t)X86_EFL_STATUS_BITS); \ 1651 IEM_MC_OR_LOCAL_U32(fEFlags, X86_EFL_PF | X86_EFL_ZF); \ 1652 IEM_MC_COMMIT_EFLAGS(fEFlags); \ 1653 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 1654 IEM_MC_END(); \ 1655 break; \ 1656 \ 1657 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 1658 } \ 1659 } ((void)0) 1614 1660 1615 1661 … … 1885 1931 IEM_MC_DEFER_TO_CIMPL_0_RET(IEM_CIMPL_F_STATUS_FLAGS, RT_BIT_64(kIemNativeGstReg_GprFirst + X86_GREG_xAX), iemCImpl_aaa); 1886 1932 } 1933 1934 1935 /** 1936 * Body for word/dword/qword the instruction CMP, ++ with a register as the 1937 * destination. 1938 * 1939 * @note Used both in OneByte and TwoByte0f. 1940 */ 1941 #define IEMOP_BODY_BINARY_rv_rm_RO(a_bRm, a_InsNm, a_fNativeArchs) \ 1942 /* \ 1943 * If rm is denoting a register, no more instruction bytes. \ 1944 */ \ 1945 if (IEM_IS_MODRM_REG_MODE(a_bRm)) \ 1946 { \ 1947 switch (pVCpu->iem.s.enmEffOpSize) \ 1948 { \ 1949 case IEMMODE_16BIT: \ 1950 IEM_MC_BEGIN(0, 0); \ 1951 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1952 IEM_MC_ARG(uint16_t, u16Src, 2); \ 1953 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 1954 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 1955 IEM_MC_LOCAL(uint16_t, u16Dst); \ 1956 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1957 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 1958 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 1959 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 1960 } IEM_MC_NATIVE_ELSE() { \ 1961 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 1962 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1963 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 1964 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 1965 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 1966 } IEM_MC_NATIVE_ENDIF(); \ 1967 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 1968 IEM_MC_END(); \ 1969 break; \ 1970 \ 1971 case IEMMODE_32BIT: \ 1972 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 1973 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1974 IEM_MC_ARG(uint32_t, u32Src, 2); \ 1975 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 1976 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 1977 IEM_MC_LOCAL(uint32_t, u32Dst); \ 1978 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1979 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 1980 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 1981 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 1982 } IEM_MC_NATIVE_ELSE() { \ 1983 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 1984 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 1985 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 1986 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 1987 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 1988 } IEM_MC_NATIVE_ENDIF(); \ 1989 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 1990 IEM_MC_END(); \ 1991 break; \ 1992 \ 1993 case IEMMODE_64BIT: \ 1994 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 1995 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 1996 IEM_MC_ARG(uint64_t, u64Src, 2); \ 1997 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_RM(pVCpu, a_bRm)); \ 1998 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 1999 IEM_MC_LOCAL(uint64_t, u64Dst); \ 2000 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2001 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2002 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 2003 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2004 } IEM_MC_NATIVE_ELSE() { \ 2005 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 2006 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2007 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 2008 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 2009 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 2010 } IEM_MC_NATIVE_ENDIF(); \ 2011 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2012 IEM_MC_END(); \ 2013 break; \ 2014 \ 2015 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 2016 } \ 2017 } \ 2018 else \ 2019 { \ 2020 /* \ 2021 * We're accessing memory. \ 2022 */ \ 2023 switch (pVCpu->iem.s.enmEffOpSize) \ 2024 { \ 2025 case IEMMODE_16BIT: \ 2026 IEM_MC_BEGIN(0, 0); \ 2027 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 2028 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 2029 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 2030 IEM_MC_ARG(uint16_t, u16Src, 2); \ 2031 IEM_MC_FETCH_MEM_U16(u16Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 2032 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 2033 IEM_MC_LOCAL(uint16_t, u16Dst); \ 2034 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2035 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2036 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u16Dst, u16Src, uEFlags, 16); \ 2037 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2038 } IEM_MC_NATIVE_ELSE() { \ 2039 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 2040 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 2041 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 2042 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 2043 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 2044 } IEM_MC_NATIVE_ENDIF(); \ 2045 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2046 IEM_MC_END(); \ 2047 break; \ 2048 \ 2049 case IEMMODE_32BIT: \ 2050 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); \ 2051 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 2052 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 2053 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 2054 IEM_MC_ARG(uint32_t, u32Src, 2); \ 2055 IEM_MC_FETCH_MEM_U32(u32Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 2056 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 2057 IEM_MC_LOCAL(uint32_t, u32Dst); \ 2058 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2059 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2060 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u32Dst, u32Src, uEFlags, 32); \ 2061 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2062 } IEM_MC_NATIVE_ELSE() { \ 2063 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 2064 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 2065 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 2066 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 2067 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 2068 } IEM_MC_NATIVE_ENDIF(); \ 2069 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2070 IEM_MC_END(); \ 2071 break; \ 2072 \ 2073 case IEMMODE_64BIT: \ 2074 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 2075 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 2076 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, a_bRm, 0); \ 2077 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 2078 IEM_MC_ARG(uint64_t, u64Src, 2); \ 2079 IEM_MC_FETCH_MEM_U64(u64Src, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 2080 IEM_MC_NATIVE_IF(a_fNativeArchs) { \ 2081 IEM_MC_LOCAL(uint64_t, u64Dst); \ 2082 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 2083 IEM_MC_LOCAL_EFLAGS(uEFlags); \ 2084 IEM_MC_NATIVE_EMIT_4(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_r_efl), u64Dst, u64Src, uEFlags, 64); \ 2085 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 2086 } IEM_MC_NATIVE_ELSE() { \ 2087 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 2088 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, a_bRm)); \ 2089 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 2090 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 2091 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 2092 } IEM_MC_NATIVE_ENDIF(); \ 2093 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2094 IEM_MC_END(); \ 2095 break; \ 2096 \ 2097 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 2098 } \ 2099 } \ 2100 (void)0 1887 2101 1888 2102 … … 3172 3386 case IEMMODE_16BIT: 3173 3387 { 3174 PFNIEMAIMPLBIN U16 const pfnAImplU16 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u16_eflags);3388 PFNIEMAIMPLBINTODOU16 const pfnAImplU16 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u16_eflags); 3175 3389 if (IEM_IS_MODRM_REG_MODE(bRm)) 3176 3390 { … … 3219 3433 case IEMMODE_32BIT: 3220 3434 { 3221 PFNIEMAIMPLBIN U32 const pfnAImplU32 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u32_eflags);3435 PFNIEMAIMPLBINTODOU32 const pfnAImplU32 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u32_eflags); 3222 3436 if (IEM_IS_MODRM_REG_MODE(bRm)) 3223 3437 { … … 3267 3481 case IEMMODE_64BIT: 3268 3482 { 3269 PFNIEMAIMPLBIN U64 const pfnAImplU64 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u64_eflags);3483 PFNIEMAIMPLBINTODOU64 const pfnAImplU64 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u64_eflags); 3270 3484 if (IEM_IS_MODRM_REG_MODE(bRm)) 3271 3485 { … … 3374 3588 case IEMMODE_16BIT: 3375 3589 { 3376 PFNIEMAIMPLBIN U16 const pfnAImplU16 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u16_eflags);3590 PFNIEMAIMPLBINTODOU16 const pfnAImplU16 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u16_eflags); 3377 3591 if (IEM_IS_MODRM_REG_MODE(bRm)) 3378 3592 { … … 3424 3638 case IEMMODE_32BIT: 3425 3639 { 3426 PFNIEMAIMPLBIN U32 const pfnAImplU32 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u32_eflags);3640 PFNIEMAIMPLBINTODOU32 const pfnAImplU32 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u32_eflags); 3427 3641 if (IEM_IS_MODRM_REG_MODE(bRm)) 3428 3642 { … … 3472 3686 case IEMMODE_64BIT: 3473 3687 { 3474 PFNIEMAIMPLBIN U64 const pfnAImplU64 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u64_eflags);3688 PFNIEMAIMPLBINTODOU64 const pfnAImplU64 = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_u64_eflags); 3475 3689 if (IEM_IS_MODRM_REG_MODE(bRm)) 3476 3690 { … … 4199 4413 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4200 4414 } IEM_MC_NATIVE_ELSE() { \ 4201 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 1); \ 4202 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \ 4415 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 4203 4416 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4204 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 4205 IEM_MC_REF_EFLAGS(pEFlags); \ 4206 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \ 4417 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 2); \ 4418 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4419 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 4420 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4207 4421 } IEM_MC_NATIVE_ENDIF(); \ 4208 4422 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4217 4431 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 4218 4432 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 1); \ 4219 \4220 4433 uint8_t u8Imm; IEM_OPCODE_GET_NEXT_U8(&u8Imm); \ 4221 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 1); \4222 4434 IEMOP_HLP_DONE_DECODING(); \ 4223 4435 \ 4224 4436 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4225 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \4437 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 4226 4438 IEM_MC_MEM_MAP_U8_RW(pu8Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4227 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 4228 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \ 4439 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 2); \ 4440 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4441 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 4229 4442 \ 4230 4443 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 4231 IEM_MC_COMMIT_EFLAGS( EFlags); \4444 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4232 4445 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4233 4446 IEM_MC_END(); \ … … 4236 4449 { \ 4237 4450 IEM_MC_BEGIN(0, 0); \ 4238 IEM_MC_ARG(uint8_t *, pu8Dst, 0); \4239 4451 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 4240 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \4241 \4242 4452 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 1); \ 4243 4453 uint8_t u8Imm; IEM_OPCODE_GET_NEXT_U8(&u8Imm); \ 4244 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 1); \4245 4454 IEMOP_HLP_DONE_DECODING(); \ 4246 4455 \ 4456 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4457 IEM_MC_ARG(uint8_t *, pu8Dst, 1); \ 4247 4458 IEM_MC_MEM_MAP_U8_ATOMIC(pu8Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4248 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 4249 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8_locked), pu8Dst, u8Src, pEFlags); \ 4459 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 2); \ 4460 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4461 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8_locked), fEFlagsIn, pu8Dst, u8Src); \ 4250 4462 \ 4251 4463 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 4252 IEM_MC_COMMIT_EFLAGS( EFlags); \4464 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4253 4465 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4254 4466 IEM_MC_END(); \ … … 4271 4483 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4272 4484 } IEM_MC_NATIVE_ELSE() { \ 4273 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 1); \ 4274 IEM_MC_ARG(uint8_t const *, pu8Dst, 0); \ 4485 IEM_MC_ARG(uint8_t const *, pu8Dst, 1); \ 4275 4486 IEM_MC_REF_GREG_U8_CONST(pu8Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4276 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 4277 IEM_MC_REF_EFLAGS(pEFlags); \ 4278 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \ 4487 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4488 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 2); \ 4489 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 4490 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4279 4491 } IEM_MC_NATIVE_ENDIF(); \ 4280 4492 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4299 4511 } IEM_MC_NATIVE_ELSE() { \ 4300 4512 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4301 IEM_MC_ARG(uint8_t const *, pu8Dst, 0); \4513 IEM_MC_ARG(uint8_t const *, pu8Dst, 1); \ 4302 4514 IEM_MC_MEM_MAP_U8_RO(pu8Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4303 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4304 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 1); \4305 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u8), pu8Dst, u8Src, pEFlags); \4515 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4516 IEM_MC_ARG_CONST(uint8_t, u8Src, /*=*/ u8Imm, 2); \ 4517 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u8), fEFlagsIn, pu8Dst, u8Src); \ 4306 4518 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 4307 IEM_MC_COMMIT_EFLAGS( EFlags); \4519 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4308 4520 } IEM_MC_NATIVE_ENDIF(); \ 4309 4521 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4460 4672 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4461 4673 } IEM_MC_NATIVE_ELSE() { \ 4462 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \4674 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 4463 4675 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4464 IEM_MC_ARG (uint32_t *, pEFlags, 2); \4465 IEM_MC_ REF_EFLAGS(pEFlags); \4466 IEM_MC_ ARG_CONST(uint16_t, u16Src, /*=*/ u16Imm, 1); \4467 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \4676 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4677 IEM_MC_ARG_CONST(uint16_t, u16Src, /*=*/ u16Imm, 2); \ 4678 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 4679 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4468 4680 } IEM_MC_NATIVE_ENDIF(); \ 4469 4681 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4486 4698 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4487 4699 } IEM_MC_NATIVE_ELSE() { \ 4488 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \4700 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 4489 4701 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4490 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 4491 IEM_MC_REF_EFLAGS(pEFlags); \ 4492 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ u32Imm, 1); \ 4493 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 4702 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4703 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ u32Imm, 2); \ 4704 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 4494 4705 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4706 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4495 4707 } IEM_MC_NATIVE_ENDIF(); \ 4496 4708 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4513 4725 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4514 4726 } IEM_MC_NATIVE_ELSE() { \ 4515 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \4727 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 4516 4728 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4517 IEM_MC_ARG (uint32_t *, pEFlags, 2); \4518 IEM_MC_ REF_EFLAGS(pEFlags); \4519 IEM_MC_ ARG_CONST(uint64_t, u64Src, /*=*/ u64Imm, 1); \4520 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \4729 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4730 IEM_MC_ARG_CONST(uint64_t, u64Src, /*=*/ u64Imm, 2); \ 4731 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 4732 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4521 4733 } IEM_MC_NATIVE_ENDIF(); \ 4522 4734 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4545 4757 \ 4546 4758 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4547 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \4759 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 4548 4760 IEM_MC_MEM_MAP_U16_RW(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4549 4761 \ 4550 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 1); \4551 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4552 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \4762 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 2); \ 4763 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4764 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 4553 4765 \ 4554 4766 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 4555 IEM_MC_COMMIT_EFLAGS( EFlags); \4767 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4556 4768 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4557 4769 IEM_MC_END(); \ … … 4569 4781 \ 4570 4782 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4571 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \4783 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 4572 4784 IEM_MC_MEM_MAP_U32_RW(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4573 4785 \ 4574 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 1); \4575 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4576 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \4786 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 2); \ 4787 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4788 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 4577 4789 \ 4578 4790 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 4579 IEM_MC_COMMIT_EFLAGS( EFlags); \4791 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4580 4792 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4581 4793 IEM_MC_END(); \ … … 4594 4806 \ 4595 4807 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4596 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \4808 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 4597 4809 IEM_MC_MEM_MAP_U64_RW(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4598 4810 \ 4599 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 1); \4600 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4601 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \4811 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 2); \ 4812 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4813 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 4602 4814 \ 4603 4815 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 4604 IEM_MC_COMMIT_EFLAGS( EFlags); \4816 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4605 4817 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4606 4818 IEM_MC_END(); \ … … 4625 4837 \ 4626 4838 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4627 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \4839 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 4628 4840 IEM_MC_MEM_MAP_U16_ATOMIC(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4629 4841 \ 4630 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 1); \4631 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4632 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), pu16Dst, u16Src, pEFlags); \4842 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 2); \ 4843 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4844 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), fEFlagsIn, pu16Dst, u16Src); \ 4633 4845 \ 4634 4846 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 4635 IEM_MC_COMMIT_EFLAGS( EFlags); \4847 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4636 4848 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4637 4849 IEM_MC_END(); \ … … 4649 4861 \ 4650 4862 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4651 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \4863 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 4652 4864 IEM_MC_MEM_MAP_U32_ATOMIC(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4653 4865 \ 4654 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 1); \4655 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4656 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), pu32Dst, u32Src, pEFlags); \4866 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 2); \ 4867 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4868 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), fEFlagsIn, pu32Dst, u32Src); \ 4657 4869 \ 4658 4870 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 4659 IEM_MC_COMMIT_EFLAGS( EFlags); \4871 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4660 4872 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4661 4873 IEM_MC_END(); \ … … 4673 4885 \ 4674 4886 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4675 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \4887 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 4676 4888 IEM_MC_MEM_MAP_U64_ATOMIC(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4677 4889 \ 4678 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 1); \4679 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4680 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), pu64Dst, u64Src, pEFlags); \4890 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 2); \ 4891 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4892 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), fEFlagsIn, pu64Dst, u64Src); \ 4681 4893 \ 4682 4894 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 4683 IEM_MC_COMMIT_EFLAGS( EFlags); \4895 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4684 4896 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 4685 4897 IEM_MC_END(); \ … … 4713 4925 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4714 4926 } IEM_MC_NATIVE_ELSE() { \ 4715 IEM_MC_ARG(uint16_t const *,pu16Dst, 0); \4927 IEM_MC_ARG(uint16_t const *,pu16Dst, 1); \ 4716 4928 IEM_MC_REF_GREG_U16_CONST(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4717 IEM_MC_ARG (uint32_t *, pEFlags, 2); \4718 IEM_MC_ REF_EFLAGS(pEFlags); \4719 IEM_MC_ ARG_CONST(uint16_t, u16Src, /*=*/ u16Imm, 1); \4720 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \4929 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4930 IEM_MC_ARG_CONST(uint16_t, u16Src, /*=*/ u16Imm, 2); \ 4931 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 4932 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4721 4933 } IEM_MC_NATIVE_ENDIF(); \ 4722 4934 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4738 4950 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4739 4951 } IEM_MC_NATIVE_ELSE() { \ 4740 IEM_MC_ARG(uint32_t const *,pu32Dst, 0); \4952 IEM_MC_ARG(uint32_t const *,pu32Dst, 1); \ 4741 4953 IEM_MC_REF_GREG_U32_CONST (pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4742 IEM_MC_ARG (uint32_t *, pEFlags, 2); \4743 IEM_MC_ REF_EFLAGS(pEFlags); \4744 IEM_MC_ ARG_CONST(uint32_t, u32Src, /*=*/ u32Imm, 1); \4745 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \4954 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4955 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ u32Imm, 2); \ 4956 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 4957 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4746 4958 } IEM_MC_NATIVE_ENDIF(); \ 4747 4959 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4763 4975 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 4764 4976 } IEM_MC_NATIVE_ELSE() { \ 4765 IEM_MC_ARG(uint64_t const *,pu64Dst, 0); \4977 IEM_MC_ARG(uint64_t const *,pu64Dst, 1); \ 4766 4978 IEM_MC_REF_GREG_U64_CONST(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 4767 IEM_MC_ARG (uint32_t *, pEFlags, 2); \4768 IEM_MC_ REF_EFLAGS(pEFlags); \4769 IEM_MC_ ARG_CONST(uint64_t, u64Src, /*=*/ u64Imm, 1); \4770 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \4979 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 4980 IEM_MC_ARG_CONST(uint64_t, u64Src, /*=*/ u64Imm, 2); \ 4981 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 4982 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4771 4983 } IEM_MC_NATIVE_ENDIF(); \ 4772 4984 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4800 5012 } IEM_MC_NATIVE_ELSE() { \ 4801 5013 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4802 IEM_MC_ARG(uint16_t const *, pu16Dst, 0); \5014 IEM_MC_ARG(uint16_t const *, pu16Dst, 1); \ 4803 5015 IEM_MC_MEM_MAP_U16_RO(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4804 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4805 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 1); \4806 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \5016 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5017 IEM_MC_ARG_CONST(uint16_t, u16Src, u16Imm, 2); \ 5018 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 4807 5019 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 4808 IEM_MC_COMMIT_EFLAGS( EFlags); \5020 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4809 5021 } IEM_MC_NATIVE_ENDIF(); \ 4810 5022 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4828 5040 } IEM_MC_NATIVE_ELSE() { \ 4829 5041 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4830 IEM_MC_ARG(uint32_t const *, pu32Dst, 0); \5042 IEM_MC_ARG(uint32_t const *, pu32Dst, 1); \ 4831 5043 IEM_MC_MEM_MAP_U32_RO(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4832 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4833 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 1); \4834 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \5044 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5045 IEM_MC_ARG_CONST(uint32_t, u32Src, u32Imm, 2); \ 5046 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 4835 5047 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 4836 IEM_MC_COMMIT_EFLAGS( EFlags); \5048 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4837 5049 } IEM_MC_NATIVE_ENDIF(); \ 4838 5050 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 4856 5068 } IEM_MC_NATIVE_ELSE() { \ 4857 5069 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 4858 IEM_MC_ARG(uint64_t const *, pu64Dst, 0); \5070 IEM_MC_ARG(uint64_t const *, pu64Dst, 1); \ 4859 5071 IEM_MC_MEM_MAP_U64_RO(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 4860 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \4861 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 1); \4862 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \5072 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5073 IEM_MC_ARG_CONST(uint64_t, u64Src, u64Imm, 2); \ 5074 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 4863 5075 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 4864 IEM_MC_COMMIT_EFLAGS( EFlags); \5076 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 4865 5077 } IEM_MC_NATIVE_ENDIF(); \ 4866 5078 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5035 5247 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5036 5248 } IEM_MC_NATIVE_ELSE() { \ 5037 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \5249 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 5038 5250 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5039 IEM_MC_ARG (uint32_t *, pEFlags, 2); \5040 IEM_MC_ REF_EFLAGS(pEFlags); \5041 IEM_MC_ ARG_CONST(uint16_t, u16Src, /*=*/ (uint16_t)(int16_t)(int8_t)u8Imm, 1); \5042 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \5251 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5252 IEM_MC_ARG_CONST(uint16_t, u16Src, /*=*/ (uint16_t)(int16_t)(int8_t)u8Imm, 2); \ 5253 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 5254 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5043 5255 } IEM_MC_NATIVE_ENDIF(); \ 5044 5256 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5058 5270 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5059 5271 } IEM_MC_NATIVE_ELSE() { \ 5060 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \5272 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 5061 5273 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5062 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 5063 IEM_MC_REF_EFLAGS(pEFlags); \ 5064 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ (uint32_t)(int32_t)(int8_t)u8Imm, 1); \ 5065 IEM_MC_CALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \ 5274 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5275 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ (uint32_t)(int32_t)(int8_t)u8Imm, 2); \ 5276 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 5066 5277 IEM_MC_CLEAR_HIGH_GREG_U64(IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5278 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5067 5279 } IEM_MC_NATIVE_ENDIF(); \ 5068 5280 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5082 5294 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5083 5295 } IEM_MC_NATIVE_ELSE() { \ 5084 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \5296 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 5085 5297 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5086 IEM_MC_ARG (uint32_t *, pEFlags, 2); \5087 IEM_MC_ REF_EFLAGS(pEFlags); \5088 IEM_MC_ ARG_CONST(uint64_t, u64Src, /*=*/ (uint64_t)(int64_t)(int8_t)u8Imm, 1); \5089 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \5298 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5299 IEM_MC_ARG_CONST(uint64_t, u64Src, /*=*/ (uint64_t)(int64_t)(int8_t)u8Imm, 2); \ 5300 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 5301 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5090 5302 } IEM_MC_NATIVE_ENDIF(); \ 5091 5303 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5114 5326 \ 5115 5327 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5116 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \5328 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 5117 5329 IEM_MC_MEM_MAP_U16_RW(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5118 5330 \ 5119 IEM_MC_ARG_ CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 1); \5120 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5121 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \5331 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5332 IEM_MC_ARG_CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 2); \ 5333 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 5122 5334 \ 5123 5335 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 5124 IEM_MC_COMMIT_EFLAGS( EFlags); \5336 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5125 5337 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5126 5338 IEM_MC_END(); \ … … 5136 5348 \ 5137 5349 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5138 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \5350 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 5139 5351 IEM_MC_MEM_MAP_U32_RW(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5140 5352 \ 5141 IEM_MC_ARG_ CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 1); \5142 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5143 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \5353 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5354 IEM_MC_ARG_CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 2); \ 5355 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 5144 5356 \ 5145 5357 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 5146 IEM_MC_COMMIT_EFLAGS( EFlags); \5358 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5147 5359 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5148 5360 IEM_MC_END(); \ … … 5158 5370 \ 5159 5371 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5160 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \5372 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 5161 5373 IEM_MC_MEM_MAP_U64_RW(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5162 5374 \ 5163 IEM_MC_ARG_ CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 1); \5164 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5165 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \5375 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5376 IEM_MC_ARG_CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 2); \ 5377 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 5166 5378 \ 5167 5379 IEM_MC_MEM_COMMIT_AND_UNMAP_RW(bUnmapInfo); \ 5168 IEM_MC_COMMIT_EFLAGS( EFlags); \5380 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5169 5381 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5170 5382 IEM_MC_END(); \ … … 5187 5399 \ 5188 5400 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5189 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \5401 IEM_MC_ARG(uint16_t *, pu16Dst, 1); \ 5190 5402 IEM_MC_MEM_MAP_U16_ATOMIC(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5191 5403 \ 5192 IEM_MC_ARG_ CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 1); \5193 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5194 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), pu16Dst, u16Src, pEFlags); \5404 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5405 IEM_MC_ARG_CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 2); \ 5406 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16_locked), fEFlagsIn, pu16Dst, u16Src); \ 5195 5407 \ 5196 5408 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 5197 IEM_MC_COMMIT_EFLAGS( EFlags); \5409 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5198 5410 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5199 5411 IEM_MC_END(); \ … … 5209 5421 \ 5210 5422 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5211 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \5423 IEM_MC_ARG(uint32_t *, pu32Dst, 1); \ 5212 5424 IEM_MC_MEM_MAP_U32_ATOMIC(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5213 5425 \ 5214 IEM_MC_ARG_ CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 1); \5215 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5216 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), pu32Dst, u32Src, pEFlags); \5426 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5427 IEM_MC_ARG_CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 2); \ 5428 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32_locked), fEFlagsIn, pu32Dst, u32Src); \ 5217 5429 \ 5218 5430 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 5219 IEM_MC_COMMIT_EFLAGS( EFlags); \5431 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5220 5432 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5221 5433 IEM_MC_END(); \ … … 5231 5443 \ 5232 5444 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5233 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \5445 IEM_MC_ARG(uint64_t *, pu64Dst, 1); \ 5234 5446 IEM_MC_MEM_MAP_U64_ATOMIC(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5235 5447 \ 5236 IEM_MC_ARG_ CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 1); \5237 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags,2); \5238 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), pu64Dst, u64Src, pEFlags); \5448 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5449 IEM_MC_ARG_CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 2); \ 5450 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64_locked), fEFlagsIn, pu64Dst, u64Src); \ 5239 5451 \ 5240 5452 IEM_MC_MEM_COMMIT_AND_UNMAP_ATOMIC(bUnmapInfo); \ 5241 IEM_MC_COMMIT_EFLAGS( EFlags); \5453 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5242 5454 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 5243 5455 IEM_MC_END(); \ … … 5266 5478 IEM_MC_LOCAL(uint16_t, u16Dst); \ 5267 5479 IEM_MC_FETCH_GREG_U16(u16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5268 IEM_MC_LOCAL(uint32_t, uEFlags); \ 5269 IEM_MC_FETCH_EFLAGS(uEFlags); \ 5480 IEM_MC_LOCAL_EFLAGS( uEFlags); \ 5270 5481 IEM_MC_NATIVE_EMIT_5(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_i_efl), u16Dst, (uint16_t)(int16_t)(int8_t)u8Imm, uEFlags, 16, 8); \ 5271 5482 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5272 5483 } IEM_MC_NATIVE_ELSE() { \ 5273 IEM_MC_ARG(uint16_t const *, pu16Dst, 0); \5484 IEM_MC_ARG(uint16_t const *,pu16Dst, 1); \ 5274 5485 IEM_MC_REF_GREG_U16_CONST(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5275 IEM_MC_ARG (uint32_t *, pEFlags, 2); \5276 IEM_MC_ARG_CONST(uint16_t, u16Src, /*=*/ (uint16_t)(int16_t)(int8_t)u8Imm, 1); \5277 IEM_MC_ REF_EFLAGS(pEFlags); \5278 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \5486 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5487 IEM_MC_ARG_CONST(uint16_t, u16Src, /*=*/ (uint16_t)(int16_t)(int8_t)u8Imm, 2); \ 5488 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 5489 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5279 5490 } IEM_MC_NATIVE_ENDIF(); \ 5280 5491 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5288 5499 IEM_MC_LOCAL(uint32_t, u32Dst); \ 5289 5500 IEM_MC_FETCH_GREG_U32(u32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5290 IEM_MC_LOCAL(uint32_t, uEFlags); \ 5291 IEM_MC_FETCH_EFLAGS(uEFlags); \ 5501 IEM_MC_LOCAL_EFLAGS( uEFlags); \ 5292 5502 IEM_MC_NATIVE_EMIT_5(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_i_efl), u32Dst, (uint32_t)(int32_t)(int8_t)u8Imm, uEFlags, 32, 8); \ 5293 5503 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5294 5504 } IEM_MC_NATIVE_ELSE() { \ 5295 IEM_MC_ARG(uint32_t const *, pu32Dst, 0); \5505 IEM_MC_ARG(uint32_t const *,pu32Dst, 1); \ 5296 5506 IEM_MC_REF_GREG_U32_CONST(pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5297 IEM_MC_ARG (uint32_t *, pEFlags, 2); \5298 IEM_MC_ REF_EFLAGS(pEFlags); \5299 IEM_MC_ ARG_CONST(uint32_t, u32Src, /*=*/ (uint32_t)(int32_t)(int8_t)u8Imm, 1); \5300 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \5507 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5508 IEM_MC_ARG_CONST(uint32_t, u32Src, /*=*/ (uint32_t)(int32_t)(int8_t)u8Imm, 2); \ 5509 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 5510 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5301 5511 } IEM_MC_NATIVE_ENDIF(); \ 5302 5512 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5310 5520 IEM_MC_LOCAL(uint64_t, u64Dst); \ 5311 5521 IEM_MC_FETCH_GREG_U64(u64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5312 IEM_MC_LOCAL(uint32_t, uEFlags); \ 5313 IEM_MC_FETCH_EFLAGS(uEFlags); \ 5522 IEM_MC_LOCAL_EFLAGS( uEFlags); \ 5314 5523 IEM_MC_NATIVE_EMIT_5(RT_CONCAT3(iemNativeEmit_,a_InsNm,_r_i_efl), u64Dst, (uint64_t)(int64_t)(int8_t)u8Imm, uEFlags, 64, 8); \ 5315 5524 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); \ 5316 5525 } IEM_MC_NATIVE_ELSE() { \ 5317 IEM_MC_ARG(uint64_t const *, pu64Dst, 0); \5526 IEM_MC_ARG(uint64_t const *,pu64Dst, 1); \ 5318 5527 IEM_MC_REF_GREG_U64_CONST(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 5319 IEM_MC_ARG (uint32_t *, pEFlags, 2); \5320 IEM_MC_ REF_EFLAGS(pEFlags); \5321 IEM_MC_ ARG_CONST(uint64_t, u64Src, /*=*/ (uint64_t)(int64_t)(int8_t)u8Imm, 1); \5322 IEM_MC_C ALL_VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \5528 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5529 IEM_MC_ARG_CONST(uint64_t, u64Src, /*=*/ (uint64_t)(int64_t)(int8_t)u8Imm, 2); \ 5530 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 5531 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5323 5532 } IEM_MC_NATIVE_ENDIF(); \ 5324 5533 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5352 5561 } IEM_MC_NATIVE_ELSE() { \ 5353 5562 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5354 IEM_MC_ARG(uint16_t const *, pu16Dst, 0); \5563 IEM_MC_ARG(uint16_t const *, pu16Dst, 1); \ 5355 5564 IEM_MC_MEM_MAP_U16_RO(pu16Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5356 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \5357 IEM_MC_ARG_CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 1); \5358 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u16), pu16Dst, u16Src, pEFlags); \5565 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5566 IEM_MC_ARG_CONST(uint16_t, u16Src, (uint16_t)(int16_t)(int8_t)u8Imm, 2); \ 5567 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u16), fEFlagsIn, pu16Dst, u16Src); \ 5359 5568 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 5360 IEM_MC_COMMIT_EFLAGS( EFlags); \5569 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5361 5570 } IEM_MC_NATIVE_ENDIF(); \ 5362 5571 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5378 5587 } IEM_MC_NATIVE_ELSE() { \ 5379 5588 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5380 IEM_MC_ARG(uint32_t const *, pu32Dst, 0); \5589 IEM_MC_ARG(uint32_t const *, pu32Dst, 1); \ 5381 5590 IEM_MC_MEM_MAP_U32_RO(pu32Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5382 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \5383 IEM_MC_ARG_CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 1); \5384 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u32), pu32Dst, u32Src, pEFlags); \5591 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5592 IEM_MC_ARG_CONST(uint32_t, u32Src, (uint32_t)(int32_t)(int8_t)u8Imm, 2); \ 5593 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u32), fEFlagsIn, pu32Dst, u32Src); \ 5385 5594 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 5386 IEM_MC_COMMIT_EFLAGS( EFlags); \5595 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5387 5596 } IEM_MC_NATIVE_ENDIF(); \ 5388 5597 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5404 5613 } IEM_MC_NATIVE_ELSE() { \ 5405 5614 IEM_MC_LOCAL(uint8_t, bUnmapInfo); \ 5406 IEM_MC_ARG(uint64_t const *, pu64Dst, 0); \5615 IEM_MC_ARG(uint64_t const *, pu64Dst, 1); \ 5407 5616 IEM_MC_MEM_MAP_U64_RO(pu64Dst, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffDst); \ 5408 IEM_MC_ARG_ LOCAL_EFLAGS( pEFlags, EFlags, 2); \5409 IEM_MC_ARG_CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 1); \5410 IEM_MC_CALL_ VOID_AIMPL_3(RT_CONCAT3(iemAImpl_,a_InsNm,_u64), pu64Dst, u64Src, pEFlags); \5617 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 5618 IEM_MC_ARG_CONST(uint64_t, u64Src, (uint64_t)(int64_t)(int8_t)u8Imm, 2); \ 5619 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, RT_CONCAT3(iemAImpl_,a_InsNm,_u64), fEFlagsIn, pu64Dst, u64Src); \ 5411 5620 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); \ 5412 IEM_MC_COMMIT_EFLAGS( EFlags); \5621 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 5413 5622 } IEM_MC_NATIVE_ENDIF(); \ 5414 5623 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 5567 5776 IEM_MC_BEGIN(0, 0); 5568 5777 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5569 IEM_MC_ARG(uint8_t, u8Src, 1);5778 IEM_MC_ARG(uint8_t, u8Src, 2); 5570 5779 IEM_MC_FETCH_GREG_U8(u8Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 5571 5780 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { … … 5574 5783 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5575 5784 } IEM_MC_NATIVE_ELSE() { 5576 IEM_MC_ARG(uint8_t *, pu8Dst, 0);5785 IEM_MC_ARG(uint8_t *, pu8Dst, 1); 5577 5786 IEM_MC_REF_GREG_U8(pu8Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); /* == IEM_GET_MODRM_RM(pVCpu, bRm) */ 5578 IEM_MC_ARG (uint32_t *, pEFlags, 2);5579 IEM_MC_ REF_EFLAGS(pEFlags);5580 IEM_MC_C ALL_VOID_AIMPL_3(iemAImpl_test_u8, pu8Dst, u8Src, pEFlags);5787 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); 5788 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_test_u8, fEFlagsIn, pu8Dst, u8Src); 5789 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); 5581 5790 } IEM_MC_NATIVE_ENDIF(); 5582 5791 IEM_MC_ADVANCE_RIP_AND_FINISH(); … … 5611 5820 IEM_MC_BEGIN(0, 0); 5612 5821 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5613 IEM_MC_ARG(uint16_t, u16Src, 1);5822 IEM_MC_ARG(uint16_t, u16Src, 2); 5614 5823 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 5615 5824 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { … … 5618 5827 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5619 5828 } IEM_MC_NATIVE_ELSE() { 5620 IEM_MC_ARG(uint16_t *, pu16Dst, 0);5829 IEM_MC_ARG(uint16_t *, pu16Dst, 1); 5621 5830 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); /* == IEM_GET_MODRM_RM(pVCpu, bRm) */ 5622 IEM_MC_ARG (uint32_t *, pEFlags, 2);5623 IEM_MC_ REF_EFLAGS(pEFlags);5624 IEM_MC_C ALL_VOID_AIMPL_3(iemAImpl_test_u16, pu16Dst, u16Src, pEFlags);5831 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); 5832 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_test_u16, fEFlagsIn, pu16Dst, u16Src); 5833 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); 5625 5834 } IEM_MC_NATIVE_ENDIF(); 5626 5835 IEM_MC_ADVANCE_RIP_AND_FINISH(); … … 5631 5840 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); 5632 5841 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5633 IEM_MC_ARG(uint32_t, u32Src, 1);5842 IEM_MC_ARG(uint32_t, u32Src, 2); 5634 5843 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 5635 5844 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { … … 5638 5847 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5639 5848 } IEM_MC_NATIVE_ELSE() { 5640 IEM_MC_ARG(uint32_t *, pu32Dst, 0);5849 IEM_MC_ARG(uint32_t *, pu32Dst, 1); 5641 5850 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); /* == IEM_GET_MODRM_RM(pVCpu, bRm) */ 5642 IEM_MC_ARG (uint32_t *, pEFlags, 2);5643 IEM_MC_ REF_EFLAGS(pEFlags);5644 IEM_MC_C ALL_VOID_AIMPL_3(iemAImpl_test_u32, pu32Dst, u32Src, pEFlags);5851 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); 5852 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_test_u32, fEFlagsIn, pu32Dst, u32Src); 5853 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); 5645 5854 } IEM_MC_NATIVE_ENDIF(); 5646 5855 IEM_MC_ADVANCE_RIP_AND_FINISH(); … … 5651 5860 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); 5652 5861 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5653 IEM_MC_ARG(uint64_t, u64Src, 1);5862 IEM_MC_ARG(uint64_t, u64Src, 2); 5654 5863 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 5655 5864 IEM_MC_NATIVE_IF(RT_ARCH_VAL_AMD64 | RT_ARCH_VAL_ARM64) { … … 5658 5867 IEM_MC_COMMIT_EFLAGS_OPT(uEFlags); 5659 5868 } IEM_MC_NATIVE_ELSE() { 5660 IEM_MC_ARG(uint64_t *, pu64Dst, 0);5869 IEM_MC_ARG(uint64_t *, pu64Dst, 1); 5661 5870 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_REG(pVCpu, bRm)); /* == IEM_GET_MODRM_RM(pVCpu, bRm) */ 5662 IEM_MC_ARG (uint32_t *, pEFlags, 2);5663 IEM_MC_ REF_EFLAGS(pEFlags);5664 IEM_MC_C ALL_VOID_AIMPL_3(iemAImpl_test_u64, pu64Dst, u64Src, pEFlags);5871 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); 5872 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_test_u64, fEFlagsIn, pu64Dst, u64Src); 5873 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); 5665 5874 } IEM_MC_NATIVE_ENDIF(); 5666 5875 IEM_MC_ADVANCE_RIP_AND_FINISH(); … … 7395 7604 IEM_MC_LOCAL(RTGCPTR, uAddr2); \ 7396 7605 IEM_MC_FETCH_GREG_U##AddrBits##_ZX_U64(uAddr2, X86_GREG_xDI); \ 7397 IEM_MC_ARG(uint##ValBits##_t, uValue2, 1); \7606 IEM_MC_ARG(uint##ValBits##_t, uValue2, 2); \ 7398 7607 IEM_MC_FETCH_MEM_U##ValBits(uValue2, X86_SREG_ES, uAddr2); \ 7399 7608 \ 7400 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 7401 IEM_MC_REF_EFLAGS(pEFlags); \ 7402 IEM_MC_ARG_LOCAL_REF(uint##ValBits##_t *, puValue1, uValue1, 0); \ 7403 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_cmp_u##ValBits, puValue1, uValue2, pEFlags); \ 7609 IEM_MC_ARG_LOCAL_REF(uint##ValBits##_t *, puValue1, uValue1, 1); \ 7610 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 7611 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_cmp_u##ValBits, fEFlagsIn, puValue1, uValue2); \ 7404 7612 \ 7613 IEM_MC_COMMIT_EFLAGS(fEFlagsRet); \ 7405 7614 IEM_MC_IF_EFL_BIT_SET(X86_EFL_DF) { \ 7406 7615 IEM_MC_SUB_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ … … 8098 8307 IEM_MC_BEGIN(a_fMcFlags, 0); \ 8099 8308 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 8100 IEM_MC_ARG(uint##ValBits##_t *, puRax, 0); \ 8101 IEM_MC_ARG(uint##ValBits##_t, uValue, 1); \ 8102 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 8309 \ 8103 8310 IEM_MC_LOCAL(RTGCPTR, uAddr); \ 8311 IEM_MC_FETCH_GREG_U##AddrBits##_ZX_U64(uAddr, X86_GREG_xDI); \ 8104 8312 \ 8105 IEM_MC_ FETCH_GREG_U##AddrBits##_ZX_U64(uAddr, X86_GREG_xDI); \8313 IEM_MC_ARG(uint##ValBits##_t, uValue, 2); \ 8106 8314 IEM_MC_FETCH_MEM_U##ValBits(uValue, X86_SREG_ES, uAddr); \ 8315 IEM_MC_ARG(uint##ValBits##_t *, puRax, 1); \ 8107 8316 IEM_MC_REF_GREG_U##ValBits(puRax, X86_GREG_xAX); \ 8108 IEM_MC_ REF_EFLAGS(pEFlags); \8109 IEM_MC_CALL_ VOID_AIMPL_3(iemAImpl_cmp_u##ValBits, puRax, uValue, pEFlags); \8317 IEM_MC_ARG_EFLAGS( fEFlagsIn, 0); \ 8318 IEM_MC_CALL_AIMPL_3(uint32_t, fEFlagsRet, iemAImpl_cmp_u##ValBits, fEFlagsIn, puRax, uValue); \ 8110 8319 \ 8320 IEM_MC_COMMIT_EFLAGS(fEFlagsRet);\ 8111 8321 IEM_MC_IF_EFL_BIT_SET(X86_EFL_DF) { \ 8112 8322 IEM_MC_SUB_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ … … 14358 14568 IEM_MC_ARG(uint8_t, u8Value, 1); \ 14359 14569 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 14360 IEM_MC_LOCAL(int32_t, rc); \14361 14570 \ 14362 14571 IEM_MC_FETCH_GREG_U8(u8Value, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 14363 14572 IEM_MC_REF_GREG_U16(pu16AX, X86_GREG_xAX); \ 14364 14573 IEM_MC_REF_EFLAGS(pEFlags); \ 14365 IEM_MC_CALL_AIMPL_3( rc, pfnU8, pu16AX, u8Value, pEFlags); \14574 IEM_MC_CALL_AIMPL_3(int32_t, rc, pfnU8, pu16AX, u8Value, pEFlags); \ 14366 14575 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14367 14576 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 14380 14589 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 14381 14590 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 14382 IEM_MC_LOCAL(int32_t, rc); \14383 14591 \ 14384 14592 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ … … 14387 14595 IEM_MC_REF_GREG_U16(pu16AX, X86_GREG_xAX); \ 14388 14596 IEM_MC_REF_EFLAGS(pEFlags); \ 14389 IEM_MC_CALL_AIMPL_3( rc, pfnU8, pu16AX, u8Value, pEFlags); \14597 IEM_MC_CALL_AIMPL_3(int32_t, rc, pfnU8, pu16AX, u8Value, pEFlags); \ 14390 14598 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14391 14599 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 14413 14621 IEM_MC_ARG(uint16_t, u16Value, 2); \ 14414 14622 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14415 IEM_MC_LOCAL(int32_t, rc); \14416 14623 \ 14417 14624 IEM_MC_FETCH_GREG_U16(u16Value, IEM_GET_MODRM_RM(pVCpu, bRm)); \ … … 14419 14626 IEM_MC_REF_GREG_U16(pu16DX, X86_GREG_xDX); \ 14420 14627 IEM_MC_REF_EFLAGS(pEFlags); \ 14421 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU16, pu16AX, pu16DX, u16Value, pEFlags); \14628 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU16, pu16AX, pu16DX, u16Value, pEFlags); \ 14422 14629 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14423 14630 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 14436 14643 IEM_MC_ARG(uint32_t, u32Value, 2); \ 14437 14644 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14438 IEM_MC_LOCAL(int32_t, rc); \14439 14645 \ 14440 14646 IEM_MC_FETCH_GREG_U32(u32Value, IEM_GET_MODRM_RM(pVCpu, bRm)); \ … … 14442 14648 IEM_MC_REF_GREG_U32(pu32DX, X86_GREG_xDX); \ 14443 14649 IEM_MC_REF_EFLAGS(pEFlags); \ 14444 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU32, pu32AX, pu32DX, u32Value, pEFlags); \14650 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU32, pu32AX, pu32DX, u32Value, pEFlags); \ 14445 14651 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14446 14652 IEM_MC_CLEAR_HIGH_GREG_U64(X86_GREG_xAX); \ … … 14461 14667 IEM_MC_ARG(uint64_t, u64Value, 2); \ 14462 14668 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14463 IEM_MC_LOCAL(int32_t, rc); \14464 14669 \ 14465 14670 IEM_MC_FETCH_GREG_U64(u64Value, IEM_GET_MODRM_RM(pVCpu, bRm)); \ … … 14467 14672 IEM_MC_REF_GREG_U64(pu64DX, X86_GREG_xDX); \ 14468 14673 IEM_MC_REF_EFLAGS(pEFlags); \ 14469 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU64, pu64AX, pu64DX, u64Value, pEFlags); \14674 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU64, pu64AX, pu64DX, u64Value, pEFlags); \ 14470 14675 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14471 14676 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 14492 14697 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14493 14698 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 14494 IEM_MC_LOCAL(int32_t, rc); \14495 14699 \ 14496 14700 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ … … 14500 14704 IEM_MC_REF_GREG_U16(pu16DX, X86_GREG_xDX); \ 14501 14705 IEM_MC_REF_EFLAGS(pEFlags); \ 14502 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU16, pu16AX, pu16DX, u16Value, pEFlags); \14706 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU16, pu16AX, pu16DX, u16Value, pEFlags); \ 14503 14707 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14504 14708 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ … … 14517 14721 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14518 14722 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 14519 IEM_MC_LOCAL(int32_t, rc); \14520 14723 \ 14521 14724 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ … … 14525 14728 IEM_MC_REF_GREG_U32(pu32DX, X86_GREG_xDX); \ 14526 14729 IEM_MC_REF_EFLAGS(pEFlags); \ 14527 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU32, pu32AX, pu32DX, u32Value, pEFlags); \14730 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU32, pu32AX, pu32DX, u32Value, pEFlags); \ 14528 14731 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14529 14732 IEM_MC_CLEAR_HIGH_GREG_U64(X86_GREG_xAX); \ … … 14544 14747 IEM_MC_ARG(uint32_t *, pEFlags, 3); \ 14545 14748 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 14546 IEM_MC_LOCAL(int32_t, rc); \14547 14749 \ 14548 14750 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ … … 14552 14754 IEM_MC_REF_GREG_U64(pu64DX, X86_GREG_xDX); \ 14553 14755 IEM_MC_REF_EFLAGS(pEFlags); \ 14554 IEM_MC_CALL_AIMPL_4( rc, pImpl->pfnU64, pu64AX, pu64DX, u64Value, pEFlags); \14756 IEM_MC_CALL_AIMPL_4(int32_t, rc, pImpl->pfnU64, pu64AX, pu64DX, u64Value, pEFlags); \ 14555 14757 IEM_MC_IF_LOCAL_IS_Z(rc) { \ 14556 14758 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r104183 r104195 2264 2264 2265 2265 @staticmethod 2266 def parseMcArgEFlags(oSelf, sName, asParams): 2267 """ IEM_MC_ARG_EFLAGS """ 2268 oSelf.checkStmtParamCount(sName, asParams, 2); 2269 # Note! We split this one up into IEM_MC_ARG and IEM_MC_FETCH_EFLAGS. 2270 oStmtArg = McStmtArg('IEM_MC_ARG', ['uint32_t', asParams[0], asParams[1]], 'uint32_t', asParams[0], int(asParams[1])); 2271 oSelf.aoArgs.append(oStmtArg); 2272 oStmtFetch = McStmt('IEM_MC_FETCH_EFLAGS', [asParams[0]]); 2273 return (oStmtArg, oStmtFetch,); 2274 2275 @staticmethod 2266 2276 def parseMcArgLocalEFlags(oSelf, sName, asParams): 2267 2277 """ IEM_MC_ARG_LOCAL_EFLAGS """ … … 2314 2324 """ IEM_MC_CALL_AIMPL_3|4 """ 2315 2325 cArgs = int(sName[-1]); 2316 oSelf.checkStmtParamCount(sName, asParams, 2 + cArgs); 2317 return McStmtCall(sName, asParams, 1, 0); 2326 oSelf.checkStmtParamCount(sName, asParams, 3 + cArgs); 2327 oSelf.aoLocals.append(McStmtVar('IEM_MC_LOCAL', [asParams[0], asParams[1]], asParams[0], asParams[1])); 2328 return McStmtCall(sName, asParams, 2, 1); 2318 2329 2319 2330 @staticmethod … … 2974 2985 'IEM_MC_ARG': (McBlock.parseMcArg, False, False, True, ), 2975 2986 'IEM_MC_ARG_CONST': (McBlock.parseMcArgConst, False, False, True, ), 2987 'IEM_MC_ARG_EFLAGS': (McBlock.parseMcArgEFlags, False, False, True, ), 2976 2988 'IEM_MC_ARG_LOCAL_EFLAGS': (McBlock.parseMcArgLocalEFlags, False, False, True, ), 2977 2989 'IEM_MC_ARG_LOCAL_REF': (McBlock.parseMcArgLocalRef, False, False, True, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllInstTwoByte0f.cpp.h
r104185 r104195 10004 10004 IEMOP_HLP_MIN_386(); 10005 10005 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); 10006 const IEMOPBIN SIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_eflags);10006 const IEMOPBINTODOSIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_imul_two_eflags); 10007 10007 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10008 IEMOP_BODY_BINARY_ rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_MIN_386, imul, 0);10008 IEMOP_BODY_BINARY_TODO_rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_MIN_386, imul, 0); 10009 10009 } 10010 10010 … … 10501 10501 #ifndef TST_IEM_CHECK_MC 10502 10502 # if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && !defined(IEM_WITHOUT_ASSEMBLY) 10503 static const IEMOPBIN SIZES s_Native =10503 static const IEMOPBINTODOSIZES s_Native = 10504 10504 { NULL, NULL, iemAImpl_popcnt_u16, NULL, iemAImpl_popcnt_u32, NULL, iemAImpl_popcnt_u64, NULL }; 10505 10505 # endif 10506 static const IEMOPBIN SIZES s_Fallback =10506 static const IEMOPBINTODOSIZES s_Fallback = 10507 10507 { NULL, NULL, iemAImpl_popcnt_u16_fallback, NULL, iemAImpl_popcnt_u32_fallback, NULL, iemAImpl_popcnt_u64_fallback, NULL }; 10508 10508 #endif 10509 const IEMOPBIN SIZES * const pImpl = IEM_SELECT_HOST_OR_FALLBACK(fPopCnt, &s_Native, &s_Fallback);10509 const IEMOPBINTODOSIZES * const pImpl = IEM_SELECT_HOST_OR_FALLBACK(fPopCnt, &s_Native, &s_Fallback); 10510 10510 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 10511 IEMOP_BODY_BINARY_ rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, popcnt, 0);10511 IEMOP_BODY_BINARY_TODO_rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, popcnt, 0); 10512 10512 } 10513 10513 … … 11138 11138 IEMOP_HLP_MIN_386(); 11139 11139 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF); 11140 PCIEMOPBIN SIZES const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_bsf_eflags);11140 PCIEMOPBINTODOSIZES const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_bsf_eflags); 11141 11141 IEMOP_BODY_BIT_SCAN_OPERATOR_RV_RM(pImpl); 11142 11142 } … … 11159 11159 11160 11160 #ifndef TST_IEM_CHECK_MC 11161 static const IEMOPBIN SIZES s_iemAImpl_tzcnt =11161 static const IEMOPBINTODOSIZES s_iemAImpl_tzcnt = 11162 11162 { NULL, NULL, iemAImpl_tzcnt_u16, NULL, iemAImpl_tzcnt_u32, NULL, iemAImpl_tzcnt_u64, NULL }; 11163 static const IEMOPBIN SIZES s_iemAImpl_tzcnt_amd =11163 static const IEMOPBINTODOSIZES s_iemAImpl_tzcnt_amd = 11164 11164 { NULL, NULL, iemAImpl_tzcnt_u16_amd, NULL, iemAImpl_tzcnt_u32_amd, NULL, iemAImpl_tzcnt_u64_amd, NULL }; 11165 static const IEMOPBIN SIZES s_iemAImpl_tzcnt_intel =11165 static const IEMOPBINTODOSIZES s_iemAImpl_tzcnt_intel = 11166 11166 { NULL, NULL, iemAImpl_tzcnt_u16_intel, NULL, iemAImpl_tzcnt_u32_intel, NULL, iemAImpl_tzcnt_u64_intel, NULL }; 11167 static const IEMOPBIN SIZES * const s_iemAImpl_tzcnt_eflags[2][4] =11167 static const IEMOPBINTODOSIZES * const s_iemAImpl_tzcnt_eflags[2][4] = 11168 11168 { 11169 11169 { &s_iemAImpl_tzcnt_intel, &s_iemAImpl_tzcnt_intel, &s_iemAImpl_tzcnt_amd, &s_iemAImpl_tzcnt_intel }, … … 11172 11172 #endif 11173 11173 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF); 11174 const IEMOPBIN SIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT_EX(s_iemAImpl_tzcnt_eflags,11174 const IEMOPBINTODOSIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT_EX(s_iemAImpl_tzcnt_eflags, 11175 11175 IEM_GET_HOST_CPU_FEATURES(pVCpu)->fBmi1); 11176 11176 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 11177 IEMOP_BODY_BINARY_ rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, tzcnt, 0);11177 IEMOP_BODY_BINARY_TODO_rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, tzcnt, 0); 11178 11178 } 11179 11179 … … 11193 11193 IEMOP_HLP_MIN_386(); 11194 11194 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF); 11195 PCIEMOPBIN SIZES const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_bsr_eflags);11195 PCIEMOPBINTODOSIZES const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT(g_iemAImpl_bsr_eflags); 11196 11196 IEMOP_BODY_BIT_SCAN_OPERATOR_RV_RM(pImpl); 11197 11197 } … … 11214 11214 11215 11215 #ifndef TST_IEM_CHECK_MC 11216 static const IEMOPBIN SIZES s_iemAImpl_lzcnt =11216 static const IEMOPBINTODOSIZES s_iemAImpl_lzcnt = 11217 11217 { NULL, NULL, iemAImpl_lzcnt_u16, NULL, iemAImpl_lzcnt_u32, NULL, iemAImpl_lzcnt_u64, NULL }; 11218 static const IEMOPBIN SIZES s_iemAImpl_lzcnt_amd =11218 static const IEMOPBINTODOSIZES s_iemAImpl_lzcnt_amd = 11219 11219 { NULL, NULL, iemAImpl_lzcnt_u16_amd, NULL, iemAImpl_lzcnt_u32_amd, NULL, iemAImpl_lzcnt_u64_amd, NULL }; 11220 static const IEMOPBIN SIZES s_iemAImpl_lzcnt_intel =11220 static const IEMOPBINTODOSIZES s_iemAImpl_lzcnt_intel = 11221 11221 { NULL, NULL, iemAImpl_lzcnt_u16_intel, NULL, iemAImpl_lzcnt_u32_intel, NULL, iemAImpl_lzcnt_u64_intel, NULL }; 11222 static const IEMOPBIN SIZES * const s_iemAImpl_lzcnt_eflags[2][4] =11222 static const IEMOPBINTODOSIZES * const s_iemAImpl_lzcnt_eflags[2][4] = 11223 11223 { 11224 11224 { &s_iemAImpl_lzcnt_intel, &s_iemAImpl_lzcnt_intel, &s_iemAImpl_lzcnt_amd, &s_iemAImpl_lzcnt_intel }, … … 11227 11227 #endif 11228 11228 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF); 11229 const IEMOPBIN SIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT_EX(s_iemAImpl_lzcnt_eflags,11229 const IEMOPBINTODOSIZES * const pImpl = IEMTARGETCPU_EFL_BEHAVIOR_SELECT_EX(s_iemAImpl_lzcnt_eflags, 11230 11230 IEM_GET_HOST_CPU_FEATURES(pVCpu)->fBmi1); 11231 11231 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 11232 IEMOP_BODY_BINARY_ rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, lzcnt, 0);11232 IEMOP_BODY_BINARY_TODO_rv_rm(bRm, pImpl->pfnNormalU16, pImpl->pfnNormalU32, pImpl->pfnNormalU64, IEM_MC_F_NOT_286_OR_OLDER, lzcnt, 0); 11233 11233 } 11234 11234 -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veLiveness.cpp
r104183 r104195 1038 1038 #define IEM_MC_CALL_VOID_AIMPL_3(a_pfn, a0, a1, a2) NOP() 1039 1039 #define IEM_MC_CALL_VOID_AIMPL_4(a_pfn, a0, a1, a2, a3) NOP() 1040 #define IEM_MC_CALL_AIMPL_3(a_rc , a_pfn, a0, a1, a2)NOP()1041 #define IEM_MC_CALL_AIMPL_4(a_rc , a_pfn, a0, a1, a2, a3)NOP()1040 #define IEM_MC_CALL_AIMPL_3(a_rcType, a_rc, a_pfn, a0, a1, a2) NOP() 1041 #define IEM_MC_CALL_AIMPL_4(a_rcType, a_rc, a_pfn, a0, a1, a2, a3) NOP() 1042 1042 1043 1043 #define IEM_MC_CALL_FPU_AIMPL_1(a_pfnAImpl, a0) NOP() -
trunk/src/VBox/VMM/VMMAll/IEMAllN8vePython.py
r104150 r104195 285 285 asVarsInScope = []; 286 286 for oStmt in aoStmts: 287 if isinstance(oStmt, iai.McStmtCall) and oStmt.sName.startswith('IEM_MC_CALL_AIMPL_'): 288 oStmt = iai.McStmtVar(oStmt.sName, oStmt.asParams[0:2], oStmt.asParams[0], oStmt.asParams[1]); 289 287 290 if isinstance(oStmt, iai.McStmtVar): 288 291 if oStmt.sVarName in dVars: -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r104183 r104195 2482 2482 off = iemNativeEmitCallAImpl3(pReNative, off, UINT8_MAX /*idxVarRc*/, (uintptr_t)(a_pfn), a0, a1, a2) 2483 2483 2484 #define IEM_MC_CALL_AIMPL_3(a_rc, a_pfn, a0, a1, a2) \ 2484 #define IEM_MC_CALL_AIMPL_3(a_rcType, a_rc, a_pfn, a0, a1, a2) \ 2485 IEM_MC_LOCAL(a_rcType, a_rc); \ 2485 2486 off = iemNativeEmitCallAImpl3(pReNative, off, a_rc, (uintptr_t)(a_pfn), a0, a1, a2) 2486 2487 … … 2500 2501 off = iemNativeEmitCallAImpl4(pReNative, off, UINT8_MAX /*idxVarRc*/, (uintptr_t)(a_pfn), a0, a1, a2, a3) 2501 2502 2502 #define IEM_MC_CALL_AIMPL_4(a_rc, a_pfn, a0, a1, a2, a3) \ 2503 #define IEM_MC_CALL_AIMPL_4(a_rcType, a_rc, a_pfn, a0, a1, a2, a3) \ 2504 IEM_MC_LOCAL(a_rcType, a_rc); \ 2503 2505 off = iemNativeEmitCallAImpl4(pReNative, off, a_rc, (uintptr_t)(a_pfn), a0, a1, a2, a3) 2504 2506 -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r104135 r104195 771 771 offBits = sMember.rfind('U') + 1; 772 772 if sBaseType == 'PCIEMOPBINSIZES': return 'PFNIEMAIMPLBINU' + sMember[offBits:]; 773 if sBaseType == 'PCIEMOPBINTODOSIZES': return 'PFNIEMAIMPLBINTODOU' + sMember[offBits:]; 773 774 if sBaseType == 'PCIEMOPUNARYSIZES': return 'PFNIEMAIMPLUNARYU' + sMember[offBits:]; 774 775 if sBaseType == 'PCIEMOPSHIFTSIZES': return 'PFNIEMAIMPLSHIFTU' + sMember[offBits:]; … … 1939 1940 raise Exception('Variable %s is defined more than once!' % (oStmt.sVarName,)); 1940 1941 self.dVariables[oStmt.sVarName] = oStmt.sVarName; 1942 elif isinstance(oStmt, iai.McStmtCall) and oStmt.sName.startswith('IEM_MC_CALL_AIMPL_'): 1943 if oStmt.asParams[1] in self.dVariables: 1944 raise Exception('Variable %s is defined more than once!' % (oStmt.asParams[1],)); 1945 self.dVariables[oStmt.asParams[1]] = iai.McStmtVar('IEM_MC_LOCAL', oStmt.asParams[0:2], 1946 oStmt.asParams[0], oStmt.asParams[1]); 1941 1947 1942 1948 # There shouldn't be any variables or arguments declared inside if/ -
trunk/src/VBox/VMM/include/IEMInternal.h
r104188 r104195 2592 2592 /** @name Arithmetic assignment operations on bytes (binary). 2593 2593 * @{ */ 2594 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINU8, (uint8_t *pu8Dst, uint8_t u8Src, uint32_t *pEFlags));2594 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINU8, (uint32_t fEFlagsIn, uint8_t *pu8Dst, uint8_t u8Src)); 2595 2595 typedef FNIEMAIMPLBINU8 *PFNIEMAIMPLBINU8; 2596 2596 FNIEMAIMPLBINU8 iemAImpl_add_u8, iemAImpl_add_u8_locked; … … 2601 2601 FNIEMAIMPLBINU8 iemAImpl_xor_u8, iemAImpl_xor_u8_locked; 2602 2602 FNIEMAIMPLBINU8 iemAImpl_and_u8, iemAImpl_and_u8_locked; 2603 2604 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOU8, (uint8_t *pu8Dst, uint8_t u8Src, uint32_t *pEFlags)); 2605 typedef FNIEMAIMPLBINTODOU8 *PFNIEMAIMPLBINTODOU8; 2603 2606 /** @} */ 2604 2607 2605 2608 /** @name Arithmetic assignment operations on words (binary). 2606 2609 * @{ */ 2607 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINU16, (uint16_t *pu16Dst, uint16_t u16Src, uint32_t *pEFlags));2610 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINU16, (uint32_t fEFlagsIn, uint16_t *pu16Dst, uint16_t u16Src)); 2608 2611 typedef FNIEMAIMPLBINU16 *PFNIEMAIMPLBINU16; 2609 2612 FNIEMAIMPLBINU16 iemAImpl_add_u16, iemAImpl_add_u16_locked; … … 2614 2617 FNIEMAIMPLBINU16 iemAImpl_xor_u16, iemAImpl_xor_u16_locked; 2615 2618 FNIEMAIMPLBINU16 iemAImpl_and_u16, iemAImpl_and_u16_locked; 2619 2620 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOU16, (uint16_t *pu16Dst, uint16_t u16Src, uint32_t *pEFlags)); 2621 typedef FNIEMAIMPLBINTODOU16 *PFNIEMAIMPLBINTODOU16; 2616 2622 /** @} */ 2617 2623 2624 2618 2625 /** @name Arithmetic assignment operations on double words (binary). 2619 2626 * @{ */ 2620 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINU32, (uint32_t *pu32Dst, uint32_t u32Src, uint32_t *pEFlags));2627 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINU32, (uint32_t fEFlagsIn, uint32_t *pu32Dst, uint32_t u32Src)); 2621 2628 typedef FNIEMAIMPLBINU32 *PFNIEMAIMPLBINU32; 2622 2629 FNIEMAIMPLBINU32 iemAImpl_add_u32, iemAImpl_add_u32_locked; … … 2627 2634 FNIEMAIMPLBINU32 iemAImpl_xor_u32, iemAImpl_xor_u32_locked; 2628 2635 FNIEMAIMPLBINU32 iemAImpl_and_u32, iemAImpl_and_u32_locked; 2629 FNIEMAIMPLBINU32 iemAImpl_blsi_u32, iemAImpl_blsi_u32_fallback; 2630 FNIEMAIMPLBINU32 iemAImpl_blsr_u32, iemAImpl_blsr_u32_fallback; 2631 FNIEMAIMPLBINU32 iemAImpl_blsmsk_u32, iemAImpl_blsmsk_u32_fallback; 2636 2637 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOU32, (uint32_t *pu32Dst, uint32_t u32Src, uint32_t *pEFlags)); 2638 typedef FNIEMAIMPLBINTODOU32 *PFNIEMAIMPLBINTODOU32; 2639 FNIEMAIMPLBINTODOU32 iemAImpl_blsi_u32, iemAImpl_blsi_u32_fallback; 2640 FNIEMAIMPLBINTODOU32 iemAImpl_blsr_u32, iemAImpl_blsr_u32_fallback; 2641 FNIEMAIMPLBINTODOU32 iemAImpl_blsmsk_u32, iemAImpl_blsmsk_u32_fallback; 2632 2642 /** @} */ 2633 2643 2634 2644 /** @name Arithmetic assignment operations on quad words (binary). 2635 2645 * @{ */ 2636 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINU64, (uint64_t *pu64Dst, uint64_t u64Src, uint32_t *pEFlags));2646 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINU64, (uint32_t fEFlagsIn, uint64_t *pu64Dst, uint64_t u64Src)); 2637 2647 typedef FNIEMAIMPLBINU64 *PFNIEMAIMPLBINU64; 2638 2648 FNIEMAIMPLBINU64 iemAImpl_add_u64, iemAImpl_add_u64_locked; … … 2643 2653 FNIEMAIMPLBINU64 iemAImpl_xor_u64, iemAImpl_xor_u64_locked; 2644 2654 FNIEMAIMPLBINU64 iemAImpl_and_u64, iemAImpl_and_u64_locked; 2645 FNIEMAIMPLBINU64 iemAImpl_blsi_u64, iemAImpl_blsi_u64_fallback; 2646 FNIEMAIMPLBINU64 iemAImpl_blsr_u64, iemAImpl_blsr_u64_fallback; 2647 FNIEMAIMPLBINU64 iemAImpl_blsmsk_u64, iemAImpl_blsmsk_u64_fallback; 2655 2656 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOU64, (uint64_t *pu64Dst, uint64_t u64Src, uint32_t *pEFlags)); 2657 typedef FNIEMAIMPLBINTODOU64 *PFNIEMAIMPLBINTODOU64; 2658 FNIEMAIMPLBINTODOU64 iemAImpl_blsi_u64, iemAImpl_blsi_u64_fallback; 2659 FNIEMAIMPLBINTODOU64 iemAImpl_blsr_u64, iemAImpl_blsr_u64_fallback; 2660 FNIEMAIMPLBINTODOU64 iemAImpl_blsmsk_u64, iemAImpl_blsmsk_u64_fallback; 2648 2661 /** @} */ 2649 2662 2650 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINROU8,(uint8_t const *pu8Dst, uint8_t u8Src, uint32_t *pEFlags));2663 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINROU8, (uint32_t fEFlagsIn, uint8_t const *pu8Dst, uint8_t u8Src)); 2651 2664 typedef FNIEMAIMPLBINROU8 *PFNIEMAIMPLBINROU8; 2652 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINROU16,(uint16_t const *pu16Dst, uint16_t u16Src, uint32_t *pEFlags));2665 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINROU16,(uint32_t fEFlagsIn, uint16_t const *pu16Dst, uint16_t u16Src)); 2653 2666 typedef FNIEMAIMPLBINROU16 *PFNIEMAIMPLBINROU16; 2654 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINROU32,(uint32_t const *pu32Dst, uint32_t u32Src, uint32_t *pEFlags));2667 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINROU32,(uint32_t fEFlagsIn, uint32_t const *pu32Dst, uint32_t u32Src)); 2655 2668 typedef FNIEMAIMPLBINROU32 *PFNIEMAIMPLBINROU32; 2656 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLBINROU64,(uint64_t const *pu64Dst, uint64_t u64Src, uint32_t *pEFlags));2669 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLBINROU64,(uint32_t fEFlagsIn, uint64_t const *pu64Dst, uint64_t u64Src)); 2657 2670 typedef FNIEMAIMPLBINROU64 *PFNIEMAIMPLBINROU64; 2658 2671 … … 2673 2686 /** @} */ 2674 2687 2688 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOROU16,(uint16_t const *pu16Dst, uint16_t u16Src, uint32_t *pEFlags)); 2689 typedef FNIEMAIMPLBINTODOROU16 *PFNIEMAIMPLBINTODOROU16; 2690 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOROU32,(uint32_t const *pu32Dst, uint32_t u32Src, uint32_t *pEFlags)); 2691 typedef FNIEMAIMPLBINTODOROU32 *PFNIEMAIMPLBINTODOROU32; 2692 typedef IEM_DECL_IMPL_TYPE(void, FNIEMAIMPLBINTODOROU64,(uint64_t const *pu64Dst, uint64_t u64Src, uint32_t *pEFlags)); 2693 typedef FNIEMAIMPLBINTODOROU64 *PFNIEMAIMPLBINTODOROU64; 2694 2675 2695 /** @name Bit operations operations (thrown in with the binary ops). 2676 2696 * @{ */ 2677 FNIEMAIMPLBIN ROU16 iemAImpl_bt_u16;2678 FNIEMAIMPLBIN ROU32 iemAImpl_bt_u32;2679 FNIEMAIMPLBIN ROU64 iemAImpl_bt_u64;2680 FNIEMAIMPLBIN U16 iemAImpl_btc_u16, iemAImpl_btc_u16_locked;2681 FNIEMAIMPLBIN U32 iemAImpl_btc_u32, iemAImpl_btc_u32_locked;2682 FNIEMAIMPLBIN U64 iemAImpl_btc_u64, iemAImpl_btc_u64_locked;2683 FNIEMAIMPLBIN U16 iemAImpl_btr_u16, iemAImpl_btr_u16_locked;2684 FNIEMAIMPLBIN U32 iemAImpl_btr_u32, iemAImpl_btr_u32_locked;2685 FNIEMAIMPLBIN U64 iemAImpl_btr_u64, iemAImpl_btr_u64_locked;2686 FNIEMAIMPLBIN U16 iemAImpl_bts_u16, iemAImpl_bts_u16_locked;2687 FNIEMAIMPLBIN U32 iemAImpl_bts_u32, iemAImpl_bts_u32_locked;2688 FNIEMAIMPLBIN U64 iemAImpl_bts_u64, iemAImpl_bts_u64_locked;2697 FNIEMAIMPLBINTODOROU16 iemAImpl_bt_u16; 2698 FNIEMAIMPLBINTODOROU32 iemAImpl_bt_u32; 2699 FNIEMAIMPLBINTODOROU64 iemAImpl_bt_u64; 2700 FNIEMAIMPLBINTODOU16 iemAImpl_btc_u16, iemAImpl_btc_u16_locked; 2701 FNIEMAIMPLBINTODOU32 iemAImpl_btc_u32, iemAImpl_btc_u32_locked; 2702 FNIEMAIMPLBINTODOU64 iemAImpl_btc_u64, iemAImpl_btc_u64_locked; 2703 FNIEMAIMPLBINTODOU16 iemAImpl_btr_u16, iemAImpl_btr_u16_locked; 2704 FNIEMAIMPLBINTODOU32 iemAImpl_btr_u32, iemAImpl_btr_u32_locked; 2705 FNIEMAIMPLBINTODOU64 iemAImpl_btr_u64, iemAImpl_btr_u64_locked; 2706 FNIEMAIMPLBINTODOU16 iemAImpl_bts_u16, iemAImpl_bts_u16_locked; 2707 FNIEMAIMPLBINTODOU32 iemAImpl_bts_u32, iemAImpl_bts_u32_locked; 2708 FNIEMAIMPLBINTODOU64 iemAImpl_bts_u64, iemAImpl_bts_u64_locked; 2689 2709 /** @} */ 2690 2710 … … 2827 2847 /** @name Bit search operations (thrown in with the binary ops). 2828 2848 * @{ */ 2829 FNIEMAIMPLBIN U16 iemAImpl_bsf_u16, iemAImpl_bsf_u16_amd, iemAImpl_bsf_u16_intel;2830 FNIEMAIMPLBIN U32 iemAImpl_bsf_u32, iemAImpl_bsf_u32_amd, iemAImpl_bsf_u32_intel;2831 FNIEMAIMPLBIN U64 iemAImpl_bsf_u64, iemAImpl_bsf_u64_amd, iemAImpl_bsf_u64_intel;2832 FNIEMAIMPLBIN U16 iemAImpl_bsr_u16, iemAImpl_bsr_u16_amd, iemAImpl_bsr_u16_intel;2833 FNIEMAIMPLBIN U32 iemAImpl_bsr_u32, iemAImpl_bsr_u32_amd, iemAImpl_bsr_u32_intel;2834 FNIEMAIMPLBIN U64 iemAImpl_bsr_u64, iemAImpl_bsr_u64_amd, iemAImpl_bsr_u64_intel;2835 FNIEMAIMPLBIN U16 iemAImpl_lzcnt_u16, iemAImpl_lzcnt_u16_amd, iemAImpl_lzcnt_u16_intel;2836 FNIEMAIMPLBIN U32 iemAImpl_lzcnt_u32, iemAImpl_lzcnt_u32_amd, iemAImpl_lzcnt_u32_intel;2837 FNIEMAIMPLBIN U64 iemAImpl_lzcnt_u64, iemAImpl_lzcnt_u64_amd, iemAImpl_lzcnt_u64_intel;2838 FNIEMAIMPLBIN U16 iemAImpl_tzcnt_u16, iemAImpl_tzcnt_u16_amd, iemAImpl_tzcnt_u16_intel;2839 FNIEMAIMPLBIN U32 iemAImpl_tzcnt_u32, iemAImpl_tzcnt_u32_amd, iemAImpl_tzcnt_u32_intel;2840 FNIEMAIMPLBIN U64 iemAImpl_tzcnt_u64, iemAImpl_tzcnt_u64_amd, iemAImpl_tzcnt_u64_intel;2841 FNIEMAIMPLBIN U16 iemAImpl_popcnt_u16, iemAImpl_popcnt_u16_fallback;2842 FNIEMAIMPLBIN U32 iemAImpl_popcnt_u32, iemAImpl_popcnt_u32_fallback;2843 FNIEMAIMPLBIN U64 iemAImpl_popcnt_u64, iemAImpl_popcnt_u64_fallback;2849 FNIEMAIMPLBINTODOU16 iemAImpl_bsf_u16, iemAImpl_bsf_u16_amd, iemAImpl_bsf_u16_intel; 2850 FNIEMAIMPLBINTODOU32 iemAImpl_bsf_u32, iemAImpl_bsf_u32_amd, iemAImpl_bsf_u32_intel; 2851 FNIEMAIMPLBINTODOU64 iemAImpl_bsf_u64, iemAImpl_bsf_u64_amd, iemAImpl_bsf_u64_intel; 2852 FNIEMAIMPLBINTODOU16 iemAImpl_bsr_u16, iemAImpl_bsr_u16_amd, iemAImpl_bsr_u16_intel; 2853 FNIEMAIMPLBINTODOU32 iemAImpl_bsr_u32, iemAImpl_bsr_u32_amd, iemAImpl_bsr_u32_intel; 2854 FNIEMAIMPLBINTODOU64 iemAImpl_bsr_u64, iemAImpl_bsr_u64_amd, iemAImpl_bsr_u64_intel; 2855 FNIEMAIMPLBINTODOU16 iemAImpl_lzcnt_u16, iemAImpl_lzcnt_u16_amd, iemAImpl_lzcnt_u16_intel; 2856 FNIEMAIMPLBINTODOU32 iemAImpl_lzcnt_u32, iemAImpl_lzcnt_u32_amd, iemAImpl_lzcnt_u32_intel; 2857 FNIEMAIMPLBINTODOU64 iemAImpl_lzcnt_u64, iemAImpl_lzcnt_u64_amd, iemAImpl_lzcnt_u64_intel; 2858 FNIEMAIMPLBINTODOU16 iemAImpl_tzcnt_u16, iemAImpl_tzcnt_u16_amd, iemAImpl_tzcnt_u16_intel; 2859 FNIEMAIMPLBINTODOU32 iemAImpl_tzcnt_u32, iemAImpl_tzcnt_u32_amd, iemAImpl_tzcnt_u32_intel; 2860 FNIEMAIMPLBINTODOU64 iemAImpl_tzcnt_u64, iemAImpl_tzcnt_u64_amd, iemAImpl_tzcnt_u64_intel; 2861 FNIEMAIMPLBINTODOU16 iemAImpl_popcnt_u16, iemAImpl_popcnt_u16_fallback; 2862 FNIEMAIMPLBINTODOU32 iemAImpl_popcnt_u32, iemAImpl_popcnt_u32_fallback; 2863 FNIEMAIMPLBINTODOU64 iemAImpl_popcnt_u64, iemAImpl_popcnt_u64_fallback; 2844 2864 /** @} */ 2845 2865 2846 2866 /** @name Signed multiplication operations (thrown in with the binary ops). 2847 2867 * @{ */ 2848 FNIEMAIMPLBIN U16 iemAImpl_imul_two_u16, iemAImpl_imul_two_u16_amd, iemAImpl_imul_two_u16_intel;2849 FNIEMAIMPLBIN U32 iemAImpl_imul_two_u32, iemAImpl_imul_two_u32_amd, iemAImpl_imul_two_u32_intel;2850 FNIEMAIMPLBIN U64 iemAImpl_imul_two_u64, iemAImpl_imul_two_u64_amd, iemAImpl_imul_two_u64_intel;2868 FNIEMAIMPLBINTODOU16 iemAImpl_imul_two_u16, iemAImpl_imul_two_u16_amd, iemAImpl_imul_two_u16_intel; 2869 FNIEMAIMPLBINTODOU32 iemAImpl_imul_two_u32, iemAImpl_imul_two_u32_amd, iemAImpl_imul_two_u32_intel; 2870 FNIEMAIMPLBINTODOU64 iemAImpl_imul_two_u64, iemAImpl_imul_two_u64_amd, iemAImpl_imul_two_u64_intel; 2851 2871 /** @} */ 2852 2872 … … 2984 3004 /** @name Misc. 2985 3005 * @{ */ 2986 FNIEMAIMPLBIN U16 iemAImpl_arpl;3006 FNIEMAIMPLBINTODOU16 iemAImpl_arpl; 2987 3007 /** @} */ 2988 3008 … … 3006 3026 /** @name ADOX and ADCX 3007 3027 * @{ */ 3008 FNIEMAIMPLBIN U32 iemAImpl_adcx_u32, iemAImpl_adcx_u32_fallback;3009 FNIEMAIMPLBIN U64 iemAImpl_adcx_u64, iemAImpl_adcx_u64_fallback;3010 FNIEMAIMPLBIN U32 iemAImpl_adox_u32, iemAImpl_adox_u32_fallback;3011 FNIEMAIMPLBIN U64 iemAImpl_adox_u64, iemAImpl_adox_u64_fallback;3028 FNIEMAIMPLBINTODOU32 iemAImpl_adcx_u32, iemAImpl_adcx_u32_fallback; 3029 FNIEMAIMPLBINTODOU64 iemAImpl_adcx_u64, iemAImpl_adcx_u64_fallback; 3030 FNIEMAIMPLBINTODOU32 iemAImpl_adox_u32, iemAImpl_adox_u32_fallback; 3031 FNIEMAIMPLBINTODOU64 iemAImpl_adox_u64, iemAImpl_adox_u64_fallback; 3012 3032 /** @} */ 3013 3033 … … 3971 3991 /** Pointer to a binary operator function table. */ 3972 3992 typedef IEMOPBINSIZES const *PCIEMOPBINSIZES; 3993 3994 3995 /** 3996 * Function table for a binary operator providing implementation based on 3997 * operand size. 3998 */ 3999 typedef struct IEMOPBINTODOSIZES 4000 { 4001 PFNIEMAIMPLBINTODOU8 pfnNormalU8, pfnLockedU8; 4002 PFNIEMAIMPLBINTODOU16 pfnNormalU16, pfnLockedU16; 4003 PFNIEMAIMPLBINTODOU32 pfnNormalU32, pfnLockedU32; 4004 PFNIEMAIMPLBINTODOU64 pfnNormalU64, pfnLockedU64; 4005 } IEMOPBINTODOSIZES; 4006 /** Pointer to a binary operator function table. */ 4007 typedef IEMOPBINTODOSIZES const *PCIEMOPBINTODOSIZES; 3973 4008 3974 4009 -
trunk/src/VBox/VMM/include/IEMMc.h
r104183 r104195 197 197 #define IEM_MC_ARG_CONST(a_Type, a_Name, a_Value, a_iArg) a_Type const a_Name = (a_Value) 198 198 #define IEM_MC_ARG_LOCAL_REF(a_Type, a_Name, a_Local, a_iArg) a_Type const a_Name = &(a_Local) 199 /** @note IEMAllInstPython.py duplicates the expansion. */ 200 #define IEM_MC_ARG_EFLAGS(a_Name, a_iArg) uint32_t const a_Name = pVCpu->cpum.GstCtx.eflags.u 199 201 /** @note IEMAllInstPython.py duplicates the expansion. */ 200 202 #define IEM_MC_ARG_LOCAL_EFLAGS(a_pName, a_Name, a_iArg) \ … … 2622 2624 #define IEM_MC_CALL_VOID_AIMPL_3(a_pfn, a0, a1, a2) (a_pfn)((a0), (a1), (a2)) 2623 2625 #define IEM_MC_CALL_VOID_AIMPL_4(a_pfn, a0, a1, a2, a3) (a_pfn)((a0), (a1), (a2), (a3)) 2624 #define IEM_MC_CALL_AIMPL_3(a_rc , a_pfn, a0, a1, a2) (a_rc)= (a_pfn)((a0), (a1), (a2))2625 #define IEM_MC_CALL_AIMPL_4(a_rc , a_pfn, a0, a1, a2, a3) (a_rc)= (a_pfn)((a0), (a1), (a2), (a3))2626 #define IEM_MC_CALL_AIMPL_3(a_rcType, a_rc, a_pfn, a0, a1, a2) a_rcType const a_rc = (a_pfn)((a0), (a1), (a2)) 2627 #define IEM_MC_CALL_AIMPL_4(a_rcType, a_rc, a_pfn, a0, a1, a2, a3) a_rcType const a_rc = (a_pfn)((a0), (a1), (a2), (a3)) 2626 2628 2627 2629 -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r104174 r104195 1761 1761 a_TestType Test; \ 1762 1762 Test.fEflIn = RandEFlags(); \ 1763 Test.fEflOut = Test.fEflIn; \1764 1763 Test.uDstIn = RandU ## a_cBits ## Dst(iTest); \ 1765 1764 Test.uDstOut = Test.uDstIn; \ … … 1768 1767 Test.uSrcIn &= a_cBits - 1; /* Restrict bit index according to operand width */ \ 1769 1768 Test.uMisc = 0; \ 1770 pfn(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); \1769 Test.fEflOut = pfn(Test.fEflIn, &Test.uDstOut, Test.uSrcIn); \ 1771 1770 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); \ 1772 1771 } \ … … 1776 1775 Test.fEflIn = g_aBinU ## a_cBits[iFn].paFixedTests[iTest].fEflIn == UINT32_MAX ? RandEFlags() \ 1777 1776 : g_aBinU ## a_cBits[iFn].paFixedTests[iTest].fEflIn; \ 1778 Test.fEflOut = Test.fEflIn; \1779 1777 Test.uDstIn = g_aBinU ## a_cBits[iFn].paFixedTests[iTest].uDstIn; \ 1780 1778 Test.uDstOut = Test.uDstIn; \ 1781 1779 Test.uSrcIn = g_aBinU ## a_cBits[iFn].paFixedTests[iTest].uSrcIn; \ 1782 1780 Test.uMisc = g_aBinU ## a_cBits[iFn].paFixedTests[iTest].uMisc; \ 1783 pfn(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); \1781 Test.fEflOut = pfn(Test.fEflIn, &Test.uDstOut, Test.uSrcIn); \ 1784 1782 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); \ 1785 1783 } \ … … 1818 1816 cIterations /= 4; \ 1819 1817 RTThreadYield(); \ 1820 uint64_t const nsStart 1818 uint64_t const nsStart = RTTimeNanoTS(); \ 1821 1819 for (uint32_t i = 0; i < cIterations; i++) \ 1822 1820 { \ 1823 uint32_t fBenchEfl = fEflIn; \ 1824 a_uType uBenchDst = uDstIn; \ 1825 pfn(&uBenchDst, uSrcIn, &fBenchEfl); \ 1821 a_uType uBenchDst = uDstIn; \ 1822 pfn(fEflIn, &uBenchDst, uSrcIn); \ 1826 1823 \ 1827 fBenchEfl = fEflIn; \1828 1824 uBenchDst = uDstIn; \ 1829 pfn( &uBenchDst, uSrcIn, &fBenchEfl); \1825 pfn(fEflIn, &uBenchDst, uSrcIn); \ 1830 1826 \ 1831 fBenchEfl = fEflIn; \1832 1827 uBenchDst = uDstIn; \ 1833 pfn( &uBenchDst, uSrcIn, &fBenchEfl); \1828 pfn(fEflIn, &uBenchDst, uSrcIn); \ 1834 1829 \ 1835 fBenchEfl = fEflIn; \1836 1830 uBenchDst = uDstIn; \ 1837 pfn( &uBenchDst, uSrcIn, &fBenchEfl); \1831 pfn(fEflIn, &uBenchDst, uSrcIn); \ 1838 1832 } \ 1839 1833 return RTTimeNanoTS() - nsStart; \ … … 1855 1849 for (uint32_t iTest = 0; iTest < cTests; iTest++ ) \ 1856 1850 { \ 1857 uint32_t fEfl = paTests[iTest].fEflIn; \1858 1851 a_uType uDst = paTests[iTest].uDstIn; \ 1859 pfn(&uDst, paTests[iTest].uSrcIn, &fEfl); \1852 uint32_t fEfl = pfn(paTests[iTest].fEflIn, &uDst, paTests[iTest].uSrcIn); \ 1860 1853 if ( uDst != paTests[iTest].uDstOut \ 1861 || fEfl != paTests[iTest].fEflOut 1854 || fEfl != paTests[iTest].fEflOut) \ 1862 1855 RTTestFailed(g_hTest, "#%u%s: efl=%#08x dst=" a_Fmt " src=" a_Fmt " -> efl=%#08x dst=" a_Fmt ", expected %#08x & " a_Fmt "%s - %s\n", \ 1863 1856 iTest, !iVar ? "" : "/n", paTests[iTest].fEflIn, paTests[iTest].uDstIn, paTests[iTest].uSrcIn, \ … … 1868 1861 { \ 1869 1862 *g_pu ## a_cBits = paTests[iTest].uDstIn; \ 1870 *g_pfEfl = paTests[iTest].fEflIn; \ 1871 pfn(g_pu ## a_cBits, paTests[iTest].uSrcIn, g_pfEfl); \ 1863 fEfl = pfn(paTests[iTest].fEflIn, g_pu ## a_cBits, paTests[iTest].uSrcIn); \ 1872 1864 RTTEST_CHECK(g_hTest, *g_pu ## a_cBits == paTests[iTest].uDstOut); \ 1873 RTTEST_CHECK(g_hTest, *g_pfEfl == paTests[iTest].fEflOut); \1865 RTTEST_CHECK(g_hTest, fEfl == paTests[iTest].fEflOut); \ 1874 1866 } \ 1875 1867 } \ … … 1946 1938 ENTRY_BIN_PFN_CAST(cmp_u16, PFNIEMAIMPLBINU16), 1947 1939 ENTRY_BIN_PFN_CAST(test_u16, PFNIEMAIMPLBINU16), 1940 #if 0 /** @todo convert to new eflags format */ 1948 1941 ENTRY_BIN_PFN_CAST_EX(bt_u16, PFNIEMAIMPLBINU16, 1), 1949 1942 ENTRY_BIN_EX(btc_u16, 1), … … 1960 1953 ENTRY_BIN_INTEL(imul_two_u16, X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF), 1961 1954 ENTRY_BIN(arpl), 1955 #endif 1962 1956 }; 1963 1957 TEST_BINARY_OPS(16, uint16_t, "%#06x", BINU16_TEST_T, g_aBinU16) … … 1992 1986 ENTRY_BIN_PFN_CAST(cmp_u32, PFNIEMAIMPLBINU32), 1993 1987 ENTRY_BIN_PFN_CAST(test_u32, PFNIEMAIMPLBINU32), 1988 #if 0 /** @todo convert to new eflags format */ 1994 1989 ENTRY_BIN_PFN_CAST_EX(bt_u32, PFNIEMAIMPLBINU32, 1), 1995 1990 ENTRY_BIN_EX(btc_u32, 1), … … 2007 2002 ENTRY_BIN(adcx_u32), 2008 2003 ENTRY_BIN(adox_u32), 2004 #endif 2009 2005 }; 2010 2006 TEST_BINARY_OPS(32, uint32_t, "%#010RX32", BINU32_TEST_T, g_aBinU32) … … 2039 2035 ENTRY_BIN_PFN_CAST(cmp_u64, PFNIEMAIMPLBINU64), 2040 2036 ENTRY_BIN_PFN_CAST(test_u64, PFNIEMAIMPLBINU64), 2037 #if 0 /** @todo convert to new eflags format */ 2041 2038 ENTRY_BIN_PFN_CAST_EX(bt_u64, PFNIEMAIMPLBINU64, 1), 2042 2039 ENTRY_BIN_EX(btc_u64, 1), … … 2054 2051 ENTRY_BIN(adcx_u64), 2055 2052 ENTRY_BIN(adox_u64), 2053 #endif 2056 2054 }; 2057 2055 TEST_BINARY_OPS(64, uint64_t, "%#018RX64", BINU64_TEST_T, g_aBinU64) … … 2229 2227 EFlagsDiff(fEfl, paTests[iTest].fEflOut)); \ 2230 2228 /* positive */ \ 2231 uint32_t fEflExpect = paTests[iTest].fEflIn; \2232 2229 uA = paTests[iTest].uDstIn; \ 2233 s_aFuncs[iFn].pfnSub(&uA, uA, &fEflExpect); \2230 uint32_t fEflExpect = s_aFuncs[iFn].pfnSub(paTests[iTest].fEflIn, &uA, uA); \ 2234 2231 fEfl = paTests[iTest].fEflIn; \ 2235 2232 uA = paTests[iTest].uDstIn; \ -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r104183 r104195 662 662 uint32_t *a_pName = &a_Name; \ 663 663 NOREF(a_pName) 664 #define IEM_MC_ARG_EFLAGS(a_Name, a_iArg) IEM_MC_ARG(uint32_t, a_Name, a_iArg); IEM_MC_FETCH_EFLAGS(a_Name) 664 665 665 666 #define IEM_MC_COMMIT_EFLAGS(a_EFlags) do { CHK_TYPE(uint32_t, a_EFlags); (void)fMcBegin; } while (0) … … 1002 1003 #define IEM_MC_CALL_VOID_AIMPL_4(a_pfn, a0, a1, a2, a3) \ 1003 1004 do { CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); CHK_CALL_ARG(a3, 3); (void)fMcBegin; } while (0) 1004 #define IEM_MC_CALL_AIMPL_3(a_rc, a_pfn, a0, a1, a2) \ 1005 #define IEM_MC_CALL_AIMPL_3(a_rcType, a_rc, a_pfn, a0, a1, a2) \ 1006 IEM_MC_LOCAL(a_rcType, a_rc); \ 1005 1007 do { CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); (a_rc) = VINF_SUCCESS; (void)fMcBegin; } while (0) 1006 #define IEM_MC_CALL_AIMPL_4(a_rc, a_pfn, a0, a1, a2, a3) \ 1008 #define IEM_MC_CALL_AIMPL_4(a_rcType, a_rc, a_pfn, a0, a1, a2, a3) \ 1009 IEM_MC_LOCAL(a_rcType, a_rc); \ 1007 1010 do { CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); CHK_CALL_ARG(a3, 3); (a_rc) = VINF_SUCCESS; (void)fMcBegin; } while (0) 1008 1011 #define IEM_MC_CALL_CIMPL_0(a_fFlags, a_fGstShwFlush, a_pfnCImpl) do { (void)fMcBegin; } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.