summaryrefslogtreecommitdiff
path: root/regcharclass.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-09-05 15:00:52 -0600
committerKarl Williamson <public@khwilliamson.com>2012-09-13 21:14:04 -0600
commitf5772832202b347008e4fec0abfe1113ffd79de8 (patch)
tree86b34e75fd0b0b8607209becd3e172535d277e74 /regcharclass.h
parent30188af71480bee44fe725708944a74f91763cf2 (diff)
downloadperl-f5772832202b347008e4fec0abfe1113ffd79de8.tar.gz
regen/regcharclass.pl: Extend previously added optimization
A previous commit added an optimization to save a branch in the generated code at the expense of an extra mask when the input class has certain characteristics. This extends that to the case where sub-portions of the class have similar characteristics. The first optimization for the entire class is moved to right before the new loop that checks each range in it.
Diffstat (limited to 'regcharclass.h')
-rw-r--r--regcharclass.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/regcharclass.h b/regcharclass.h
index 27ed2e8b5d..59b2fdfcaa 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -370,7 +370,7 @@
( ( 0x80 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x9D ) ? \
( ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ? 3 : 0 ) \
: ( 0x9E == ((U8*)s)[1] ) ? \
- ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA3 ) || ( 0xB0 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBF ) ) ? 3 : 0 )\
+ ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA3 ) || ( ((U8*)s)[2] & 0xF0 ) == 0xB0 ) ? 3 : 0 )\
: ( 0x9F == ((U8*)s)[1] ) ? \
( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x86 ) ? 3 : 0 ) \
: 0 ) \
@@ -414,7 +414,7 @@
( ( 0x80 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x9D ) ? \
( ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ? 3 : 0 ) \
: ( 0x9E == ((U8*)s)[1] ) ? \
- ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA3 ) || ( 0xB0 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBF ) ) ? 3 : 0 )\
+ ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA3 ) || ( ((U8*)s)[2] & 0xF0 ) == 0xB0 ) ? 3 : 0 )\
: ( 0x9F == ((U8*)s)[1] ) ? \
( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x86 ) || ( 0x8B <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBB ) ) ? 3 : 0 )\
: 0 ) \
@@ -496,12 +496,12 @@
( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xB5 ) ? 3 : 0 ) \
: ( 0x9E == ((U8*)s)[1] ) ? \
( ( 0x94 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBF ) ? 3 : 0 ) \
- : ( ( 0x9F <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xAF ) || 0xB8 == ((U8*)s)[1] || 0xB9 == ((U8*)s)[1] ) ?\
+ : ( ( 0x9F <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xAF ) || ( ((U8*)s)[1] & 0xFE ) == 0xB8 ) ?\
( ( ( ((U8*)s)[2] & 0xC0 ) == 0x80 ) ? 3 : 0 ) \
: 0 ) \
: ( 0xE3 == ((U8*)s)[0] ) ? \
( ( 0x80 == ((U8*)s)[1] ) ? \
- ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x83 ) || ( 0x88 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA0 ) || 0xB0 == ((U8*)s)[2] ) ? 3 : 0 )\
+ ( ( ( ((U8*)s)[2] & 0xFC ) == 0x80 || ( 0x88 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA0 ) || 0xB0 == ((U8*)s)[2] ) ? 3 : 0 )\
: ( 0x85 == ((U8*)s)[1] ) ? \
( ( 0xA4 == ((U8*)s)[2] ) ? 3 : 0 ) \
: 0 ) \