VirtualBox

Changeset 53474 in vbox


Ignore:
Timestamp:
Dec 6, 2014 4:17:43 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97204
Message:

SUPDrv.c: ASMMultU64ByU32DivByU32 could be replaced by 128-bit unsigned int math from iprt/uint128.h...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r53473 r53474  
    5555# include <iprt/path.h>
    5656#endif
     57/*#include <iprt/uint128.h> - probably needs exporting. */
    5758#include <iprt/x86.h>
    5859
     
    61716172    {
    61726173        /* Try not to lose precision, the larger the interval the more likely we overflow. */
     6174#if 0  /** @todo r=bird: What about falling back on iprt/uint128.h here instead of
     6175         * trading accuracy for values that works with ASMMultU64ByU32DivByU32? Speed
     6176         * is hardly an issue at this point. */
     6177        RTUINT128U CpuHz, Tmp, Divisor;
     6178        RTUInt128MulU64ByU64(&Tmp, u64DeltaTsc, RT_NS_1SEC);
     6179        RTUInt128Div(&CpuHz, &Tmp, RTUInt128AssignU64(&Divisor, u64DeltaNanoTS));
     6180        pGip->u64CpuHz = CpuHz.s.Lo;
     6181#else
    61736182        if (   u64DeltaTsc < UINT64_MAX / RT_NS_100MS
    61746183            && u64DeltaNanoTS / 10 < UINT32_MAX)
     
    61826191        else /* Screw it. */
    61836192            pGip->u64CpuHz = u64DeltaTsc / (u64DeltaNanoTS / RT_NS_1SEC_64);
     6193#endif
    61846194    }
    61856195
Note: See TracChangeset for help on using the changeset viewer.

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