Changeset 4982


Ignore:
Timestamp:
Mar 21, 2016, 3:20:26 PM (3 years ago)
Author:
cameron
Message:

Eliminate legacy include files; prepare util directory

Location:
icGREP/icgrep-devel/icgrep
Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.cpp

    r4877 r4982  
    2323#include <llvm/Support/raw_ostream.h>
    2424#include <llvm/Support/Format.h>
    25 #include <include/simd-lib/builtins.hpp>
    2625#include <array>
    2726
     
    3231using interval_t = UnicodeSet::interval_t;
    3332using codepoint_t = UnicodeSet::codepoint_t;
     33
     34//
     35// Select the correct built-in scan function, dependent on whatever
     36// bitquad_t resolves to, when scan_forwrad_zeroes<bitquad_t> is called.
     37template <typename T> int scan_forward_zeroes(T x);
     38template <> inline int scan_forward_zeroes<unsigned int>(unsigned int x){return __builtin_ctz(x);}
     39template <> inline int scan_forward_zeroes<unsigned long>(unsigned long x){return __builtin_ctzl(x);}
     40template <> inline int scan_forward_zeroes<unsigned long long>(unsigned long long x){return __builtin_ctzll(x);}
     41
     42
    3443
    3544UnicodeSet::Allocator UnicodeSet::mAllocator;
     
    666675                // Find it and break out of the loop.
    667676                if (m) {
    668                     mQuadOffset = scan_forward_zeroes(m);
     677                    mQuadOffset = scan_forward_zeroes<bitquad_t>(m);
    669678                    mMinCodePoint = mBaseCodePoint + mQuadOffset;
    670679                    found = true;
     
    713722                // Find it and break out of the loop.
    714723                if (m) {
    715                     mQuadOffset = scan_forward_zeroes(m);
     724                    mQuadOffset = scan_forward_zeroes<bitquad_t>(m);
    716725                    mMaxCodePoint = mBaseCodePoint + mQuadOffset - 1;
    717726                    found = true;
Note: See TracChangeset for help on using the changeset viewer.