[Mesa-dev] [PATCH 1/2] Add Alpha to the little-endian machines.

Julien Cristau jcristau at debian.org
Fri May 6 14:17:07 PDT 2011


On Fri, May  6, 2011 at 13:01:14 -0400, Matt Turner wrote:

> From: Jay Estabrook <jay.estabrook at gmail.com>
> 
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> Signed-off-by: Jay Estabrook <jay.estabrook at gmail.com>
> ---
>  src/gallium/include/pipe/p_config.h |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
> index 74a1fa2..9e8ff6a 100644
> --- a/src/gallium/include/pipe/p_config.h
> +++ b/src/gallium/include/pipe/p_config.h
> @@ -99,6 +99,10 @@
>  #endif
>  #endif
>  
> +#if defined(__alpha__)
> +#define PIPE_ARCH_ALPHA
> +#endif
> +
>  #if defined(__PPC__)
>  #define PIPE_ARCH_PPC
>  #if defined(__PPC64__)
> @@ -111,7 +115,7 @@
>   * Endian detection.
>   */
>  
> -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
> +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ALPHA)
>  #define PIPE_ARCH_LITTLE_ENDIAN
>  #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
>  #define PIPE_ARCH_BIG_ENDIAN

Is there any particular reason this can't do the following, at least on
glibc platforms?

#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
# define PIPE_ARCH_LITTLE_ENDIAN
#elif __BYTE_ORDER == __BIG_ENDIAN
# define PIPE_ARCH_BIG_ENDIAN
#endif

Instead of having an always incomplete hardcoded list as "detection"...

Cheers,
Julien


More information about the mesa-dev mailing list