Changeset 154 in CLRX


Ignore:
Timestamp:
Aug 1, 2014, 10:09:39 PM (6 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Added optimization for int128 for bignum.

Location:
CLRadeonExtender/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/Config.h.in

    r124 r154  
    3434
    3535#cmakedefine HAVE_ELF_H
     36
     37#cmakedefine HAVE_INT128
    3638
    3739/* architecture setup */
  • CLRadeonExtender/trunk/CMakeLists.txt

    r124 r154  
    197197###
    198198
     199TRY_COMPILE(HAVE_INT128 ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/Int128Detect.c)
     200
    199201CHECK_INCLUDE_FILE_CXX(elf.h HAVE_ELF_H)
    200202
  • CLRadeonExtender/trunk/utils/NumStringConv.cpp

    r153 r154  
    185185 */
    186186
    187 static void mul64Full(uint64_t a, uint64_t b, uint64_t* c)
    188 {
     187static inline void mul64Full(uint64_t a, uint64_t b, uint64_t* c)
     188{
     189#ifdef HAVE_INT128
     190    unsigned __int128 v = ((unsigned __int128)a)*b;
     191    c[0] = v;
     192    c[1] = v>>64;
     193#else
    189194    const uint32_t a0 = a;
    190195    const uint32_t a1 = a>>32;
     
    200205    // (mx < m10) - carry from m01+m10
    201206    c[1] += (mx>>32) + (uint64_t(mx < m10)<<32);
     207#endif
    202208}
    203209
Note: See TracChangeset for help on using the changeset viewer.