Ignore:
Timestamp:
Sep 9, 2013, 6:00:28 PM (6 years ago)
Author:
cameron
Message:

Use carry_t to abstract for carry variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pabloSupport.hpp

    r3334 r3457  
    3333}
    3434
    35 IDISA_ALWAYS_INLINE BitBlock pablo_blk_Advance(BitBlock strm, BitBlock carryin, BitBlock & rslt) {
    36         BitBlock carryout;
     35IDISA_ALWAYS_INLINE carry_t pablo_blk_Advance(BitBlock strm, carry_t carryin, BitBlock & rslt) {
     36        carry_t carryout;
    3737        adv_ci_co(strm, carryin, carryout, rslt);
    3838        return carryout;
    3939}
    4040
    41 template <int n> IDISA_ALWAYS_INLINE BitBlock pablo_blk_Advance_n_(BitBlock strm, BitBlock pending_in, BitBlock & rslt) {
     41template <int n> IDISA_ALWAYS_INLINE carry_t pablo_blk_Advance_n_(BitBlock strm, BitBlock pending_in, BitBlock & rslt) {
    4242        BitBlock half_block_shifted = esimd<BLOCK_SIZE/2>::mergel(strm, pending_in);
    4343        rslt = simd_or(simd<BLOCK_SIZE/2>::srli<(BLOCK_SIZE/2)-n>(half_block_shifted),
     
    4646}
    4747
    48 template <int fw, int n> IDISA_ALWAYS_INLINE BitBlock pablo_blk_Advance_n_(BitBlock strm, BitBlock pending_in, BitBlock & rslt) {
     48template <int fw, int n> IDISA_ALWAYS_INLINE carry_t pablo_blk_Advance_n_(BitBlock strm, BitBlock pending_in, BitBlock & rslt) {
    4949        BitBlock shifted = mvmd<fw>::dslli<1>(strm, pending_in);
    5050        rslt = simd_or(simd<BLOCK_SIZE/2>::srli<fw-n>(shifted),
     
    5757    (b) pablo.Lookahead(ss.strm, n) ==> pablo_blk_Lookahead_n_<n>(ss[0].strm, ss[1].strm);
    5858*/
    59 template <int n> IDISA_ALWAYS_INLINE BitBlock pablo_blk_Lookahead_n_(BitBlock strm, BitBlock lookahead) {
     59template <int n> IDISA_ALWAYS_INLINE carry_t pablo_blk_Lookahead_n_(BitBlock strm, BitBlock lookahead) {
    6060        BitBlock half_block_shifted = mvmd<BLOCK_SIZE/2>::dslli<1>(lookahead, strm);
    6161        return simd_or(simd<BLOCK_SIZE/2>::slli<(BLOCK_SIZE/2)-n>(half_block_shifted),
     
    6363}
    6464
    65 IDISA_ALWAYS_INLINE BitBlock pablo_blk_ScanThru(BitBlock marker, BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    66         BitBlock carryout, sum;
     65IDISA_ALWAYS_INLINE carry_t pablo_blk_ScanThru(BitBlock marker, BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     66        carry_t carryout;  BitBlock sum;
    6767        add_ci_co(marker, charclass, carryin, carryout, sum);
    6868        rslt = simd_andc(sum, charclass);
     
    7070}
    7171
    72 IDISA_ALWAYS_INLINE BitBlock pablo_blk_MatchStar(BitBlock marker, BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    73         BitBlock carryout, sum;
     72IDISA_ALWAYS_INLINE carry_t pablo_blk_MatchStar(BitBlock marker, BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     73        carry_t carryout;  BitBlock sum;
    7474        add_ci_co(simd_and(charclass, marker), charclass, carryin, carryout, sum);
    7575        rslt = simd_or(simd_xor(sum, charclass), marker);
     
    7777}
    7878
    79 IDISA_ALWAYS_INLINE BitBlock pablo_blk_AdvanceThenScanThru(BitBlock marker, BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    80         BitBlock carryout, sum;
     79IDISA_ALWAYS_INLINE carry_t pablo_blk_AdvanceThenScanThru(BitBlock marker, BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     80        carry_t carryout;  BitBlock sum;
    8181        add_ci_co(marker, simd_or(charclass, marker), carryin, carryout, sum);
    8282        rslt = simd_andc(sum, charclass);
     
    8484}
    8585
    86 IDISA_ALWAYS_INLINE BitBlock pablo_blk_ScanTo(BitBlock marker, BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    87         BitBlock carryout, sum;
     86IDISA_ALWAYS_INLINE carry_t pablo_blk_ScanTo(BitBlock marker, BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     87        carry_t carryout;  BitBlock sum;
    8888        add_ci_co(marker, simd_not(charclass), carryin, carryout, sum);
    8989        rslt = simd_and(sum, charclass);
     
    9191}
    9292
    93 IDISA_ALWAYS_INLINE BitBlock pablo_blk_AdvanceThenScanTo(BitBlock marker, BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    94         BitBlock carryout, sum;
     93IDISA_ALWAYS_INLINE carry_t pablo_blk_AdvanceThenScanTo(BitBlock marker, BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     94        carry_t carryout;  BitBlock sum;
    9595        add_ci_co(marker, simd_or(marker, simd_not(charclass)), carryin, carryout, sum);
    9696        rslt = simd_and(sum, charclass);
     
    9898}
    9999
    100 IDISA_ALWAYS_INLINE BitBlock pablo_blk_ScanToFirst(BitBlock charclass, BitBlock carryin, BitBlock & rslt) {
    101         BitBlock carryout, sum;
     100IDISA_ALWAYS_INLINE carry_t pablo_blk_ScanToFirst(BitBlock charclass, carry_t carryin, BitBlock & rslt) {
     101        carry_t carryout;  BitBlock sum;
    102102        add_ci_co(simd<BLOCK_SIZE>::constant<0>(), simd_not(charclass), carryin, carryout, sum);
    103103        rslt = simd_and(sum, charclass);
     
    105105}
    106106
    107 IDISA_ALWAYS_INLINE BitBlock pablo_blk_SpanUpTo(BitBlock starts, BitBlock follows, BitBlock carryin, BitBlock & rslt) {
    108         BitBlock carryout;
     107IDISA_ALWAYS_INLINE carry_t pablo_blk_SpanUpTo(BitBlock starts, BitBlock follows, carry_t carryin, BitBlock & rslt) {
     108        carry_t carryout;
    109109        sub_bi_bo(follows, starts, carryin, carryout, rslt);
    110110        return carryout;
    111111}
    112112
    113 IDISA_ALWAYS_INLINE BitBlock pablo_blk_InclusiveSpan(BitBlock starts, BitBlock follows, BitBlock carryin, BitBlock & rslt) {
    114         BitBlock carryout, span;
     113IDISA_ALWAYS_INLINE carry_t pablo_blk_InclusiveSpan(BitBlock starts, BitBlock follows, carry_t carryin, BitBlock & rslt) {
     114        carry_t carryout;  BitBlock span;
    115115        sub_bi_bo(follows, starts, carryin, carryout, span);
    116116        rslt = simd_or(span, follows);
     
    118118}
    119119
    120 IDISA_ALWAYS_INLINE BitBlock pablo_blk_ExclusiveSpan(BitBlock starts, BitBlock follows, BitBlock carryin, BitBlock & rslt) {
    121         BitBlock carryout, span;
     120IDISA_ALWAYS_INLINE carry_t pablo_blk_ExclusiveSpan(BitBlock starts, BitBlock follows, carry_t carryin, BitBlock & rslt) {
     121        carry_t carryout;  BitBlock span;
    122122        sub_bi_bo(follows, starts, carryin, carryout, span);
    123123        rslt = simd_andc(span, starts);
     
    125125}
    126126
    127 template <typename T> IDISA_ALWAYS_INLINE BitBlock pablo_blk_match(T bytedata[], const T match_str[], BitBlock v, int len) {
     127template <typename T> IDISA_ALWAYS_INLINE carry_t pablo_blk_match(T bytedata[], const T match_str[], BitBlock v, int len) {
    128128        union {BitBlock bitblock; ScanWord elems[sizeof(BitBlock)/sizeof(ScanWord)];} u;
    129129        u.bitblock = v;
Note: See TracChangeset for help on using the changeset viewer.