diff options
author | Dylan Baker <[email protected]> | 2018-09-06 15:13:22 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-11-05 16:39:55 +0000 |
commit | f9f60da813e69aacf541d25a24622c896f15ba98 (patch) | |
tree | ce1ba60e57b85a9ea16cfe12efcf3e1ab994d596 /src/gallium/drivers/llvmpipe | |
parent | 37e54736a7bab3397e316ae4493c2e3d4aebfa5e (diff) |
util/u_endian: set PIPE_ARCH_*_ENDIAN to 1
This will allow it to be used as a drop in replacement for
_mesa_little_endian in a number of cases.
v2: - Always define PIPE_ARCH_LITTLE_ENDIAN and PIPE_ARCH_BIG_ENDIAN,
define the one that reflects the host system to 1 and the other to 0
- replace all uses of #ifdef, #ifndef, and #if defined() with #if
and #if ! with PIPE_ARCH_*_ENDIAN
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast_tri.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_tri.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_fs.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index f4a2f0268f0..f50afabf723 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -436,7 +436,7 @@ lp_rast_triangle_32_3_4(struct lp_rasterizer_task *task, #else -#if defined(_ARCH_PWR8) && defined(PIPE_ARCH_LITTLE_ENDIAN) +#if defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN #include <altivec.h> #include "util/u_pwr8.h" @@ -556,7 +556,7 @@ lp_rast_triangle_32_3_16(struct lp_rasterizer_task *task, __m128i vshuf_mask1; __m128i vshuf_mask2; -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN vshuf_mask0 = (__m128i) vec_splats((unsigned int) 0x03020100); vshuf_mask1 = (__m128i) vec_splats((unsigned int) 0x07060504); vshuf_mask2 = (__m128i) vec_splats((unsigned int) 0x0B0A0908); @@ -687,7 +687,7 @@ lp_rast_triangle_32_3_4(struct lp_rasterizer_task *task, #if defined PIPE_ARCH_SSE #define BUILD_MASKS(c, cdiff, dcdx, dcdy, omask, pmask) build_masks_sse((int)c, (int)cdiff, dcdx, dcdy, omask, pmask) #define BUILD_MASK_LINEAR(c, dcdx, dcdy) build_mask_linear_sse((int)c, dcdx, dcdy) -#elif (defined(_ARCH_PWR8) && defined(PIPE_ARCH_LITTLE_ENDIAN)) +#elif (defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN) #define BUILD_MASKS(c, cdiff, dcdx, dcdy, omask, pmask) build_masks_ppc((int)c, (int)cdiff, dcdx, dcdy, omask, pmask) #define BUILD_MASK_LINEAR(c, dcdx, dcdy) build_mask_linear_ppc((int)c, dcdx, dcdy) #else diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index 0fa3443d519..18771cb05ba 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -46,7 +46,7 @@ #if defined(PIPE_ARCH_SSE) #include <emmintrin.h> -#elif defined(_ARCH_PWR8) && defined(PIPE_ARCH_LITTLE_ENDIAN) +#elif defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN #include <altivec.h> #include "util/u_pwr8.h" #endif @@ -489,7 +489,7 @@ do_triangle_ccw(struct lp_setup_context *setup, eo = _mm_shuffle_epi32(eo, _MM_SHUFFLE(0,0,0,2)); plane[2].eo = (uint32_t)_mm_cvtsi128_si32(eo); } else -#elif defined(_ARCH_PWR8) && defined(PIPE_ARCH_LITTLE_ENDIAN) +#elif defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN /* * XXX this code is effectively disabled for all practical purposes, * as the allowed fb size is tiny if FIXED_ORDER is 8. @@ -513,7 +513,7 @@ do_triangle_ccw(struct lp_setup_context *setup, __m128i zero = vec_splats((unsigned char) 0); PIPE_ALIGN_VAR(16) int32_t temp_vec[4]; -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN vshuf_mask.i[0] = 0x07060504; vshuf_mask.i[1] = 0x0B0A0908; vshuf_mask.i[2] = 0x03020100; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 20d46f8af90..7a19d4eddab 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -1399,7 +1399,7 @@ convert_to_blend_type(struct gallivm_state *gallivm, for (j = 0; j < src_fmt->nr_channels; ++j) { unsigned mask = 0; unsigned sa = src_fmt->channel[j].shift; -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN unsigned from_lsb = j; #else unsigned from_lsb = src_fmt->nr_channels - j - 1; @@ -1581,7 +1581,7 @@ convert_from_blend_type(struct gallivm_state *gallivm, for (j = 0; j < src_fmt->nr_channels; ++j) { unsigned mask = 0; unsigned sa = src_fmt->channel[j].shift; -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN unsigned from_lsb = j; #else unsigned from_lsb = src_fmt->nr_channels - j - 1; |