1
0
Fork 0

cogl: Remove unnecessary compiler functions defines

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
This commit is contained in:
Bilal Elmoussaoui 2024-07-26 22:41:46 +02:00 committed by Marge Bot
parent 7eadc948ae
commit 5fde5abd3e
6 changed files with 12 additions and 16 deletions

View file

@ -285,7 +285,7 @@ _cogl_bitmask_popcount_in_array (const CoglBitmask *bitmask)
int i;
for (i = 0; i < array->len; i++)
pop += _cogl_util_popcountl (g_array_index (array, unsigned long, i));
pop += __builtin_popcountl (g_array_index (array, unsigned long, i));
return pop;
}
@ -307,10 +307,10 @@ _cogl_bitmask_popcount_upto_in_array (const CoglBitmask *bitmask,
int i;
for (i = 0; i < array_index; i++)
pop += _cogl_util_popcountl (g_array_index (array, unsigned long, i));
pop += __builtin_popcountl (g_array_index (array, unsigned long, i));
top_mask = g_array_index (array, unsigned long, array_index);
return pop + _cogl_util_popcountl (top_mask & ((1UL << bit_index) - 1));
return pop + __builtin_popcountl (top_mask & ((1UL << bit_index) - 1));
}
}

View file

@ -281,7 +281,7 @@ _cogl_bitmask_popcount (const CoglBitmask *bitmask)
{
return (_cogl_bitmask_has_array (bitmask) ?
_cogl_bitmask_popcount_in_array (bitmask) :
_cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask)));
__builtin_popcountl (_cogl_bitmask_to_bits (bitmask)));
}
/*
@ -301,9 +301,9 @@ _cogl_bitmask_popcount_upto (const CoglBitmask *bitmask,
if (_cogl_bitmask_has_array (bitmask))
return _cogl_bitmask_popcount_upto_in_array (bitmask, upto);
else if (upto >= (int) COGL_BITMASK_MAX_DIRECT_BITS)
return _cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask));
return __builtin_popcountl (_cogl_bitmask_to_bits (bitmask));
else
return _cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask) &
return __builtin_popcountl (_cogl_bitmask_to_bits (bitmask) &
((1UL << upto) - 1));
}

View file

@ -111,7 +111,7 @@ G_BEGIN_DECLS
\
while (_mask) \
{ \
int _next_bit = _cogl_util_ffsl (_mask); \
int _next_bit = __builtin_ffsl (_mask); \
(bit) += _next_bit; \
/* This odd two-part shift is to avoid */ \
/* shifting by sizeof (long)*8 which has */ \

View file

@ -80,7 +80,3 @@ _cogl_util_one_at_a_time_mix (unsigned int hash)
return hash;
}
#define _cogl_util_ffsl __builtin_ffsl
#define _cogl_util_popcountl __builtin_popcountl

View file

@ -621,7 +621,7 @@ _cogl_pipeline_progend_glsl_flush_uniforms (CoglPipeline *pipeline,
for (i = 0; i < n_uniform_longs; i++)
data.n_differences +=
_cogl_util_popcountl (data.uniform_differences[i]);
__builtin_popcountl (data.uniform_differences[i]);
}
while (pipeline && data.n_differences > 0)

View file

@ -1067,7 +1067,7 @@ try_create_glx_pixmap (CoglContext *context,
* number of 1-bits in color masks against the color depth requested
* by the client.
*/
if (_cogl_util_popcountl (visual->red_mask |
if (__builtin_popcountl (visual->red_mask |
visual->green_mask |
visual->blue_mask) == depth)
attribs[i++] = GLX_TEXTURE_FORMAT_RGB_EXT;