Ignore:
Timestamp:
Nov 12, 2010, 1:21:47 PM (9 years ago)
Author:
cameron
Message:

Factoring out bitstream advances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/u8u16/u8u16_compilable.py

    r606 r706  
    4444        u8anyscope = u8lastscope | u8.scope32 | u8.scope42 | u8.scope43
    4545
     46        adv_bit2 = bitutil.Advance(bit[2])
     47        adv_bit3 = bitutil.Advance(bit[3])
     48        adv_bit4 = bitutil.Advance(bit[4])
     49        adv_bit5 = bitutil.Advance(bit[5])
     50        adv_bit6 = bitutil.Advance(bit[6])
     51        adv_bit7 = bitutil.Advance(bit[7])
    4652             
    4753        # C0-C1 and F5-FF are illegal
     
    6268        u16lo[6] = u8lastbyte & bit[6]
    6369        u16lo[7] = u8lastbyte & bit[7]
    64         u16lo[1] = (u8.unibyte & bit[1]) | (u8lastscope & bitutil.Advance(bit[7]))
    65         u16lo[0] = u8lastscope & bitutil.Advance(bit[6])
     70        u16lo[1] = (u8.unibyte & bit[1]) | (u8lastscope & adv_bit7)
     71        u16lo[0] = u8lastscope & adv_bit6
    6672       
    67         u16hi[5] = u8lastscope & bitutil.Advance(bit[3])
    68         u16hi[6] = u8lastscope & bitutil.Advance(bit[4])
    69         u16hi[7] = u8lastscope & bitutil.Advance(bit[5])
    70         u16hi[0] = u8.scope33 & bitutil.Advance(bitutil.Advance(bit[4]))
    71         u16hi[1] = u8.scope33 & bitutil.Advance(bitutil.Advance(bit[5]))
    72         u16hi[2] = u8.scope33 & bitutil.Advance(bitutil.Advance(bit[6]))
    73         u16hi[3] = u8.scope33 & bitutil.Advance(bitutil.Advance(bit[7]))
    74         u16hi[4] = u8.scope33 & bitutil.Advance(bit[2])
     73        u16hi[5] = u8lastscope & adv_bit3
     74        u16hi[6] = u8lastscope & adv_bit4
     75        u16hi[7] = u8lastscope & adv_bit5
     76        u16hi[0] = u8.scope33 & bitutil.Advance(adv_bit4)
     77        u16hi[1] = u8.scope33 & bitutil.Advance(adv_bit5)
     78        u16hi[2] = u8.scope33 & bitutil.Advance(adv_bit6)
     79        u16hi[3] = u8.scope33 & bitutil.Advance(adv_bit7)
     80        u16hi[4] = u8.scope33 & adv_bit2
    7581
    7682        u8surrogate = u8.scope43 | u8.scope44
     
    8793        u16lo[0] = u16lo[0] | (u8.scope43 & bitutil.Advance(s42lo0))
    8894        borrow1 = s42lo1 & ~bit[2]
    89         Advance_bit7 = bitutil.Advance(bit[7])
    90         s42hi7 = Advance_bit7 ^ borrow1
     95        s42hi7 = adv_bit7 ^ borrow1
    9196        u16hi[7]= u16hi[7] | (u8.scope43 & bitutil.Advance(s42hi7))
    92         borrow2 = borrow1 & ~Advance_bit7
    93         s42hi6 = bitutil.Advance(bit[6]) ^ borrow2
     97        borrow2 = borrow1 & ~adv_bit7
     98        s42hi6 = adv_bit6 ^ borrow2
    9499        u16hi[6] = u16hi[6] | (u8.scope43 & bitutil.Advance(s42hi6))
    95100
    96         u16lo[2] = u16lo[2] | (u8.scope43 & bitutil.Advance(bit[4]))
    97         u16lo[3] = u16lo[3] | (u8.scope43 & bitutil.Advance(bit[5]))
    98         u16lo[4] = u16lo[4] | (u8.scope43 & bitutil.Advance(bit[6]))
    99         u16lo[5] = u16lo[5] | (u8.scope43 & bitutil.Advance(bit[7]))
     101        u16lo[2] = u16lo[2] | (u8.scope43 & adv_bit4)
     102        u16lo[3] = u16lo[3] | (u8.scope43 & adv_bit5)
     103        u16lo[4] = u16lo[4] | (u8.scope43 & adv_bit6)
     104        u16lo[5] = u16lo[5] | (u8.scope43 & adv_bit7)
    100105        u16lo[6] = u16lo[6] | (u8.scope43 & bit[2])
    101106        u16lo[7] = u16lo[7] | (u8.scope43 & bit[3])
Note: See TracChangeset for help on using the changeset viewer.