VirtualBox

Changeset 2306 in vbox for trunk


Ignore:
Timestamp:
Apr 21, 2007 8:50:41 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20673
Message:

r=frank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstInlineAsm.cpp

    r2303 r2306  
    825825    CHECKVAL(u64, UINT64_C(0x924719355cd35a27), "%#018RX64");
    826826
    827 #if 0 /* question is whether this should trap or not */
    828       /*
    829        * r=frank: Of course it must trap:
     827#if 0 /* bird: question is whether this should trap or not:
     828       *
     829       * frank: Of course it must trap:
    830830       *
    831831       *   0xfffffff8 * 0x77d7daf8 = 0x77d7daf441412840
     
    837837       *
    838838       * which is definitely greater than  0x3b9aca00.
    839        */
    840       /*
     839       *
    841840       * bird: No, the C version does *not* crash. So, the question is whether there any
    842841       * code depending on it not crashing.
     
    844843       * Of course the assembly versions of the code crash right now for the reasons you've
    845844       * given, but the the 32-bit MSC version does not crash.
     845       *
     846       * frank: The C version does not crash but delivers incorrect results for this case.
     847       * The reason is
     848       *
     849       *   u.s.Hi = (unsigned long)(u64Hi / u32C);
     850       *
     851       * Here the division is actually 64-bit by 64-bit but the 64-bit result is truncated
     852       * to 32 bit. If using this (optimized and fast) function we should just be sure that
     853       * the operands are in a valid range.
    846854       */
    847855    u64 = ASMMultU64ByU32DivByU32(UINT64_C(0xfffffff8c65d6731), UINT32_C(0x77d7daf8), UINT32_C(0x3b9aca00));
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