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 | |
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')
-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 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_fragprog.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_vbo.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe_common.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_clear.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 6 |
10 files changed, 17 insertions, 17 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; diff --git a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c index 073b2a34670..3692d4a665c 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c @@ -41,7 +41,7 @@ nv30_fragprog_upload(struct nv30_context *nv30) if (unlikely(!fp->buffer)) fp->buffer = pipe_buffer_create(pipe->screen, 0, 0, fp->insn_len * 4); -#ifndef PIPE_ARCH_BIG_ENDIAN +#if !PIPE_ARCH_BIG_ENDIAN pipe_buffer_write(pipe, fp->buffer, 0, fp->insn_len * 4, fp->insn); #else { diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c index bb0a8a0b1d5..595db095d91 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c @@ -192,7 +192,7 @@ nv30_vbo_validate(struct nv30_context *nv30) if (!nv30->vertex || nv30->draw_flags) return; -#ifdef PIPE_ARCH_BIG_ENDIAN +#if PIPE_ARCH_BIG_ENDIAN if (1) { /* Figure out where the buffers are getting messed up */ #else if (unlikely(vertex->need_conversion)) { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 437df48826a..7ac65019467 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1157,7 +1157,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->rs_draw.offset_tri = 0; rs->rs_draw.offset_clamp = 0; -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN vap_control_status = R300_VC_NO_SWAP; #else vap_control_status = R300_VC_32BIT_SWAP; diff --git a/src/gallium/drivers/r600/r600_pipe_common.h b/src/gallium/drivers/r600/r600_pipe_common.h index 1ae0493db2c..1fbfeb7971a 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.h +++ b/src/gallium/drivers/r600/r600_pipe_common.h @@ -118,7 +118,7 @@ enum r600_coherency { R600_COHERENCY_CB_META, }; -#ifdef PIPE_ARCH_BIG_ENDIAN +#if PIPE_ARCH_BIG_ENDIAN #define R600_BIG_ENDIAN 1 #else #define R600_BIG_ENDIAN 0 diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 4b9b15bc0cd..48fdb5bca37 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -1771,7 +1771,7 @@ void evergreen_do_fast_color_clear(struct r600_common_context *rctx, int i; /* This function is broken in BE, so just disable this path for now */ -#ifdef PIPE_ARCH_BIG_ENDIAN +#if PIPE_ARCH_BIG_ENDIAN return; #endif diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index 68a0eeb36b4..18729470456 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -400,7 +400,7 @@ static void si_do_fast_color_clear(struct si_context *sctx, int i; /* This function is broken in BE, so just disable this path for now */ -#ifdef PIPE_ARCH_BIG_ENDIAN +#if PIPE_ARCH_BIG_ENDIAN return; #endif diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 62183834416..2606052f378 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -32,7 +32,7 @@ #include "util/u_idalloc.h" #include "util/u_threaded_context.h" -#ifdef PIPE_ARCH_BIG_ENDIAN +#if PIPE_ARCH_BIG_ENDIAN #define SI_BIG_ENDIAN 1 #else #define SI_BIG_ENDIAN 0 @@ -760,7 +760,7 @@ struct si_shader_ctx_state { */ union si_vgt_param_key { struct { -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN unsigned prim:4; unsigned uses_instancing:1; unsigned multi_instances_smaller_than_primgroup:1; @@ -795,7 +795,7 @@ union si_vgt_param_key { */ union si_vgt_stages_key { struct { -#ifdef PIPE_ARCH_LITTLE_ENDIAN +#if PIPE_ARCH_LITTLE_ENDIAN unsigned tess:1; unsigned gs:1; unsigned ngg:1; /* gfx10+ */ |