cogl: Remove unnecessary compiler functions defines
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
This commit is contained in:
parent
7eadc948ae
commit
5fde5abd3e
6 changed files with 12 additions and 16 deletions
|
@ -285,7 +285,7 @@ _cogl_bitmask_popcount_in_array (const CoglBitmask *bitmask)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < array->len; 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;
|
return pop;
|
||||||
}
|
}
|
||||||
|
@ -307,10 +307,10 @@ _cogl_bitmask_popcount_upto_in_array (const CoglBitmask *bitmask,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < array_index; 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);
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,7 +281,7 @@ _cogl_bitmask_popcount (const CoglBitmask *bitmask)
|
||||||
{
|
{
|
||||||
return (_cogl_bitmask_has_array (bitmask) ?
|
return (_cogl_bitmask_has_array (bitmask) ?
|
||||||
_cogl_bitmask_popcount_in_array (bitmask) :
|
_cogl_bitmask_popcount_in_array (bitmask) :
|
||||||
_cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask)));
|
__builtin_popcountl (_cogl_bitmask_to_bits (bitmask)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -301,10 +301,10 @@ _cogl_bitmask_popcount_upto (const CoglBitmask *bitmask,
|
||||||
if (_cogl_bitmask_has_array (bitmask))
|
if (_cogl_bitmask_has_array (bitmask))
|
||||||
return _cogl_bitmask_popcount_upto_in_array (bitmask, upto);
|
return _cogl_bitmask_popcount_upto_in_array (bitmask, upto);
|
||||||
else if (upto >= (int) COGL_BITMASK_MAX_DIRECT_BITS)
|
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
|
else
|
||||||
return _cogl_util_popcountl (_cogl_bitmask_to_bits (bitmask) &
|
return __builtin_popcountl (_cogl_bitmask_to_bits (bitmask) &
|
||||||
((1UL << upto) - 1));
|
((1UL << upto) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -111,7 +111,7 @@ G_BEGIN_DECLS
|
||||||
\
|
\
|
||||||
while (_mask) \
|
while (_mask) \
|
||||||
{ \
|
{ \
|
||||||
int _next_bit = _cogl_util_ffsl (_mask); \
|
int _next_bit = __builtin_ffsl (_mask); \
|
||||||
(bit) += _next_bit; \
|
(bit) += _next_bit; \
|
||||||
/* This odd two-part shift is to avoid */ \
|
/* This odd two-part shift is to avoid */ \
|
||||||
/* shifting by sizeof (long)*8 which has */ \
|
/* shifting by sizeof (long)*8 which has */ \
|
||||||
|
|
|
@ -80,7 +80,3 @@ _cogl_util_one_at_a_time_mix (unsigned int hash)
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _cogl_util_ffsl __builtin_ffsl
|
|
||||||
|
|
||||||
#define _cogl_util_popcountl __builtin_popcountl
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ _cogl_pipeline_progend_glsl_flush_uniforms (CoglPipeline *pipeline,
|
||||||
|
|
||||||
for (i = 0; i < n_uniform_longs; i++)
|
for (i = 0; i < n_uniform_longs; i++)
|
||||||
data.n_differences +=
|
data.n_differences +=
|
||||||
_cogl_util_popcountl (data.uniform_differences[i]);
|
__builtin_popcountl (data.uniform_differences[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pipeline && data.n_differences > 0)
|
while (pipeline && data.n_differences > 0)
|
||||||
|
|
|
@ -1067,9 +1067,9 @@ try_create_glx_pixmap (CoglContext *context,
|
||||||
* number of 1-bits in color masks against the color depth requested
|
* number of 1-bits in color masks against the color depth requested
|
||||||
* by the client.
|
* by the client.
|
||||||
*/
|
*/
|
||||||
if (_cogl_util_popcountl (visual->red_mask |
|
if (__builtin_popcountl (visual->red_mask |
|
||||||
visual->green_mask |
|
visual->green_mask |
|
||||||
visual->blue_mask) == depth)
|
visual->blue_mask) == depth)
|
||||||
attribs[i++] = GLX_TEXTURE_FORMAT_RGB_EXT;
|
attribs[i++] = GLX_TEXTURE_FORMAT_RGB_EXT;
|
||||||
else
|
else
|
||||||
attribs[i++] = GLX_TEXTURE_FORMAT_RGBA_EXT;
|
attribs[i++] = GLX_TEXTURE_FORMAT_RGBA_EXT;
|
||||||
|
|
Loading…
Reference in a new issue