 Timestamp:
 Dec 29, 2011, 7:31:12 PM (7 years ago)
 Location:
 proto/u8u16
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

proto/u8u16/pablo_template.cpp
r1821 r1822 28 28 BOM_Table * transcode_timer; 29 29 #endif 30 31 #define SEGMENT_BLOCKS 10 30 32 31 33 #ifdef CODE_CLOCKER … … 109 111 @decl 110 112 111 BitBlock u16l [8]; 112 BitBlock u16h [8]; 113 114 115 BytePack U16s[16]; 113 114 BytePack U8s[8]; 116 115 BytePack U16h[8]; 117 116 BytePack U16l[8]; 117 BytePack U16s[16]; 118 118 119 119 BitBlock EOF_mask = simd<1>::constant<1>(); 120 120 121 122 BitBlock bit[8];123 BitBlock u16hi[8];124 BitBlock u16lo[8];125 121 126 122 int pos = 0; … … 144 140 145 141 BytePack * U8pack = (BytePack *) (*srcbuf); 146 bit[0] = bitblock::load_unaligned(&U8pack[0]);147 bit[1] = bitblock::load_unaligned(&U8pack[1]);148 bit[2] = bitblock::load_unaligned(&U8pack[2]);149 bit[3] = bitblock::load_unaligned(&U8pack[3]);150 bit[4] = bitblock::load_unaligned(&U8pack[4]);151 bit[5] = bitblock::load_unaligned(&U8pack[5]);152 bit[6] = bitblock::load_unaligned(&U8pack[6]);153 bit[7] = bitblock::load_unaligned(&U8pack[7]);154 155 s2p( bit[0], bit[1], bit[2], bit[3], bit[4], bit[5], bit[6], bit[7],156 bit[0], bit[1], bit[2], bit[3], bit[4], bit[5], bit[6], bit[7]);157 158 bit[0] = simd_and(bit[0], EOF_mask);159 bit[1] = simd_and(bit[1], EOF_mask);160 bit[2] = simd_and(bit[2], EOF_mask);161 bit[3] = simd_and(bit[3], EOF_mask);162 bit[4] = simd_and(bit[4], EOF_mask);163 bit[5] = simd_and(bit[5], EOF_mask);164 bit[6] = simd_and(bit[6], EOF_mask);165 bit[7] = simd_and(bit[7], EOF_mask);142 U8s[0] = bitblock::load_unaligned(&U8pack[0]); 143 U8s[1] = bitblock::load_unaligned(&U8pack[1]); 144 U8s[2] = bitblock::load_unaligned(&U8pack[2]); 145 U8s[3] = bitblock::load_unaligned(&U8pack[3]); 146 U8s[4] = bitblock::load_unaligned(&U8pack[4]); 147 U8s[5] = bitblock::load_unaligned(&U8pack[5]); 148 U8s[6] = bitblock::load_unaligned(&U8pack[6]); 149 U8s[7] = bitblock::load_unaligned(&U8pack[7]); 150 151 s2p(U8s[0], U8s[1], U8s[2], U8s[3], U8s[4], U8s[5], U8s[6], U8s[7], 152 u8_bits.bit_0, u8_bits.bit_1, u8_bits.bit_2, u8_bits.bit_3, u8_bits.bit_4, u8_bits.bit_5, u8_bits.bit_6, u8_bits.bit_7); 153 154 u8_bits.bit_0 = simd_and(u8_bits.bit_0, EOF_mask); 155 u8_bits.bit_1 = simd_and(u8_bits.bit_1, EOF_mask); 156 u8_bits.bit_2 = simd_and(u8_bits.bit_2, EOF_mask); 157 u8_bits.bit_3 = simd_and(u8_bits.bit_3, EOF_mask); 158 u8_bits.bit_4 = simd_and(u8_bits.bit_4, EOF_mask); 159 u8_bits.bit_5 = simd_and(u8_bits.bit_5, EOF_mask); 160 u8_bits.bit_6 = simd_and(u8_bits.bit_6, EOF_mask); 161 u8_bits.bit_7 = simd_and(u8_bits.bit_7, EOF_mask); 166 162 167 163 @block_stmts 168 164 169 delmask = ~EOF_mask;170 error_found = bitblock::any( error_mask);165 u8.delmask = ~EOF_mask; 166 error_found = bitblock::any(u8.error); 171 167 if (error_found) { 172 int errpos = count_forward_zeroes( error_mask);168 int errpos = count_forward_zeroes(u8.error); 173 169 if (errpos >= u8advance) { 174 170 *err = U_TRUNCATED_CHAR_FOUND; … … 176 172 else *err = U_ILLEGAL_CHAR_FOUND; 177 173 BitBlock cutoff_mask = bitblock::sll(simd<1>::constant<1>(), convert(errpos)); 178 BitBlock errbit = simd_andc( error_mask, bitblock::slli<1>(cutoff_mask));174 BitBlock errbit = simd_andc(u8.error, bitblock::slli<1>(cutoff_mask)); 179 175 u8advance = errpos; 180 if (bitblock::any(simd_and(u8 _scope44, errbit))) {176 if (bitblock::any(simd_and(u8.scope44, errbit))) { 181 177 u8advance = 3; 182 178 /* May have already first of a surrogate pair to targetbuf. */ 183 179 if (u8advance == 3) *targetbuf = 1; 184 180 } 185 else if (bitblock::any(simd_and(u8 _scope43, errbit))) {181 else if (bitblock::any(simd_and(u8.scope43, errbit))) { 186 182 u8advance = 2; 187 183 } 188 else if (bitblock::any(simd_and(u8 _scope33, errbit))) {184 else if (bitblock::any(simd_and(u8.scope33, errbit))) { 189 185 u8advance = 2; 190 186 } 191 else if (bitblock::any(simd_and(simd_or(u8 _scope22, simd_or(u8_scope32, u8_scope42)), errbit))) {187 else if (bitblock::any(simd_and(simd_or(u8.scope22, simd_or(u8.scope32, u8.scope42)), errbit))) { 192 188 u8advance = 1; 193 189 } … … 196 192 return; 197 193 } 198 delmask = bitblock::sll(simd<1>::constant<1>(), convert(u8advance));194 u8.delmask = bitblock::sll(simd<1>::constant<1>(), convert(u8advance)); 199 195 // fprintf(stderr, "errpos = %i, u8advance = %i\n", errpos, u8advance); 200 196 } 201 197 202 198 203 if (bitblock::any( delmask)) {199 if (bitblock::any(u8.delmask)) { 204 200 BitBlock shift1, shift2, shift4; 205 del_info_8(shift1, shift2, shift4, delmask);206 do_right8_shifts(u16lo [0], shift1, shift2, shift4);207 do_right8_shifts(u16lo [1], shift1, shift2, shift4);208 do_right8_shifts(u16lo [2], shift1, shift2, shift4);209 do_right8_shifts(u16lo [3], shift1, shift2, shift4);210 do_right8_shifts(u16lo [4], shift1, shift2, shift4);211 do_right8_shifts(u16lo [5], shift1, shift2, shift4);212 do_right8_shifts(u16lo [6], shift1, shift2, shift4);213 do_right8_shifts(u16lo [7], shift1, shift2, shift4);214 if (bitblock::any(u8 _scope33  u8surrogate)) {215 do_right8_shifts(u16hi [0], shift1, shift2, shift4);216 do_right8_shifts(u16hi [1], shift1, shift2, shift4);217 do_right8_shifts(u16hi [2], shift1, shift2, shift4);218 do_right8_shifts(u16hi [3], shift1, shift2, shift4);219 do_right8_shifts(u16hi [4], shift1, shift2, shift4);201 del_info_8(shift1, shift2, shift4, u8.delmask); 202 do_right8_shifts(u16lo.bit_0, shift1, shift2, shift4); 203 do_right8_shifts(u16lo.bit_1, shift1, shift2, shift4); 204 do_right8_shifts(u16lo.bit_2, shift1, shift2, shift4); 205 do_right8_shifts(u16lo.bit_3, shift1, shift2, shift4); 206 do_right8_shifts(u16lo.bit_4, shift1, shift2, shift4); 207 do_right8_shifts(u16lo.bit_5, shift1, shift2, shift4); 208 do_right8_shifts(u16lo.bit_6, shift1, shift2, shift4); 209 do_right8_shifts(u16lo.bit_7, shift1, shift2, shift4); 210 if (bitblock::any(u8.scope33  u8.surrogate)) { 211 do_right8_shifts(u16hi.bit_0, shift1, shift2, shift4); 212 do_right8_shifts(u16hi.bit_1, shift1, shift2, shift4); 213 do_right8_shifts(u16hi.bit_2, shift1, shift2, shift4); 214 do_right8_shifts(u16hi.bit_3, shift1, shift2, shift4); 215 do_right8_shifts(u16hi.bit_4, shift1, shift2, shift4); 220 216 } 221 do_right8_shifts(u16hi [5], shift1, shift2, shift4);222 do_right8_shifts(u16hi [6], shift1, shift2, shift4);223 do_right8_shifts(u16hi [7], shift1, shift2, shift4);217 do_right8_shifts(u16hi.bit_5, shift1, shift2, shift4); 218 do_right8_shifts(u16hi.bit_6, shift1, shift2, shift4); 219 do_right8_shifts(u16hi.bit_7, shift1, shift2, shift4); 224 220 } 225 221 226 222 union {BitBlock i128; uint8_t i8[16];} u16_units_per_reg; 227 223 228 p2s(u16lo [0],u16lo[1],u16lo[2],u16lo[3],u16lo[4],u16lo[5],u16lo[6],u16lo[7],224 p2s(u16lo.bit_0,u16lo.bit_1,u16lo.bit_2,u16lo.bit_3,u16lo.bit_4,u16lo.bit_5,u16lo.bit_6,u16lo.bit_7, 229 225 U16l[0], U16l[1],U16l[2] ,U16l[3] ,U16l[4] ,U16l[5] ,U16l[6] ,U16l[7]); 230 p2s(u16hi [0],u16hi[1],u16hi[2],u16hi[3],u16hi[4],u16hi[5],u16hi[6],u16hi[7],226 p2s(u16hi.bit_0,u16hi.bit_1,u16hi.bit_2,u16hi.bit_3,u16hi.bit_4,u16hi.bit_5,u16hi.bit_6,u16hi.bit_7, 231 227 U16h[0], U16h[1],U16h[2] ,U16h[3] ,U16h[4] ,U16h[5] ,U16h[6] ,U16h[7]); 232 228 for (int i=0; i<8; i++) { … … 236 232 237 233 for(int k=0; k<16; k++) u16_units_per_reg.i8[k] = 0; 238 del_count( delmask,u16_units_per_reg.i128);234 del_count(u8.delmask,u16_units_per_reg.i128); 239 235 240 236 for(int j=0; j<16; j++){ 
proto/u8u16/u8u16_pablo.py
r1592 r1822 1 1 # * coding: utf8 * 2 3 4 class u8_bits(): 5 bit_0 = 0 6 bit_1 = 0 7 bit_2 = 0 8 bit_3 = 0 9 bit_4 = 0 10 bit_5 = 0 11 bit_6 = 0 12 bit_7 = 0 13 14 class u16hi(): 15 bit_0 = 0 16 bit_1 = 0 17 bit_2 = 0 18 bit_3 = 0 19 bit_4 = 0 20 bit_5 = 0 21 bit_6 = 0 22 bit_7 = 0 23 24 class u16lo(): 25 bit_0 = 0 26 bit_1 = 0 27 bit_2 = 0 28 bit_3 = 0 29 bit_4 = 0 30 bit_5 = 0 31 bit_6 = 0 32 bit_7 = 0 33 2 34 3 35 class u8 (): … … 14 46 scope43 = 0 15 47 scope44 = 0 48 surrogate = 0 16 49 xE0_scope = 0 17 50 xED_scope = 0 … … 20 53 xEF_scope = 0 21 54 error = 0 22 23 24 def main(u8, mask):25 u8.unibyte = (~ bit[0]);26 u8.prefix = ( bit[0] & bit[1]);27 u8.prefix2 = (u8.prefix &~ bit[2]);28 temp1 = ( bit[2] &~ bit[3]);55 delmask = 0 56 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); 29 62 u8.prefix3 = (u8.prefix & temp1); 30 temp2 = ( bit[2] & bit[3]);63 temp2 = (u8_bits.bit_2 & u8_bits.bit_3); 31 64 u8.prefix4 = (u8.prefix & temp2); 32 u8.suffix = ( bit[0] &~ bit[1]);65 u8.suffix = (u8_bits.bit_0 &~ u8_bits.bit_1); 33 66 # 34 delmask = 067 u8.delmask = 0 35 68 error_mask = 0 36 69 u8anyscope = 0 37 if bit[0]:38 temp3 = ( bit[2]  bit[3]);70 if u8_bits.bit_0: 71 temp3 = (u8_bits.bit_2  u8_bits.bit_3); 39 72 temp4 = (u8.prefix &~ temp3); 40 temp5 = ( bit[4]  bit[5]);41 temp6 = (temp5  bit[6]);73 temp5 = (u8_bits.bit_4  u8_bits.bit_5); 74 temp6 = (temp5  u8_bits.bit_6); 42 75 badprefix2 = (temp4 &~ temp6); 43 76 error_mask = badprefix2 44 77 u8.scope22 = pablo.Advance(u8.prefix2) 45 adv_bit3 = pablo.Advance( bit[3])46 adv_bit4 = pablo.Advance( bit[4])47 adv_bit5 = pablo.Advance( bit[5])48 adv_bit6 = pablo.Advance( bit[6])49 adv_bit7 = pablo.Advance( bit[7])78 adv_bit3 = pablo.Advance(u8_bits.bit_3) 79 adv_bit4 = pablo.Advance(u8_bits.bit_4) 80 adv_bit5 = pablo.Advance(u8_bits.bit_5) 81 adv_bit6 = pablo.Advance(u8_bits.bit_6) 82 adv_bit7 = pablo.Advance(u8_bits.bit_7) 50 83 u8lastscope = u8.scope22 51 84 u8anyscope = u8.scope22 52 85 u8lastbyte = u8.unibyte  u8lastscope 53 delmask = u8.prefix86 u8.delmask = u8.prefix 54 87 if u8.prefix3  u8.prefix4: 55 temp7 = ( bit[6]  bit[7]);88 temp7 = (u8_bits.bit_6  u8_bits.bit_7); 56 89 temp8 = (temp5  temp7); 57 90 xE0 = (u8.prefix3 &~ temp8); 58 temp9 = ( bit[4] & bit[5]);59 temp10 = ( bit[7] &~ bit[6]);91 temp9 = (u8_bits.bit_4 & u8_bits.bit_5); 92 temp10 = (u8_bits.bit_7 &~ u8_bits.bit_6); 60 93 temp11 = (temp9 & temp10); 61 94 xED = (u8.prefix3 & temp11); 62 xA0_xBF = (u8.suffix & bit[2]);63 x80_x9F = (u8.suffix &~ bit[2]);95 xA0_xBF = (u8.suffix & u8_bits.bit_2); 96 x80_x9F = (u8.suffix &~ u8_bits.bit_2); 64 97 error_mask = pablo.Advance(xE0) & x80_x9F 65 98 error_mask = pablo.Advance(xED) & xA0_xBF 66 99 u8.scope32 = pablo.Advance(u8.prefix3) 67 100 u8.scope33 = pablo.Advance(u8.scope32) 68 adv_bit2 = pablo.Advance( bit[2])101 adv_bit2 = pablo.Advance(u8_bits.bit_2) 69 102 advadv_bit4 = pablo.Advance(adv_bit4) 70 103 advadv_bit5 = pablo.Advance(adv_bit5) … … 74 107 u8anyscope = u8lastscope  u8.scope32 75 108 u8lastbyte = u8.unibyte  u8lastscope 76 delmask = u8.scope32109 u8.delmask = u8.scope32 77 110 if u8.prefix4: 78 temp12 = ( bit[5]& temp7);79 temp13 = ( bit[4] temp12);111 temp12 = (u8_bits.bit_5 & temp7); 112 temp13 = (u8_bits.bit_4  temp12); 80 113 badprefix4 = (u8.prefix4 & temp13); 81 114 error_mask = badprefix4 82 115 xF0 = (u8.prefix4 &~ temp8); 83 temp14 = ( bit[5] &~ bit[4]);116 temp14 = (u8_bits.bit_5 &~ u8_bits.bit_4); 84 117 temp15 = (temp14 &~ temp7); 85 118 xF4 = (u8.prefix4 & temp15); … … 91 124 u8.scope43 = pablo.Advance(u8.scope42) 92 125 u8.scope44 = pablo.Advance(u8.scope43) 93 u8 surrogate = u8.scope43  u8.scope44126 u8.surrogate = u8.scope43  u8.scope44 94 127 u8lastscope = u8.scope44 95 128 u8anyscope = u8lastscope  u8.scope32  u8.scope42  u8.scope43 96 129 u8lastbyte = u8.unibyte  u8lastscope 97 delmask = u8.scope4298 u16lo [1] = (u8.unibyte & bit[1])  (u8lastscope & adv_bit7)99 u16lo [0]= u8lastscope & adv_bit6100 u16hi [5]= u8lastscope & adv_bit3101 u16hi [6]= u8lastscope & adv_bit4102 u16hi [7]= u8lastscope & adv_bit5103 u16hi [0] = u8.scope33 & advadv_bit4  u8surrogate104 u16hi [1] = u8.scope33 & advadv_bit5  u8surrogate105 u16hi [2]= u8.scope33 & advadv_bit6106 u16hi [3] = u8.scope33 & advadv_bit7  u8surrogate107 u16hi [4] = u8.scope33 & adv_bit2  u8surrogate108 u16hi [5]= u8lastscope & adv_bit3  u8.scope44130 u8.delmask = u8.scope42 131 u16lo.bit_1 = (u8.unibyte & u8_bits.bit_1)  (u8lastscope & adv_bit7) 132 u16lo.bit_0 = u8lastscope & adv_bit6 133 u16hi.bit_5 = u8lastscope & adv_bit3 134 u16hi.bit_6 = u8lastscope & adv_bit4 135 u16hi.bit_7 = u8lastscope & adv_bit5 136 u16hi.bit_0 = u8.scope33 & advadv_bit4  u8.surrogate 137 u16hi.bit_1 = u8.scope33 & advadv_bit5  u8.surrogate 138 u16hi.bit_2 = u8.scope33 & advadv_bit6 139 u16hi.bit_3 = u8.scope33 & advadv_bit7  u8.surrogate 140 u16hi.bit_4 = u8.scope33 & adv_bit2  u8.surrogate 141 u16hi.bit_5 = u8lastscope & adv_bit3  u8.scope44 109 142 s43lo1 = ~adv_bit3 # subtract 1 110 u16lo [1] = u16lo[1] u8.scope43 & s43lo1143 u16lo.bit_1 = u16lo.bit_1  u8.scope43 & s43lo1 111 144 s43lo0 = adv_bit2 ^ s43lo1 # borrow * 112 u16lo [0] = u16lo[0] u8.scope43 & s43lo0145 u16lo.bit_0 = u16lo.bit_0  u8.scope43 & s43lo0 113 146 s43borrow1 = s43lo1 & ~adv_bit2 114 147 s43hi7 = advadv_bit7 ^ s43borrow1 115 148 s43borrow2 = s43borrow1 & ~advadv_bit7 116 149 s43hi6 = advadv_bit6 ^ s43borrow2 117 u16hi [7]= u8lastscope & adv_bit5  (u8.scope43 & s43hi7)118 u16hi [6]= u8lastscope & adv_bit4  (u8.scope43 & s43hi6)119 u16lo [2] = u8lastbyte & bit[2] (u8.scope43 & adv_bit4)120 u16lo [3] = u8lastbyte & bit[3] (u8.scope43 & adv_bit5)121 u16lo [4] = u8lastbyte & bit[4] (u8.scope43 & adv_bit6)122 u16lo [5] = u8lastbyte & bit[5] (u8.scope43 & adv_bit7)123 u16lo [6] = u8lastbyte & bit[6]  (u8.scope43 & bit[2])124 u16lo [7] = u8lastbyte & bit[7]  (u8.scope43 & bit[3])150 u16hi.bit_7 = u8lastscope & adv_bit5  (u8.scope43 & s43hi7) 151 u16hi.bit_6 = u8lastscope & adv_bit4  (u8.scope43 & s43hi6) 152 u16lo.bit_2 = u8lastbyte & u8_bits.bit_2  (u8.scope43 & adv_bit4) 153 u16lo.bit_3 = u8lastbyte & u8_bits.bit_3  (u8.scope43 & adv_bit5) 154 u16lo.bit_4 = u8lastbyte & u8_bits.bit_4  (u8.scope43 & adv_bit6) 155 u16lo.bit_5 = u8lastbyte & u8_bits.bit_5  (u8.scope43 & adv_bit7) 156 u16lo.bit_6 = u8lastbyte & u8_bits.bit_6  (u8.scope43 & u8_bits.bit_2) 157 u16lo.bit_7 = u8lastbyte & u8_bits.bit_7  (u8.scope43 & u8_bits.bit_3) 125 158 else: 126 159 u8.scope42 = 0 127 160 u8.scope43 = 0 128 161 u8.scope44 = 0 129 u16hi [0]= u8.scope33 & advadv_bit4130 u16hi [1]= u8.scope33 & advadv_bit5131 u16hi [2]= u8.scope33 & advadv_bit6132 u16hi [3]= u8.scope33 & advadv_bit7133 u16hi [4]= u8.scope33 & adv_bit2134 u16hi [5]= u8lastscope & adv_bit3135 u16hi [6]= u8lastscope & adv_bit4136 u16hi [7]= u8lastscope & adv_bit5137 u16lo [2] = u8lastbyte & bit[2]138 u16lo [3] = u8lastbyte & bit[3]139 u16lo [4] = u8lastbyte & bit[4]140 u16lo [5] = u8lastbyte & bit[5]141 u16lo [6] = u8lastbyte & bit[6]142 u16lo [7] = u8lastbyte & bit[7]143 u16lo [1] = (u8.unibyte & bit[1])  (u8lastscope & adv_bit7)144 u16lo [0]= u8lastscope & adv_bit6162 u16hi.bit_0 = u8.scope33 & advadv_bit4 163 u16hi.bit_1 = u8.scope33 & advadv_bit5 164 u16hi.bit_2 = u8.scope33 & advadv_bit6 165 u16hi.bit_3 = u8.scope33 & advadv_bit7 166 u16hi.bit_4 = u8.scope33 & adv_bit2 167 u16hi.bit_5 = u8lastscope & adv_bit3 168 u16hi.bit_6 = u8lastscope & adv_bit4 169 u16hi.bit_7 = u8lastscope & adv_bit5 170 u16lo.bit_2 = u8lastbyte & u8_bits.bit_2 171 u16lo.bit_3 = u8lastbyte & u8_bits.bit_3 172 u16lo.bit_4 = u8lastbyte & u8_bits.bit_4 173 u16lo.bit_5 = u8lastbyte & u8_bits.bit_5 174 u16lo.bit_6 = u8lastbyte & u8_bits.bit_6 175 u16lo.bit_7 = u8lastbyte & u8_bits.bit_7 176 u16lo.bit_1 = (u8.unibyte & u8_bits.bit_1)  (u8lastscope & adv_bit7) 177 u16lo.bit_0 = u8lastscope & adv_bit6 145 178 else: 146 179 u8.scope32 = 0 … … 149 182 u8.scope43 = 0 150 183 u8.scope44 = 0 151 u16hi [0]= 0152 u16hi [1]= 0153 u16hi [2]= 0154 u16hi [3]= 0155 u16hi [4]= 0156 u16hi [5]= u8lastscope & adv_bit3157 u16hi [6]= u8lastscope & adv_bit4158 u16hi [7]= u8lastscope & adv_bit5159 u16lo [2] = u8lastbyte & bit[2]160 u16lo [3] = u8lastbyte & bit[3]161 u16lo [4] = u8lastbyte & bit[4]162 u16lo [5] = u8lastbyte & bit[5]163 u16lo [6] = u8lastbyte & bit[6]164 u16lo [7] = u8lastbyte & bit[7]165 u16lo [1] = (u8.unibyte & bit[1])  (u8lastscope & adv_bit7)166 u16lo [0]= u8lastscope & adv_bit6184 u16hi.bit_0 = 0 185 u16hi.bit_1 = 0 186 u16hi.bit_2 = 0 187 u16hi.bit_3 = 0 188 u16hi.bit_4 = 0 189 u16hi.bit_5 = u8lastscope & adv_bit3 190 u16hi.bit_6 = u8lastscope & adv_bit4 191 u16hi.bit_7 = u8lastscope & adv_bit5 192 u16lo.bit_2 = u8lastbyte & u8_bits.bit_2 193 u16lo.bit_3 = u8lastbyte & u8_bits.bit_3 194 u16lo.bit_4 = u8lastbyte & u8_bits.bit_4 195 u16lo.bit_5 = u8lastbyte & u8_bits.bit_5 196 u16lo.bit_6 = u8lastbyte & u8_bits.bit_6 197 u16lo.bit_7 = u8lastbyte & u8_bits.bit_7 198 u16lo.bit_1 = (u8.unibyte & u8_bits.bit_1)  (u8lastscope & adv_bit7) 199 u16lo.bit_0 = u8lastscope & adv_bit6 167 200 else: 168 201 u8.scope22 = 0 … … 172 205 u8.scope43 = 0 173 206 u8.scope44 = 0 174 u16hi [0]= 0175 u16hi [1]= 0176 u16hi [2]= 0177 u16hi [3]= 0178 u16hi [4]= 0179 u16hi [5]= 0180 u16hi [6]= 0181 u16hi [7]= 0182 u16lo [2] = bit[2]183 u16lo [3] = bit[3]184 u16lo [4] = bit[4]185 u16lo [5] = bit[5]186 u16lo [6] = bit[6]187 u16lo [7] = bit[7]188 u16lo [1] = bit[1]189 u16lo [0]= 0207 u16hi.bit_0 = 0 208 u16hi.bit_1 = 0 209 u16hi.bit_2 = 0 210 u16hi.bit_3 = 0 211 u16hi.bit_4 = 0 212 u16hi.bit_5 = 0 213 u16hi.bit_6 = 0 214 u16hi.bit_7 = 0 215 u16lo.bit_2 = u8_bits.bit_2 216 u16lo.bit_3 = u8_bits.bit_3 217 u16lo.bit_4 = u8_bits.bit_4 218 u16lo.bit_5 = u8_bits.bit_5 219 u16lo.bit_6 = u8_bits.bit_6 220 u16lo.bit_7 = u8_bits.bit_7 221 u16lo.bit_1 = u8_bits.bit_1 222 u16lo.bit_0 = 0 190 223 error_mask = u8anyscope ^ u8.suffix 191 224 u8.error = error_mask 192 225 226 def Main(u8_bits, u8, u16hi, u16lo): 227 Utf8_to_utf16(u8_bits, u8, u16hi, u16lo) 228
Note: See TracChangeset
for help on using the changeset viewer.