Changeset 872


Ignore:
Timestamp:
Jan 6, 2011, 3:06:20 PM (8 years ago)
Author:
ksherdy
Message:

Add call to bitblock_prefix_parity to avoid manual insertion.

Location:
proto/JSON
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/JSON/json_pablo_compilable.py

    r869 r872  
    254254        ### Start parse_escape
    255255        #
    256         # Odd = simd_const_2(1) -> parity.Odd, since 'Odd' will be defined as a member of the Parity struct
    257         # Even = simd_const_2(2) -> parity.Even, since 'Even' will be defined as a member of the Parity Struct
     256        # parity.Odd = simd_const_2(1) -> parity.Odd, since 'Odd' will be defined as a member of the Parity struct
     257        # parity.Even = simd_const_2(2) -> parity.Even, since 'Even' will be defined as a member of the Parity Struct
     258       
     259       
    258260        Start = lex.RSolidus &~ bitutil.Advance(lex.RSolidus)
    259261       
     
    272274       
    273275        ### parallel_prefix_mask() --- we currently manually insert this method into the JSON template.c
     276        # A hack to avoid the need for manual insertion of parity.ParityMask generation
     277        parity.ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
     278        parity.ParityMask = simd_and(parity.ParityMask, EOF_mask);     
    274279       
    275280        ### Start Generate String Mask ---
  • proto/JSON/json_pablo_template.c

    r869 r872  
    4444        BitBlock EOF_mask = simd_const_1(1);
    4545
    46         /*extra*/
    47         /* parse_escape, do not declare, since the PyBit compiler does so by default*/
     46        /*extras*/
    4847        parity.Odd = simd_const_2(1);
    4948        parity.Even = simd_const_2(2);
     
    8988                        bit[0], bit[1], bit[2], bit[3], bit[4], bit[5], bit[6], bit[7]);
    9089
    91                         @block_stmts
    92 
    93                         /* Generate Parity Mask */
     90                        /* generate bitblock_parity_mask */
     91
     92                        // TODO - Figure out this code - May replace
    9493                        high_bit_mask = sisd_high_bit_mask;
    9594                        high_bit_is_set = simd_and(high_bit_mask, bitblock_parity_mask);
    96                         bitblock_parity_mask = sisd_add( simd_not(sisd_srl(high_bit_is_set, sisd_from_int(BLOCK_SIZE-1))) , sisd_low_bit_mask);
    97                         parity.ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
     95                        bitblock_parity_mask = sisd_add( simd_not(sisd_srl(high_bit_is_set, sisd_from_int(BLOCK_SIZE-1))), sisd_low_bit_mask);
     96
     97                        @block_stmts
     98
     99                        /* Generate Parity Mask */
     100                        // TODO - Migrate to json_pablo_compilable.py
     101                        //parity.ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
    98102
    99103                        #ifdef DEBUG
     
    149153                        bit[7] = simd_and(bit[7], EOF_mask);
    150154
    151                         @block_stmts
    152 
    153                         /* Generate Parity Mask */
     155                        /* generate bitblock_parity_mask */
     156                        // TODO - Figure out this code - May replace
    154157                        high_bit_mask = sisd_srl(sisd_high_bit_mask, sisd_from_int(BLOCK_SIZE-chars_avail));
    155158                        high_bit_is_set = simd_and(high_bit_mask, bitblock_parity_mask);
    156                         bitblock_parity_mask = sisd_add(simd_not(sisd_srl(high_bit_is_set, sisd_from_int(chars_avail-1))) , sisd_low_bit_mask);
    157                         parity.ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
    158                         parity.ParityMask = simd_and(parity.ParityMask, EOF_mask);
     159                        bitblock_parity_mask = sisd_add(simd_not(sisd_srl(high_bit_is_set, sisd_from_int(chars_avail-1))), sisd_low_bit_mask);
     160
     161                        @block_stmts
     162
     163                        // TODO - Migrate to json_pablo_compilable.py
     164                        //parity.ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask);
     165                        // TODO - Re-consider inclusion of 'EOF_mask' in the prototype
     166                        //parity.ParityMask = simd_and(parity.ParityMask, EOF_mask);
    159167
    160168                        #ifdef DEBUG
Note: See TracChangeset for help on using the changeset viewer.