Changeset 746 for proto/JSON


Ignore:
Timestamp:
Nov 30, 2010, 10:36:38 PM (8 years ago)
Author:
ksherdy
Message:

Fix ParityMask? masking.

Location:
proto/JSON
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • proto/JSON/QA/pass/string.json

    r703 r746  
    1 ["Quick", "Brown", "Fox", "\"", "\\", "\\\\", "\\\\\\", "\/", "\b", "\f", "\n", "\r", "\t", "\uabcd", "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]
     1[   "Quick ",   "Brown ",   "Fox   ",   "\"    ",   "\\",   "  \\\\",   "\\\\\\",   "\/",   "\b",   "\f",   "\n",   "\r",   "\t",   "\uabcd",   "   \/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]
  • proto/JSON/json_compilable.py

    r744 r746  
    173173
    174174        Escape = (EvenEscape | OddEscape) 
    175         UnescapedDQuotes = (Lex.DQuote &~ EscapeChars)
     175        UnescapedDQuotes = (Lex.DQuote &~ Escape)
    176176       
    177177        # parallel_prefix_mask() --- manual insert and bitblock logic in JSON template.c --- assume existence of ParityMask
  • proto/JSON/json_prototype.py

    r744 r746  
    624624        u8data = bitutil.readfile(sys.argv[1])
    625625
    626         demo_parse_escape(u8data)
     626#       demo_parse_escape(u8data)
    627627#       demo_parallel_prefix_parity(u8data)
    628628#       demo_atom_starts(u8data)
    629629#       demo_validate_number(u8data)
    630 #       demo_validate_string(u8data)
     630        demo_validate_string(u8data)
    631631#       demo_validate_json_atoms(u8data)
  • proto/JSON/src/json.c

    r744 r746  
    115115BitBlock EvenEscape;
    116116BitBlock strct_Lex__RSolidus_;
    117 BitBlock Escape;
     117//BitBlock Escape;
    118118BitBlock array_bit__1_;
    119119BitBlock Even;
     
    135135BitBlock temp53;
    136136BitBlock strct_Lex__DecimalPoint_;
    137 BitBlock EscapeChars;
     137BitBlock Escape;
    138138BitBlock temp88;
    139139BitBlock temp89;
     
    416416OddEscape = simd_and(OddFinal,Even);
    417417Escape = simd_or(EvenEscape,OddEscape);
    418 UnescapedDQuotes = simd_andc(strct_Lex__DQuote_,EscapeChars);
     418UnescapedDQuotes = simd_andc(strct_Lex__DQuote_,Escape);
    419419
    420420                        /* Generate Parity Mask */
     
    627627OddEscape = simd_and(OddFinal,Even);
    628628Escape = simd_or(EvenEscape,OddEscape);
    629 UnescapedDQuotes = simd_andc(strct_Lex__DQuote_,EscapeChars);
    630 advance_with_carry(ParityMask, carry3, Temp8);
     629UnescapedDQuotes = simd_andc(strct_Lex__DQuote_,Escape);
    631630
    632631                        /* Generate Parity Mask */
     
    635634                        bitblock_parity_mask = sisd_add(simd_not(sisd_srl(high_bit_is_set, sisd_from_int(chars_avail-1))) , sisd_low_bit_mask);                 
    636635                        ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
    637                         ParityMask = simd_and(bitblock_parity_mask, EOF_mask);
    638 
    639 
     636                        ParityMask = simd_and(ParityMask, EOF_mask);
     637
     638advance_with_carry(ParityMask, carry3, Temp8);
    640639StringMask = simd_and(ParityMask,Temp8);
    641640StringSpans = simd_or(StringMask,UnescapedDQuotes);
     
    650649                       
    651650                        print_simd_register("Unescaped DQuote",UnescapedDQuotes);
    652                         /*
     651                       
    653652                        print_simd_register("high_bit_is_set", high_bit_is_set);
    654653                        print_simd_register("high_bit_mask", high_bit_mask);
    655                         */
     654                       
    656655                        print_simd_register("ParityMask", ParityMask);
    657656                        print_simd_register("StringMask", StringMask);
  • proto/JSON/template.c

    r744 r746  
    144144                        bitblock_parity_mask = sisd_add(simd_not(sisd_srl(high_bit_is_set, sisd_from_int(chars_avail-1))) , sisd_low_bit_mask);                 
    145145                        ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
    146                         ParityMask = simd_and(bitblock_parity_mask, EOF_mask);
     146                        ParityMask = simd_and(ParityMask, EOF_mask);
    147147                       
    148148                       
Note: See TracChangeset for help on using the changeset viewer.