Christoph Bumiller <[email protected]> writes:
> Hi. Now that there's util_bitcount in u_math, I'd like to have a
> bswap helper as well,
> I need to swap the stipple pattern on nv50. Any objections ?
[snip]
>  src/gallium/auxiliary/util/u_math.h |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
[snip]
> + * Reverse byte order of a 32 bit word.
> + */
> +static INLINE uint32_t
> +util_bswap32(uint32_t n)
> +{
> +#if defined(PIPE_CC_GCC)
> +   return __builtin_bswap32(n);
> +#else
> +   return (n >> 24) |
> +          ((n >> 8) & 0x0000ff00) |
> +          ((n << 8) & 0x00ff0000) |
> +          (n << 24);

Is there a reason you can't just use CPU_TO_LE32 from
src/mesa/main/compiler.h?

Of course, 1) that's only if you need your data in little endian
format, and 2) it's based on a compile-time test, w/ a big warning
about that at the definition.  So you might prefer to avoid using it
directly.  If nothing else though, it'd be good if bswap32 was defined
once and utilized in both places.

-tom

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to