Changeset 1866 for proto/u8u16
 Timestamp:
 Jan 21, 2012, 10:04:53 AM (7 years ago)
 Location:
 proto/u8u16
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

proto/u8u16/u8u16_pablo.py
r1822 r1866 56 56 57 57 def Utf8_to_utf16(u8_bits, u8, u16hi, u16lo): 58 u8.unibyte = (~u8_bits.bit_0) ;59 u8.prefix = (u8_bits.bit_0 & u8_bits.bit_1) ;60 u8.prefix2 = (u8.prefix &~ u8_bits.bit_2) ;61 temp1 = (u8_bits.bit_2 &~ u8_bits.bit_3) ;62 u8.prefix3 = (u8.prefix & temp1) ;63 temp2 = (u8_bits.bit_2 & u8_bits.bit_3) ;64 u8.prefix4 = (u8.prefix & temp2) ;65 u8.suffix = (u8_bits.bit_0 &~ u8_bits.bit_1) ;58 u8.unibyte = (~u8_bits.bit_0) 59 u8.prefix = (u8_bits.bit_0 & u8_bits.bit_1) 60 u8.prefix2 = (u8.prefix &~ u8_bits.bit_2) 61 temp1 = (u8_bits.bit_2 &~ u8_bits.bit_3) 62 u8.prefix3 = (u8.prefix & temp1) 63 temp2 = (u8_bits.bit_2 & u8_bits.bit_3) 64 u8.prefix4 = (u8.prefix & temp2) 65 u8.suffix = (u8_bits.bit_0 &~ u8_bits.bit_1) 66 66 # 67 67 u8.delmask = 0 … … 69 69 u8anyscope = 0 70 70 if u8_bits.bit_0: 71 temp3 = (u8_bits.bit_2  u8_bits.bit_3) ;72 temp4 = (u8.prefix &~ temp3) ;73 temp5 = (u8_bits.bit_4  u8_bits.bit_5) ;74 temp6 = (temp5  u8_bits.bit_6) ;75 badprefix2 = (temp4 &~ temp6) ;71 temp3 = (u8_bits.bit_2  u8_bits.bit_3) 72 temp4 = (u8.prefix &~ temp3) 73 temp5 = (u8_bits.bit_4  u8_bits.bit_5) 74 temp6 = (temp5  u8_bits.bit_6) 75 badprefix2 = (temp4 &~ temp6) 76 76 error_mask = badprefix2 77 77 u8.scope22 = pablo.Advance(u8.prefix2) … … 86 86 u8.delmask = u8.prefix 87 87 if u8.prefix3  u8.prefix4: 88 temp7 = (u8_bits.bit_6  u8_bits.bit_7) ;89 temp8 = (temp5  temp7) ;90 xE0 = (u8.prefix3 &~ temp8) ;91 temp9 = (u8_bits.bit_4 & u8_bits.bit_5) ;92 temp10 = (u8_bits.bit_7 &~ u8_bits.bit_6) ;93 temp11 = (temp9 & temp10) ;94 xED = (u8.prefix3 & temp11) ;95 xA0_xBF = (u8.suffix & u8_bits.bit_2) ;96 x80_x9F = (u8.suffix &~ u8_bits.bit_2) ;88 temp7 = (u8_bits.bit_6  u8_bits.bit_7) 89 temp8 = (temp5  temp7) 90 xE0 = (u8.prefix3 &~ temp8) 91 temp9 = (u8_bits.bit_4 & u8_bits.bit_5) 92 temp10 = (u8_bits.bit_7 &~ u8_bits.bit_6) 93 temp11 = (temp9 & temp10) 94 xED = (u8.prefix3 & temp11) 95 xA0_xBF = (u8.suffix & u8_bits.bit_2) 96 x80_x9F = (u8.suffix &~ u8_bits.bit_2) 97 97 error_mask = pablo.Advance(xE0) & x80_x9F 98 98 error_mask = pablo.Advance(xED) & xA0_xBF … … 109 109 u8.delmask = u8.scope32 110 110 if u8.prefix4: 111 temp12 = (u8_bits.bit_5 & temp7) ;112 temp13 = (u8_bits.bit_4  temp12) ;113 badprefix4 = (u8.prefix4 & temp13) ;111 temp12 = (u8_bits.bit_5 & temp7) 112 temp13 = (u8_bits.bit_4  temp12) 113 badprefix4 = (u8.prefix4 & temp13) 114 114 error_mask = badprefix4 115 xF0 = (u8.prefix4 &~ temp8) ;116 temp14 = (u8_bits.bit_5 &~ u8_bits.bit_4) ;117 temp15 = (temp14 &~ temp7) ;118 xF4 = (u8.prefix4 & temp15) ;119 x90_xBF = (u8.suffix & temp3) ;120 x80_x8F = (u8.suffix &~ temp3) ;115 xF0 = (u8.prefix4 &~ temp8) 116 temp14 = (u8_bits.bit_5 &~ u8_bits.bit_4) 117 temp15 = (temp14 &~ temp7) 118 xF4 = (u8.prefix4 & temp15) 119 x90_xBF = (u8.suffix & temp3) 120 x80_x8F = (u8.suffix &~ temp3) 121 121 error_mask = pablo.Advance(xF0) & x80_x8F 122 122 error_mask = pablo.Advance(xF4) & x90_xBF 
proto/u8u16/u8u16_pablo_straight.py
r1821 r1866 2 2 3 3 def main(): 4 u8_unibyte = (~bit[0]) ;5 u8_prefix = (bit[0] & bit[1]) ;6 u8_prefix2 = (u8_prefix &~ bit[2]) ;7 temp1 = (bit[2] &~ bit[3]) ;8 u8_prefix3 = (u8_prefix & temp1) ;9 temp2 = (bit[2] & bit[3]) ;10 u8_prefix4 = (u8_prefix & temp2) ;11 u8_suffix = (bit[0] &~ bit[1]) ;12 temp3 = (bit[2]  bit[3]) ;13 temp4 = (u8_prefix &~ temp3) ;14 temp5 = (bit[4]  bit[5]) ;15 temp6 = (temp5  bit[6]) ;16 temp7 = (temp4 &~ temp6) ;17 temp8 = (bit[6]  bit[7]) ;18 temp9 = (bit[5] & temp8) ;19 temp10 = (bit[4]  temp9) ;20 temp11 = (u8_prefix4 & temp10) ;21 u8_badprefix = (temp7  temp11) ;22 temp12 = (temp5  temp8) ;23 xE0 = (u8_prefix3 &~ temp12) ;24 temp13 = (bit[4] & bit[5]) ;25 temp14 = (bit[7] &~ bit[6]) ;26 temp15 = (temp13 & temp14) ;27 xED = (u8_prefix3 & temp15) ;28 xF0 = (u8_prefix4 &~ temp12) ;29 temp16 = (bit[5] &~ bit[4]) ;30 temp17 = (temp16 &~ temp8) ;31 xF4 = (u8_prefix4 & temp17) ;32 xA0_xBF = (u8_suffix & bit[2]) ;33 x80_x9F = (u8_suffix &~ bit[2]) ;34 x90_xBF = (u8_suffix & temp3) ;35 x80_x8F = (u8_suffix &~ temp3) ;4 u8_unibyte = (~bit[0]) 5 u8_prefix = (bit[0] & bit[1]) 6 u8_prefix2 = (u8_prefix &~ bit[2]) 7 temp1 = (bit[2] &~ bit[3]) 8 u8_prefix3 = (u8_prefix & temp1) 9 temp2 = (bit[2] & bit[3]) 10 u8_prefix4 = (u8_prefix & temp2) 11 u8_suffix = (bit[0] &~ bit[1]) 12 temp3 = (bit[2]  bit[3]) 13 temp4 = (u8_prefix &~ temp3) 14 temp5 = (bit[4]  bit[5]) 15 temp6 = (temp5  bit[6]) 16 temp7 = (temp4 &~ temp6) 17 temp8 = (bit[6]  bit[7]) 18 temp9 = (bit[5] & temp8) 19 temp10 = (bit[4]  temp9) 20 temp11 = (u8_prefix4 & temp10) 21 u8_badprefix = (temp7  temp11) 22 temp12 = (temp5  temp8) 23 xE0 = (u8_prefix3 &~ temp12) 24 temp13 = (bit[4] & bit[5]) 25 temp14 = (bit[7] &~ bit[6]) 26 temp15 = (temp13 & temp14) 27 xED = (u8_prefix3 & temp15) 28 xF0 = (u8_prefix4 &~ temp12) 29 temp16 = (bit[5] &~ bit[4]) 30 temp17 = (temp16 &~ temp8) 31 xF4 = (u8_prefix4 & temp17) 32 xA0_xBF = (u8_suffix & bit[2]) 33 x80_x9F = (u8_suffix &~ bit[2]) 34 x90_xBF = (u8_suffix & temp3) 35 x80_x8F = (u8_suffix &~ temp3) 36 36 37 37 #
Note: See TracChangeset
for help on using the changeset viewer.