Ignore:
Timestamp:
Dec 12, 2012, 6:10:33 PM (6 years ago)
Author:
cameron
Message:

Various fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/icxmlc/XMLUTF8CharacterSetAdapter.hpp

    r2728 r2774  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLUTF8CharacterSetAdapter.hpp 217 2012-12-03 15:00:50Z robc $
     9 * @version $Id: XMLUTF8CharacterSetAdapter.hpp 224 2012-12-12 03:31:56Z nigelm $
    1010 *
    1111 */
     
    172172
    173173  struct Callouts {
    174   BitBlock CtCDPI_marks;
     174  BitBlock PI_openers;
     175  BitBlock CtCD_openers;
    175176  BitBlock CtCDPI_closers;
    176177  BitBlock CtCDPI_content_starts;
     
    610611 }
    611612  IDISA_ALWAYS_INLINE void do_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors) {
    612                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    613                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    614                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    615                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     613                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     614                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     615                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     616                BitBlock PI_error, Ct_error;
    616617
    617618                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    620621        callouts.Symbol_starts = simd<1>::constant<0>();
    621622        callouts.Symbol_ends = simd<1>::constant<0>();
    622         callouts.CtCDPI_marks = simd<1>::constant<0>();
    623623        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    624624        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    637637        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    638638        LAngle_scope = simd_andc(v1, w1);
    639         PI_opener = simd_and(LAngle_scope, lex.QMark);
    640         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    641         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     639        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     640        callouts.CtCD_openers = simd<1>::constant<0>();
     641        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    642642        CD_closer = simd<1>::constant<0>();
    643643        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    655655        if ((bitblock::any(CtCDPI_Cursor) || carryQ.CarryTest(5, 14))) {
    656656          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    657           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     657          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    658658          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    659           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     659          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    660660          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    661661          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    663663          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    664664          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    665             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    666665            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    667666            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    671670            PI_error = simd_andc(tempvar2, PI_closer);
    672671            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    673             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     672            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     673            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    674674            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    675675            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    719719            LocalCarryDeclare(subcarryQ, 14);
    720720            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    721             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     721            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    722722            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    723             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     723            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    724724            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    725725            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    727727            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    728728            if (bitblock::any(PI_Cursor)) {
    729               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    730729              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    731730              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    735734              PI_error = simd_andc(tempvar2, PI_closer);
    736735              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    737               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     736              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     737              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    738738              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    739739              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    794794  }
    795795  IDISA_ALWAYS_INLINE void do_final_block(Lex & lex, Marker & marker, Callouts & callouts, Errors & errors, BitBlock EOF_mask) {
    796                 BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, PI_opener, CtCD_opener;
    797                 BitBlock CtCDPI_opener, CD_closer, DoubleHyphen, DoubleRBracket, PI_closer;
    798                 BitBlock CtCDPI_Cursor, PI_Cursor, CD_Ct_Cursor, CD_Cursor, Ct_Cursor;
    799                 BitBlock CD_Ct_Error, PI_name_end, PI_error, Ct_error;
     796                BitBlock CtCDPI_starts, v, w, v1, w1, LAngle_scope, CtCDPI_opener, CD_closer;
     797                BitBlock DoubleHyphen, DoubleRBracket, PI_closer, CtCDPI_Cursor, PI_Cursor;
     798                BitBlock CD_Ct_Cursor, CD_Cursor, Ct_Cursor, CD_Ct_Error, PI_name_end;
     799                BitBlock PI_error, Ct_error;
    800800
    801801                BitBlock tempvar0, tempvar1, tempvar2, tempvar3, tempvar4, tempvar5;
     
    804804        callouts.Symbol_starts = simd<1>::constant<0>();
    805805        callouts.Symbol_ends = simd<1>::constant<0>();
    806         callouts.CtCDPI_marks = simd<1>::constant<0>();
    807806        callouts.CtCDPI_content_starts = simd<1>::constant<0>();
    808807        callouts.CtCDPI_closers = simd<1>::constant<0>();
     
    821820        w1 = carryQ.BitBlock_advance_ci_co(w, carryQ.get_carry_in(1), 1);
    822821        LAngle_scope = simd_andc(v1, w1);
    823         PI_opener = simd_and(LAngle_scope, lex.QMark);
    824         CtCD_opener = simd_and(LAngle_scope, lex.Exclam);
    825         CtCDPI_opener = simd_or(PI_opener, CtCD_opener);
     822        callouts.PI_openers = simd_and(LAngle_scope, lex.QMark);
     823        callouts.CtCD_openers = simd<1>::constant<0>();
     824        CtCDPI_opener = simd_or(simd_and(LAngle_scope, lex.Exclam), callouts.PI_openers);
    826825        CD_closer = simd<1>::constant<0>();
    827826        DoubleHyphen = simd_and(simd_and(v1, w1), lex.Hyphen);
     
    839838        if ((bitblock::any(simd_and(CtCDPI_Cursor, EOF_mask)) || carryQ.CarryTest(5, 14))) {
    840839          CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    841           PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     840          PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    842841          CD_Ct_Cursor = carryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), carryQ.get_carry_in(5), 5);
    843           callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     842          callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    844843          CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    845844          Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    847846          errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    848847          if ((bitblock::any(PI_Cursor) || carryQ.CarryTest(6, 5))) {
    849             callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    850848            PI_Cursor = carryQ.BitBlock_advance_ci_co(PI_Cursor, carryQ.get_carry_in(6), 6);
    851849            PI_name_end = carryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, carryQ.get_carry_in(7), 7);
     
    855853            PI_error = simd_andc(tempvar2, PI_closer);
    856854            errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    857             callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     855            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     856            callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    858857            tempvar3 = carryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, carryQ.get_carry_in(9), 9);
    859858            callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    903902            LocalCarryDeclare(subcarryQ, 14);
    904903            CtCDPI_starts = simd_or(CtCDPI_starts, CtCDPI_Cursor);
    905             PI_Cursor = simd_and(CtCDPI_Cursor, PI_opener);
     904            PI_Cursor = simd_and(CtCDPI_Cursor, callouts.PI_openers);
    906905            CD_Ct_Cursor = subcarryQ.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor, PI_Cursor), simd<1>::constant<0>(), 0);
    907             callouts.CtCDPI_marks = simd_or(callouts.CtCDPI_marks, simd_or(PI_Cursor, CD_Ct_Cursor));
     906            callouts.CtCD_openers = simd_or(callouts.CtCD_openers, CD_Ct_Cursor);
    908907            CD_Cursor = simd_and(CD_Ct_Cursor, lex.LBracket);
    909908            Ct_Cursor = simd_and(CD_Ct_Cursor, lex.Hyphen);
     
    911910            errors.ExpectedCommentOrCDATA = simd_or(errors.ExpectedCommentOrCDATA, CD_Ct_Error);
    912911            if (bitblock::any(PI_Cursor)) {
    913               callouts.Symbol_starts = simd_or(callouts.Symbol_starts, PI_Cursor);
    914912              PI_Cursor = subcarryQ.BitBlock_advance_ci_co(PI_Cursor, simd<1>::constant<0>(), 1);
    915913              PI_name_end = subcarryQ.BitBlock_scanthru_ci_co(PI_Cursor, lex.NameScan, simd<1>::constant<0>(), 2);
     
    919917              PI_error = simd_andc(tempvar2, PI_closer);
    920918              errors.UnterminatedPI = simd_or(errors.UnterminatedPI, PI_error);
    921               callouts.Symbol_ends = simd_or(callouts.Symbol_ends, PI_name_end);
     919              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, PI_Cursor);
     920              callouts.CtCDPI_closers = simd_or(callouts.CtCDPI_closers, PI_name_end);
    922921              tempvar3 = subcarryQ.BitBlock_scanthru_ci_co(PI_name_end, lex.WS, simd<1>::constant<0>(), 4);
    923922              callouts.CtCDPI_content_starts = simd_or(callouts.CtCDPI_content_starts, tempvar3);
     
    10151014 }
    10161015  IDISA_ALWAYS_INLINE void do_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker) {
    1017                 BitBlock transition_marks, zeromask, CtCD_marks;
     1016                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10181017
    10191018                BitBlock tempvar0, tempvar1;
    10201019
    10211020
    1022         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1021        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1022        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10231023        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10241024        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10251025        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1026         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1026        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10271027        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10281028        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10291029        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10301030        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1031         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10321031        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    10331032        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    10431042        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    10441043        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1045         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1046         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1047         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1048         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1044        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1045        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1046        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    10491047        carryQ.CarryQ_Adjust(2);
    10501048  }
    10511049  IDISA_ALWAYS_INLINE void do_final_block(U16hi & u16hi, U16lo & u16lo, Lex & lex, Callouts & callouts, Marker & marker, BitBlock EOF_mask) {
    1052                 BitBlock transition_marks, zeromask, CtCD_marks;
     1050                BitBlock CtCDPI_openers, transition_marks, zeromask;
    10531051
    10541052                BitBlock tempvar0, tempvar1;
    10551053
    10561054
    1057         transition_marks = simd_or(simd_or(simd_or(simd_or(callouts.CtCDPI_marks, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
     1055        CtCDPI_openers = simd_or(callouts.PI_openers, callouts.CtCD_openers);
     1056        transition_marks = simd_or(simd_or(simd_or(simd_or(CtCDPI_openers, callouts.AttEq_marks), callouts.StartTag_closers), callouts.EmptyTag_closers), callouts.EndTag_marks);
    10581057        callouts.MarkupDelimiters = simd_or(callouts.Tag_closers, callouts.CtCDPI_closers);
    10591058        callouts.StringEnds = simd_or(simd_or(callouts.CtCDPI_closers, callouts.AttCloseQuotes), marker.LAngle);
    10601059        callouts.delmask = simd_or(callouts.delmask, simd_andc(callouts.TagSpan, simd_or(simd_or(callouts.AttValSpan, transition_marks), callouts.StringEnds)));
    1061         tempvar0 = carryQ.BitBlock_exclusive_span(callouts.CtCDPI_marks, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
     1060        tempvar0 = carryQ.BitBlock_exclusive_span(CtCDPI_openers, callouts.CtCDPI_content_starts, carryQ.get_carry_in(0), 0);
    10621061        callouts.delmask = simd_or(callouts.delmask, tempvar0);
    10631062        tempvar1 = carryQ.BitBlock_advance_ci_co(marker.LAngle, carryQ.get_carry_in(1), 1);
    10641063        callouts.delmask = simd_or(callouts.delmask, simd_and(tempvar1, lex.Exclam));
    10651064        zeromask = simd_or(simd_or(callouts.delmask, callouts.StringEnds), transition_marks);
    1066         CtCD_marks = simd_andc(callouts.CtCDPI_marks, callouts.Symbol_starts);
    10671065        u16hi.bit_0 = simd_andc(u16hi.bit_0, zeromask);
    10681066        u16hi.bit_1 = simd_andc(u16hi.bit_1, zeromask);
     
    10781076        u16lo.bit_3 = simd_andc(u16lo.bit_3, zeromask);
    10791077        u16lo.bit_4 = simd_andc(u16lo.bit_4, simd_xor(zeromask, callouts.EmptyTag_closers));
    1080         u16lo.bit_5 = simd_andc(u16lo.bit_5, zeromask);
    1081         u16lo.bit_5 = simd_or(u16lo.bit_5, callouts.CtCDPI_marks);
    1082         u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), CtCD_marks));
    1083         u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, CtCD_marks), callouts.AttEq_marks));
     1078        u16lo.bit_5 = simd_or(simd_andc(u16lo.bit_5, zeromask), CtCDPI_openers);
     1079        u16lo.bit_6 = simd_andc(u16lo.bit_6, simd_xor(simd_xor(zeromask, callouts.EndTag_marks), callouts.CtCD_openers));
     1080        u16lo.bit_7 = simd_andc(u16lo.bit_7, simd_xor(simd_xor(zeromask, callouts.CtCD_openers), callouts.AttEq_marks));
    10841081  }
    10851082  void do_segment(U16hi u16hi[], U16lo u16lo[], Lex lex[], Callouts callouts[], Marker marker[], int segment_blocks) {
Note: See TracChangeset for help on using the changeset viewer.