Changeset 2042 for trunk/lib/carryQ.hpp


Ignore:
Timestamp:
Apr 22, 2012, 11:12:08 AM (7 years ago)
Author:
cameron
Message:

Support for AdvanceThenScan?{To,Thru}, SpanUpTo?, and {In,Ex}clusive_Span

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/carryQ.hpp

    r2006 r2042  
    4545        IDISA_ALWAYS_INLINE BitBlock BitBlock_scanthru_ci_co(BitBlock markers0, BitBlock charclass, BitBlock carryin, uint16_t carryno);
    4646        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t pending_in, uint32_t & pending_out);
     47
     48        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance_then_scanthru(BitBlock markers0, BitBlock charclass, BitBlock carryin, uint16_t carryno);
     49        IDISA_ALWAYS_INLINE BitBlock BitBlock_span_upto(BitBlock starts, BitBlock follows, BitBlock carryin, uint16_t carryno);
     50        IDISA_ALWAYS_INLINE BitBlock BitBlock_inclusive_span(BitBlock starts, BitBlock ends, BitBlock carryin, uint16_t carryno);
     51        IDISA_ALWAYS_INLINE BitBlock BitBlock_exclusive_span(BitBlock starts, BitBlock ends, BitBlock carryin, uint16_t carryno);
    4752
    4853        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count);
     
    115120        }
    116121
     122        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance_then_scanthru(BitBlock markers0, BitBlock charclass, BitBlock carryin, uint16_t carryno)
     123        {
     124                BitBlock markers1;
     125                assert(!bitblock::any(simd_and(markers0, charclass)));
     126                adc(markers0, simd_or(charclass, markers0), carryin, cq[carryno], markers1);
     127                return simd_andc(markers1, charclass);
     128        }
     129
     130        IDISA_ALWAYS_INLINE BitBlock BitBlock_span_upto(BitBlock starts, BitBlock follows, BitBlock carryin, uint16_t carryno)
     131        {
     132                BitBlock span;
     133                sbb(follows, starts, carryin, cq[carryno], span);
     134                return span;
     135        }
     136
     137        IDISA_ALWAYS_INLINE BitBlock BitBlock_inclusive_span(BitBlock starts, BitBlock ends, BitBlock carryin, uint16_t carryno)
     138        {
     139                BitBlock span;
     140                sbb(ends, starts, carryin, cq[carryno], span);
     141                return simd_or(span, ends);
     142        }
     143
     144        IDISA_ALWAYS_INLINE BitBlock BitBlock_exclusive_span(BitBlock starts, BitBlock ends, BitBlock carryin, uint16_t carryno)
     145        {
     146                BitBlock span;
     147                sbb(ends, starts, carryin, cq[carryno], span);
     148                return simd_andc(span, starts);
     149        }
     150
     151
    117152        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t pending_in, uint32_t & pending_out)
    118153        {
Note: See TracChangeset for help on using the changeset viewer.