VirtualBox

Changeset 52290 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Aug 6, 2014 10:14:47 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95402
Message:

RTBigNum: Two assembly optimizations related to RTBigNumModExp. Use 64-bit element type on 64-bit hosts (instead of 32-bit everywhere). Fixed some bugs in the bit operations, which apparently didn't affect x86 or AMD64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/bignum.h

    r51770 r52290  
    3838
    3939/** The big integer number element type. */
     40#if ARCH_BITS == 64
     41typedef uint64_t RTBIGNUMELEMENT;
     42#else
    4043typedef uint32_t RTBIGNUMELEMENT;
     44#endif
    4145/** The size (in bytes) of one array element. */
    42 #define RTBIGNUM_ELEMENT_SIZE           4
     46#if ARCH_BITS == 64
     47# define RTBIGNUM_ELEMENT_SIZE          8
     48#else
     49# define RTBIGNUM_ELEMENT_SIZE          4
     50#endif
    4351/** The number of bits in one array element. */
    4452#define RTBIGNUM_ELEMENT_BITS           (RTBIGNUM_ELEMENT_SIZE * 8)
    4553/** Returns the bitmask corrsponding to given bit number. */
    46 #define RTBIGNUM_ELEMENT_BIT(iBit)      RT_BIT_32(iBit)
     54#if ARCH_BITS == 64
     55# define RTBIGNUM_ELEMENT_BIT(iBit)     RT_BIT_64(iBit)
     56#else
     57# define RTBIGNUM_ELEMENT_BIT(iBit)     RT_BIT_32(iBit)
     58#endif
    4759
    4860/**
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