Changeset 933 for trunk/lib


Ignore:
Timestamp:
Mar 10, 2011, 10:15:12 PM (8 years ago)
Author:
cameron
Message:

scanto routines, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/carryQ.h

    r932 r933  
    5353static inline BitBlock BitBlock_scanto_ci_co(BitBlock markers0, BitBlock charclass, CarryQtype & cq, const int carryno) __attribute__ ((always_inline));
    5454
    55 static inline BitBlock BitBlock_scanto_ci(BitBlock markers0, BitBlock charclass, CarryQtype & cq, const int carryno) __attribute__ ((always_inline));
     55static inline BitBlock BitBlock_scanto_ci(BitBlock markers0, BitBlock charclass, CarryQtype & cq, BitBlock EOF_mask, const int carryno) __attribute__ ((always_inline));
    5656
    5757static inline BitBlock BitBlock_scanto_co(BitBlock markers0, BitBlock charclass, CarryQtype & cq, const int carryno) __attribute__ ((always_inline));
    5858
    59 static inline BitBlock BitBlock_scanto(BitBlock markers0, BitBlock charclass) __attribute__ ((always_inline));
     59static inline BitBlock BitBlock_scanto(BitBlock markers0, BitBlock charclass, BitBlock EOF_mask) __attribute__ ((always_inline));
    6060
    6161static inline bool CarryTest(CarryQtype & cq, const int carryno, const int carry_count) __attribute__ ((always_inline));
     
    116116static inline BitBlock BitBlock_scanto_ci_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) __attribute__ ((always_inline));
    117117
    118 static inline BitBlock BitBlock_scanto_ci(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) __attribute__ ((always_inline));
     118static inline BitBlock BitBlock_scanto_ci(BitBlock markers0, BitBlock charclass, CarryQtype cq, BitBlock EOF_mask, const int carryno) __attribute__ ((always_inline));
    119119
    120120static inline BitBlock BitBlock_scanto_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) __attribute__ ((always_inline));
    121121
    122 static inline BitBlock BitBlock_scanto(BitBlock markers0, BitBlock charclass) __attribute__ ((always_inline));
     122static inline BitBlock BitBlock_scanto(BitBlock markers0, BitBlock charclass, BitBlock EOF_mask) __attribute__ ((always_inline));
    123123
    124124static inline bool CarryTest(CarryQtype cq, const int carryno, const int carry_count) __attribute__ ((always_inline));
     
    132132
    133133static inline BitBlock BitBlock_advance_ci_co(BitBlock strm, CarryQtype cq, const int carryno) {
    134  BitBlock rslt;
    135  advance_with_carry(strm, cq[carryno], rslt);
    136  return rslt;
     134        BitBlock rslt;
     135        advance_with_carry(strm, cq[carryno], rslt);
     136        return rslt;
    137137}
    138138
    139139static inline BitBlock BitBlock_advance_co(BitBlock strm, CarryQtype cq, const int carryno) {
    140  BitBlock rslt;
    141  cq[carryno] = Carry0;
    142  advance_with_carry(strm, cq[carryno], rslt);
    143  return rslt;
     140        BitBlock rslt;
     141        cq[carryno] = Carry0;
     142        advance_with_carry(strm, cq[carryno], rslt);
     143        return rslt;
     144}
     145
     146static inline BitBlock BitBlock_advance_ci(BitBlock strm, CarryQtype cq, const int carryno) {
     147        BitBlock rslt;
     148        advance_with_carry(strm, cq[carryno], rslt);
     149        return rslt;
     150}
     151
     152static inline BitBlock BitBlock_advance(BitBlock strm) {
     153        return sisd_slli(strm, 1);
    144154}
    145155
    146156static inline BitBlock BitBlock_add_ci_co(BitBlock strm1, BitBlock strm2, CarryQtype cq, const int carryno) {
    147  BitBlock sum;
    148  adc128(strm1, strm2, cq[carryno], sum);
    149  return sum;
     157        BitBlock sum;
     158        adc128(strm1, strm2, cq[carryno], sum);
     159        return sum;
    150160}
    151161
    152162static inline BitBlock BitBlock_add_co(BitBlock strm1, BitBlock strm2, CarryQtype cq, const int carryno) {
    153  BitBlock sum;
    154  cq[carryno] = Carry0;
    155  adc128(strm1, strm2, cq[carryno], sum);
    156  return sum;
     163        BitBlock sum;
     164        cq[carryno] = Carry0;
     165        adc128(strm1, strm2, cq[carryno], sum);
     166        return sum;
    157167}
    158168
    159169static inline BitBlock BitBlock_sub_ci_co(BitBlock strm1, BitBlock strm2, CarryQtype cq, const int carryno) {
    160  BitBlock diff;
    161  sbb128(strm1, strm2, cq[carryno], diff);
    162  return diff;
     170        BitBlock diff;
     171        sbb128(strm1, strm2, cq[carryno], diff);
     172        return diff;
    163173}
    164174
    165175static inline BitBlock BitBlock_sub_co(BitBlock strm1, BitBlock strm2, CarryQtype cq, const int carryno) {
    166  BitBlock diff;
    167  cq[carryno] = Carry0;
    168  sbb128(strm1, strm2, cq[carryno], diff);
    169  return diff;
     176        BitBlock diff;
     177        cq[carryno] = Carry0;
     178        sbb128(strm1, strm2, cq[carryno], diff);
     179        return diff;
    170180}
    171181
    172182static inline BitBlock BitBlock_scanthru_ci_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) {
    173  BitBlock markers1;
    174  adc128(markers0, charclass, cq[carryno], markers1);
    175  return simd_andc(markers1, charclass);
     183        BitBlock markers1;
     184        adc128(markers0, charclass, cq[carryno], markers1);
     185        return simd_andc(markers1, charclass);
    176186}
    177187
    178188static inline BitBlock BitBlock_scanthru_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) {
    179  BitBlock markers1;
    180  cq[carryno] = Carry0;
    181  adc128(markers0, charclass, cq[carryno], markers1);
    182  return simd_andc(markers1, charclass);
     189        BitBlock markers1;
     190        cq[carryno] = Carry0;
     191        adc128(markers0, charclass, cq[carryno], markers1);
     192        return simd_andc(markers1, charclass);
     193}
     194
     195static inline BitBlock BitBlock_scanthru_ci(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) {
     196        BitBlock markers1;
     197        adc128(markers0, charclass, cq[carryno], markers1);
     198        return simd_andc(markers1, charclass);
     199}
     200
     201static inline BitBlock BitBlock_scanthru(BitBlock markers0, BitBlock charclass) {
     202        CarryType c = Carry0;
     203        adc128(markers0, charclass, c, markers1);
     204        return simd_andc(markers1, charclass);
     205}
     206
     207static inline BitBlock BitBlock_scanto_ci_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) {
     208        BitBlock markers1;
     209        adc128(markers0, simd_not(charclass), cq[carryno], markers1);
     210        return simd_and(markers1, charclass);
     211}
     212
     213static inline BitBlock BitBlock_scanto_co(BitBlock markers0, BitBlock charclass, CarryQtype cq, const int carryno) {
     214        BitBlock markers1;
     215        cq[carryno] = Carry0;
     216        adc128(markers0, simd_not(charclass), cq[carryno], markers1);
     217        return simd_and(markers1, charclass);
     218}
     219
     220static inline BitBlock BitBlock_scanto_ci(BitBlock markers0, BitBlock charclass, BitBlock EOF_mask, CarryQtype cq, const int carryno) {
     221        BitBlock markers1;
     222        CarryType c = cq[carryno];
     223        adc128(markers0, simd_andc(EOF_mask, charclass), c, markers1);
     224        return simd_and(markers1, charclass);
     225}
     226
     227static inline BitBlock BitBlock_scanto(BitBlock markers0, BitBlock charclass, BitBlock EOF_mask) {
     228        BitBlock markers1;
     229        CarryType c = Carry0;
     230        adc128(markers0, simd_andc(EOF_mask, charclass), c, markers1);
     231        return simd_and(markers1, charclass);
    183232}
    184233
     
    249298
    250299static inline BitBlock BitBlock_advance(BitBlock cursor) {
    251   return sisd_srli(cursor, 1);
     300  return sisd_slli(cursor, 1);
    252301}
    253302
Note: See TracChangeset for help on using the changeset viewer.