VirtualBox

Changeset 62408 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jul 21, 2016 8:23:33 PM (8 years ago)
Author:
vboxsync
Message:

iemAImpl_imul_u64: Adjusted flag behavior to match that of Intel Skylake 6700K.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r62404 r62408  
    11481148IEM_DECL_IMPL_DEF(int, iemAImpl_imul_u64,(uint64_t *pu64RAX, uint64_t *pu64RDX, uint64_t u64Factor, uint32_t *pfEFlags))
    11491149{
    1150 /** @todo Testcase: IMUL 1 operand   */
    11511150    RTUINT128U Result;
    1152     *pfEFlags &= ~(X86_EFL_SF | X86_EFL_CF | X86_EFL_OF);
     1151    *pfEFlags &= ~( X86_EFL_SF | X86_EFL_CF | X86_EFL_OF
     1152                   /* Skylake always clears: */ | X86_EFL_AF | X86_EFL_ZF
     1153                   /* Skylake may set: */       | X86_EFL_PF);
     1154
    11531155    if ((int64_t)*pu64RAX >= 0)
    11541156    {
     
    11841186    }
    11851187    *pu64RAX = Result.s.Lo;
     1188    if (Result.s.Lo & RT_BIT_64(63))
     1189        *pfEFlags |= X86_EFL_SF;
     1190    *pfEFlags |= g_afParity[Result.s.Lo & 0xff]; /* (Skylake behaviour) */
    11861191    *pu64RDX = Result.s.Hi;
    1187     if (*pu64RAX & RT_BIT_64(63))
    1188         *pfEFlags |= X86_EFL_SF;
    1189 
    1190     /** @todo research the undefined IMUL flags. */
     1192
    11911193    return 0;
    11921194}
     
    12381240IEM_DECL_IMPL_DEF(int, iemAImpl_idiv_u64,(uint64_t *pu64RAX, uint64_t *pu64RDX, uint64_t u64Divisor, uint32_t *pfEFlags))
    12391241{
     1242    /* Note! Skylake leaves all flags alone. */
    12401243    if (u64Divisor != 0)
    12411244    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette