Changeset 366 for proto/u16u8/u16u8_compilable2.py
 Timestamp:
 Feb 24, 2010, 4:35:15 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

proto/u16u8/u16u8_compilable2.py
r359 r366 29 29 30 30 def main(u16h, u16l, mask, u16): 31 31 #optimize(above_0x7FF,allzero) 32 #optimize(above_0x7F,allzero) 33 above_0x7FF = ((u16h[0]  u16h[1])  (u16h[2]  u16h[3]))  u16h[4] 34 above_0x7F = ((above_0x7FF  u16h[5])  (u16h[6]  u16h[7]))  u16l[0] 35 32 36 # Surrogate pairs have 0xD8 through 0xDF as the high UTF16 byte: 11011xxx pattern 33 37 u16.surrogate = (u16h[0] & u16h[1]) & (u16h[3] &~ u16h[2]) & u16h[4] … … 36 40 u16.lsurrogate = u16.surrogate & u16h[5] 37 41 # If any of the high 5 bits are set, we are above the 07FF range 38 above_0x7FF = ((u16h[0]  u16h[1])  (u16h[2]  u16h[3]))  u16h[4]39 above_0x7F = ((above_0x7FF  u16h[5])  (u16h[6]  u16h[7]))  u16l[0]40 42 u16.utf8_3 = above_0x7FF &~ u16.surrogate 41 43 u16.utf8_2 = above_0x7F & ~above_0x7FF 42 u16.ASCII = ~above_0x7F & mask44 u16.ASCII = ~above_0x7F 43 45 u16.error = bitutil.Advance(u16.hsurrogate) ^ u16.lsurrogate 44 46
Note: See TracChangeset
for help on using the changeset viewer.