From f5e67202cca94fece9970711e1d28c0b95af9469 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 10 Jun 2020 14:21:25 +0200 Subject: [PATCH] dwrite: Use BitScanForward instead of dwrite_ctz. Signed-off-by: Jacek Caban Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/opentype.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index a6e2663ab16..e30cc4abe1b 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -3518,23 +3518,6 @@ static inline unsigned int dwrite_popcount(unsigned int x) #endif } -static inline unsigned int dwrite_ctz(unsigned int x) -{ -#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) - return __builtin_ctz(x); -#else - unsigned int c = 32; - x &= - (int) x; - if (x) c--; - if (x & 0x0000ffff) c -= 16; - if (x & 0x00ff00ff) c -= 8; - if (x & 0x0f0f0f0f) c -= 4; - if (x & 0x33333333) c -= 2; - if (x & 0x55555555) c -= 1; - return c; -#endif -} - static inline unsigned int dwrite_log2i(unsigned int x) { #if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) @@ -5084,7 +5067,7 @@ static BOOL opentype_layout_apply_gsub_alt_substitution(struct scriptshaping_con if (!count) return FALSE; - shift = dwrite_ctz(lookup->mask); + BitScanForward(&shift, lookup->mask); alt_index = (lookup->mask & context->glyph_infos[idx].mask) >> shift; if (alt_index > count || !alt_index)