Changeset 1933 for trunk


Ignore:
Timestamp:
Feb 15, 2012, 10:13:59 AM (7 years ago)
Author:
nmedfort
Message:
 
Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock.hpp

    r1932 r1933  
    2525#endif
    2626#define ATTRIBUTE_SIMD_ALIGN __attribute__((aligned(sizeof(BitBlock))))
    27 #define ASSERT_BITBLOCK_ALIGN(v) assert(0 == (((uint64_t)(&v)) & (sizeof(BitBlock)-1)) )
     27#ifndef ATTRIBUTE_SIMD_ALIGN
     28    #if defined _MSC_VER
     29        //note: MSVC++ cannot accept sizeof or division within __declspec(align(...))
     30        #define ATTRIBUTE_SIMD_ALIGN __declspec(align(16))
     31    #elif defined __GNUC__
     32        #define ATTRIBUTE_SIMD_ALIGN __attribute__((aligned(sizeof(BitBlock))))
     33    #else
     34        #define ATTRIBUTE_SIMD_ALIGN
     35    #endif
     36#endif
    2837
    2938template<class T> void print_register(const char * var_name, T v);
  • trunk/lib/carryQ.hpp

    r1826 r1933  
    6464// Array of BitBlock implementation.
    6565template <uint16_t CarryCount>
    66 class CarryArray: public ICarryQueue {
     66class CarryArray: public ICarryQueue{
    6767
    6868public:
     69
     70    #define Carry0 simd<BLOCK_SIZE>::constant<0>()
     71    #define Carry1 simd<BLOCK_SIZE>::constant<1>()
     72 
    6973        CarryArray()
    7074        {
    71                 Carry0 = simd<BLOCK_SIZE>::constant<0>();
    72                 Carry1 = simd<BLOCK_SIZE>::constant<1>();
    73 
    74                 memset (cq, 0, sizeof(BitBlock) * CarryCount);// size_t num )
     75            memset (cq, 0, sizeof(BitBlock) * CarryCount);// size_t num )
    7576        }
    7677        ~CarryArray() {}
     
    203204private:
    204205        BitBlock cq[CarryCount];
    205         BitBlock Carry0;
    206         BitBlock Carry1;
    207206
    208207        // helpers
     
    221220                return simd_or(carry1, carry2);
    222221        }
     222       
     223#undef Carry0
     224#undef Carry1
    223225
    224226};
Note: See TracChangeset for help on using the changeset viewer.