Changeset 2093


Ignore:
Timestamp:
May 10, 2012, 11:51:53 AM (7 years ago)
Author:
ksherdy
Message:

Minor updates.

Location:
trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock_align.hpp

    r1950 r2093  
    1212#using namespace std;
    1313
    14 #define NDEBUG // if NDEBUG then disable assertions
    15 
    1614static IDISA_ALWAYS_INLINE assert_align(BitBlock v) {
    1715    assert(0 != (&v) & (sizeof(BitBlock)-1));
  • trunk/lib/byte_compare.hpp

    r2046 r2093  
    1010    Licensed to International Characters Inc.
    1111    under the Academic Free License version 3.0.
     12
     13    Created on:
     14    Author: Ken Herdy
    1215=============================================================================*/
    1316
     
    1922//   for L in [2,3], choose T = uint16_t
    2023//   for L in [4,7], choose T = uint32_t
    21 //   for L in [8,15], choose = uint64_t
    22 //   for L in [16,00), T = BitBlock
    23 //   Otherwise results are not valid due to pointer casts.
     24//   for L in [8,15], choose T = uint64_t
     25//   for L in [16,), choose T = BitBlock
    2426//
    25 //   TODO - STATIC ASSERT - sizeof(T) <= L
     27//   WARNING: sizeof(T) <= L in the due to pointer cast.
     28//              i.e !( (T*) p1 ^ (T*) p2) logic
    2629//
    2730///////////////////////////////////////////////////////////////////////////////
     
    3841IDISA_ALWAYS_INLINE bool mem_compare(const unsigned char * x, const unsigned char * y, uint32_t lgth);
    3942
     43// WARNING: sizeof(T) <= L
    4044template<uint32_t L, class T>
    4145IDISA_ALWAYS_INLINE bool overlap_compare(const uint8_t * x, const uint8_t * y) {
     
    5660}
    5761
     62// WARNING: sizeof(T) <= L
    5863template<class T>
    5964IDISA_ALWAYS_INLINE bool overlap_compare(const uint8_t * x, const uint8_t * y, uint32_t lgth) {
     
    7479}
    7580
     81// WARNING: sizeof(T) <= L
    7682template<class T>
    7783IDISA_ALWAYS_INLINE bool compare(const uint8_t * x, const uint8_t * y, const uint32_t offset) {
    7884    return !((*((T*)((uint8_t *)x + offset))) ^
    79              (*((T*)((uint8_t *)y + offset))));
     85             (*((T*)((uint8_t *)y + offset)))); // << offset
    8086}
    8187
     
    8389IDISA_ALWAYS_INLINE bool compare<BitBlock>(const uint8_t * x, const uint8_t * y, const uint32_t offset) {
    8490    BitBlock temp = simd_xor(bitblock::load_unaligned((BitBlock*) ((uint8_t *)x + offset)),
    85                              bitblock::load_unaligned((BitBlock*) ((uint8_t *)y + offset)));
     91                             bitblock::load_unaligned((BitBlock*) ((uint8_t *)y + offset))); // << shift offset
    8692    return bitblock::all(simd_not(temp));
    8793}
  • trunk/lib/debug.hpp

    r1950 r2093  
    1111using namespace std;
    1212
     13// #define NDEBUG // if NDEBUG then disable assertions
     14
    1315#ifdef NDEBUG
    1416#define MSG(str)
  • trunk/lib/hash.hpp

    r2039 r2093  
    99
    1010// #define HASH_HPP_DEBUG
     11
     12#define NDEBUG // if NDEBUG then disable assertions
    1113
    1214#include "../lib/bitblock.hpp"
Note: See TracChangeset for help on using the changeset viewer.