Changeset 1898


Ignore:
Timestamp:
Jan 28, 2012, 11:58:54 AM (7 years ago)
Author:
ksherdy
Message:

Added ASSERTION to test for alignment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock.hpp

    r1890 r1898  
    1212#include <stdint.h>
    1313#include <stdio.h>
     14#include <cassert>
     15//#define NDEBUG // if NDEBUG then disable assertions
     16
    1417#include "config.hpp"
    1518#include "builtins.hpp"
     
    2124#endif
    2225#define ATTRIBUTE_SIMD_ALIGN __attribute__((aligned(sizeof(BitBlock))))
     26#define ASSERT_BITBLOCK_ALIGN(v) assert(0 == (((uint64_t)(&v)) & (sizeof(BitBlock)-1)) )
    2327
    2428template<class T> void print_register(const char * var_name, T v);
     
    2731static IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(BitBlock v);
    2832static IDISA_ALWAYS_INLINE uint32_t bitstream_scan(BitBlock * v, uint32_t pos);
    29 
     33static IDISA_ALWAYS_INLINE BitBlock assert_align(BitBlock v);
    3034
    3135/*  BitBlock union type */
Note: See TracChangeset for help on using the changeset viewer.