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

Luca Barbieri luca at luca-barbieri.com
Fri Aug 13 20:03:14 PDT 2010

> #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
> #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
> #else
> #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.

More information about the mesa-dev mailing list