summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-25 11:49:51 -0600
committerKarl Williamson <khw@cpan.org>2021-08-07 05:14:43 -0600
commit787e83840f698af38f64833c284e0e30865698c0 (patch)
treefc905253105029d04bcdf8ee3c21b8ccf76258bb /inline.h
parent7bf011a13027d25777e5d934629cb489812d20c9 (diff)
downloadperl-787e83840f698af38f64833c284e0e30865698c0.tar.gz
Reimplement OFFUNISKIP
Now that previous commits have made it fast to find the position of the first set bit in a word, we can use a forumla to find how many bytes the UTF-8 of that will occupy. This allows for simplification of this macro, removing several conditionals
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/inline.h b/inline.h
index c57cb031d2..e70b7e5e35 100644
--- a/inline.h
+++ b/inline.h
@@ -939,6 +939,14 @@ Perl_msbit_pos32(U32 word)
}
+#if UVSIZE == U64SIZE
+# define msbit_pos(word) msbit_pos64(word)
+# define lsbit_pos(word) lsbit_pos64(word)
+#elif UVSIZE == U32SIZE
+# define msbit_pos(word) msbit_pos32(word)
+# define lsbit_pos(word) lsbit_pos32(word)
+#endif
+
#ifdef U64TYPE /* HAS_QUAD not usable outside the core */
PERL_STATIC_INLINE unsigned