[Mesa-dev] [PATCH 1/3] u_cpu_detect: make arch and little_endian constants, add abi and x86-64

Corbin Simpson mostawesomedude at gmail.com
Fri Aug 13 23:34:57 PDT 2010


On Fri, Aug 13, 2010 at 8:03 PM, Luca Barbieri <luca at luca-barbieri.com> wrote:
>> #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
>> #define PIPE_ARCH_LITTLE_ENDIAN
>> #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
>> #define PIPE_ARCH_BIG_ENDIAN
>> #else
>> #define PIPE_ARCH_UNKNOWN_ENDIAN
>> #endif
>
> Note that this isn't really correct: there endianness must be known by
> the compiler, since it must choose a way to represent global
> initialized 16/32-bit integer variables, among others.
>
> Also, at least some PowerPCs can be configured as little endian (even
> though it is unusual to do so).
>
> Usually the compiler sets the macro WORDS_BIGENDIAN to indicate
> big-endian targets, and this is the one that should be tested.

Feel free to fix it; I introduced those as a base for some r300g
PPC-specific fixes, and have never owned the relevant hardware.

~ C.

-- 
When the facts change, I change my mind. What do you do, sir? ~ Keynes

Corbin Simpson
<MostAwesomeDude at gmail.com>


More information about the mesa-dev mailing list