As requested by Tim.
This was generated with:
grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g
v2: - add this patch
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
//
#include "util/u_endian.h"
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
#define LITTLEENDIAN_CPU
-#elif PIPE_ARCH_BIG_ENDIAN
+#elif UTIL_ARCH_BIG_ENDIAN
#define BIGENDIAN_CPU
#endif
//
#include "util/u_endian.h"
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
#define LITTLEENDIAN_CPU
-#elif PIPE_ARCH_BIG_ENDIAN
+#elif UTIL_ARCH_BIG_ENDIAN
#define BIGENDIAN_CPU
#endif
//
#include "util/u_endian.h"
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
#define LITTLEENDIAN_CPU
-#elif PIPE_ARCH_BIG_ENDIAN
+#elif UTIL_ARCH_BIG_ENDIAN
#define BIGENDIAN_CPU
#endif
if format.nr_channels() <= 1:
func(format.le_channels, format.le_swizzles)
else:
- print('#if PIPE_ARCH_BIG_ENDIAN')
+ print('#if UTIL_ARCH_BIG_ENDIAN')
func(format.be_channels, format.be_swizzles)
print('#else')
func(format.le_channels, format.le_swizzles)
if format.nr_channels() <= 1:
func(format.le_channels, format.le_swizzles)
else:
- print('#if PIPE_ARCH_BIG_ENDIAN')
+ print('#if UTIL_ARCH_BIG_ENDIAN')
func(format.be_channels, format.be_swizzles)
print('#else')
func(format.le_channels, format.le_swizzles)
adjust_mask(struct gallivm_state *gallivm,
LLVMValueRef mask)
{
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef vertex_id;
LLVMValueRef clipmask;
/* Decode the input vector components */
for (chan = 0; chan < 4; ++chan) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned start = chan*8;
#else
unsigned start = (3-chan)*8;
unsigned blockbits = type.width;
unsigned vec_nr;
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
vec_nr = (format_desc->block.bits - (chan_desc.shift + chan_desc.size)) / type.width;
#else
vec_nr = chan_desc.shift / type.width;
#endif
{
LLVMValueRef shift;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
shift = LLVMBuildMul(builder, i, lp_build_const_int_vec(gallivm, type, 16), "");
shift = LLVMBuildAdd(builder, shift, lp_build_const_int_vec(gallivm, type, 8), "");
#else
*y = LLVMBuildLShr(builder, packed, shift, "");
}
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
*u = packed;
*v = LLVMBuildLShr(builder, packed, lp_build_const_int_vec(gallivm, type, 16), "");
#else
#endif
{
LLVMValueRef shift;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
shift = LLVMBuildMul(builder, i, lp_build_const_int_vec(gallivm, type, 16), "");
#else
shift = LLVMBuildMul(builder, i, lp_build_const_int_vec(gallivm, type, -16), "");
*y = LLVMBuildLShr(builder, packed, shift, "");
}
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
*u = LLVMBuildLShr(builder, packed, lp_build_const_int_vec(gallivm, type, 8), "");
*v = LLVMBuildLShr(builder, packed, lp_build_const_int_vec(gallivm, type, 24), "");
#else
* Make a 4 x unorm8 vector
*/
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
r = r;
g = LLVMBuildShl(builder, g, lp_build_const_int_vec(gallivm, type, 8), "");
b = LLVMBuildShl(builder, b, lp_build_const_int_vec(gallivm, type, 16), "");
if (src_width < dst_width) {
res = LLVMBuildZExt(gallivm->builder, res, dst_elem_type, "");
if (vector_justify) {
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
res = LLVMBuildShl(gallivm->builder, res,
LLVMConstInt(dst_elem_type, dst_width - src_width, 0), "");
#endif
*/
res = LLVMBuildZExt(gallivm->builder, res, dst_elem_type, "");
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
if (vector_justify) {
res = LLVMBuildShl(gallivm->builder, res,
LLVMConstInt(dst_elem_type,
if (vec_zext) {
res = LLVMBuildZExt(gallivm->builder, res, res_t, "");
if (vector_justify) {
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
unsigned sv = dst_type.width - src_width;
res = LLVMBuildShl(gallivm->builder, res,
lp_build_const_int_vec(gallivm, res_type, sv), "");
const unsigned pointer_size = 8 * sizeof(void *);
char layout[512];
snprintf(layout, sizeof layout, "%c-p:%u:%u:%u-i64:64:64-a0:0:%u-s0:%u:%u",
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
'e', // little endian
#else
'E', // big endian
* when not using MCJIT so no instructions are generated which the old JIT
* can't handle. Not entirely sure if we really need to do anything yet.
*/
-#if PIPE_ARCH_LITTLE_ENDIAN && defined(PIPE_ARCH_PPC_64)
+#if UTIL_ARCH_LITTLE_ENDIAN && defined(PIPE_ARCH_PPC_64)
/*
* Versions of LLVM prior to 4.0 lacked a table entry for "POWER8NVL",
* resulting in (big-endian) "generic" being returned on
assert(n <= LP_MAX_VECTOR_LENGTH);
for(i = 0; i < n; ++i)
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
elems[i] = lp_build_const_int32(gallivm, 2*i);
#else
elems[i] = lp_build_const_int32(gallivm, 2*i+1);
msb = lp_build_zero(gallivm, src_type);
/* Interleave bits */
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
*dst_lo = lp_build_interleave2(gallivm, src_type, src, msb, 0);
*dst_hi = lp_build_interleave2(gallivm, src_type, src, msb, 1);
msb = lp_build_zero(gallivm, src_type);
/* Interleave bits */
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
if (src_type.length * src_type.width == 256 && util_cpu_caps.has_avx2) {
*dst_lo = lp_build_interleave2_half(gallivm, src_type, src, msb, 0);
*dst_hi = lp_build_interleave2_half(gallivm, src_type, src, msb, 1);
} else {
intrinsic = "llvm.ppc.altivec.vpkuwus";
}
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
swap_intrinsic_operands = TRUE;
#endif
}
intrinsic = "llvm.x86.sse2.packsswb.128";
} else if (util_cpu_caps.has_altivec) {
intrinsic = "llvm.ppc.altivec.vpkshss";
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
swap_intrinsic_operands = TRUE;
#endif
}
intrinsic = "llvm.x86.sse2.packuswb.128";
} else if (util_cpu_caps.has_altivec) {
intrinsic = "llvm.ppc.altivec.vpkshus";
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
swap_intrinsic_operands = TRUE;
#endif
}
r_fpart = LLVMBuildBitCast(builder, r_fpart, u8n_vec_type, "");
for (j = 0; j < u8n.type.length; j += 4) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned subindex = 0;
#else
unsigned subindex = 3;
* XX XX XX XX if shift right (shift == -1)
*
*/
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
shift = channel == 0 ? 1 : -1;
#else
shift = channel == 0 ? -1 : 1;
int shift = shifts[channel][i];
/* See endianness diagram above */
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
shift = -shift;
#endif
for (chan = 0; chan < 4; ++chan) {
if (swizzles[chan] < 4) {
/* We need to move channel swizzles[chan] into channel chan */
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
if (swizzles[chan] - chan == -shift) {
mask |= ((1ULL << type.width) - 1) << (swizzles[chan] * type.width);
}
format.le_swizzles == format.be_swizzles):
func(format.le_channels, format.le_swizzles)
else:
- print('#if PIPE_ARCH_BIG_ENDIAN')
+ print('#if UTIL_ARCH_BIG_ENDIAN')
func(format.be_channels, format.be_swizzles)
print('#else')
func(format.le_channels, format.le_swizzles)
#ifndef U_PWR8_H_
#define U_PWR8_H_
-#if defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN
+#if defined(_ARCH_PWR8) && UTIL_ARCH_LITTLE_ENDIAN
#define VECTOR_ALIGN_16 __attribute__ ((__aligned__ (16)))
{
__m128i_union vdst;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
vdst.i[0] = i0;
vdst.i[1] = i1;
vdst.i[2] = i2;
vec_unpacklo_epi32 (__m128i even, __m128i odd)
{
static const __m128i perm_mask =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{ 0, 1, 2, 3, 16, 17, 18, 19, 4, 5, 6, 7, 20, 21, 22, 23};
#else
{24, 25, 26, 27, 8, 9, 10, 11, 28, 29, 30, 31, 12, 13, 14, 15};
vec_unpackhi_epi32 (__m128i even, __m128i odd)
{
static const __m128i perm_mask =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{ 8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31};
#else
{16, 17, 18, 19, 0, 1, 2, 3, 20, 21, 22, 23, 4, 5, 6, 7};
vec_unpacklo_epi64 (__m128i even, __m128i odd)
{
static const __m128i perm_mask =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{ 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23};
#else
{24, 25, 26, 27, 28, 29, 30, 31, 8, 9, 10, 11, 12, 13, 14, 15};
vec_unpackhi_epi64 (__m128i even, __m128i odd)
{
static const __m128i perm_mask =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{ 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31};
#else
{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7};
{
__m128i_union vsrc;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
vsrc.m128ui = *((vector unsigned int *) src);
vtemp.m128i = vec_vgbbd(vsrc);
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
result = vtemp.ub[15] << 8 | vtemp.ub[7];
#else
result = vtemp.ub[0] << 8 | vtemp.ub[8];
static inline __m128i
vec_packs_epi16 (__m128i a, __m128i b)
{
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
return (__m128i) vec_packs ((vector signed short) a,
(vector signed short) b);
#else
static inline __m128i
vec_packs_epi32 (__m128i a, __m128i b)
{
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
return (__m128i) vec_packs ((vector signed int) a, (vector signed int) b);
#else
return (__m128i) vec_packs ((vector signed int) b, (vector signed int) a);
#endif
}
-#endif /* _ARCH_PWR8 && PIPE_ARCH_LITTLE_ENDIAN */
+#endif /* _ARCH_PWR8 && UTIL_ARCH_LITTLE_ENDIAN */
#endif /* U_PWR8_H_ */
/* enough bytes in buffer, read in a whole dword */
uint64_t value = *(const uint32_t*)vlc->data;
-#if !PIPE_ARCH_BIG_ENDIAN
+#if !UTIL_ARCH_BIG_ENDIAN
value = util_bswap32(value);
#endif
#else
-#if defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN
+#if defined(_ARCH_PWR8) && UTIL_ARCH_LITTLE_ENDIAN
#include <altivec.h>
#include "util/u_pwr8.h"
__m128i vshuf_mask1;
__m128i vshuf_mask2;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_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);
lp_rast_triangle_32_3(task, arg2);
}
-#endif /* _ARCH_PWR8 && PIPE_ARCH_LITTLE_ENDIAN */
+#endif /* _ARCH_PWR8 && UTIL_ARCH_LITTLE_ENDIAN */
void
lp_rast_triangle_32_4_16(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) && PIPE_ARCH_LITTLE_ENDIAN)
+#elif (defined(_ARCH_PWR8) && UTIL_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
#if defined(PIPE_ARCH_SSE)
#include <emmintrin.h>
-#elif defined(_ARCH_PWR8) && PIPE_ARCH_LITTLE_ENDIAN
+#elif defined(_ARCH_PWR8) && UTIL_ARCH_LITTLE_ENDIAN
#include <altivec.h>
#include "util/u_pwr8.h"
#endif
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) && PIPE_ARCH_LITTLE_ENDIAN
+#elif defined(_ARCH_PWR8) && UTIL_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.
__m128i zero = vec_splats((unsigned char) 0);
PIPE_ALIGN_VAR(16) int32_t temp_vec[4];
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
vshuf_mask.i[0] = 0x07060504;
vshuf_mask.i[1] = 0x0B0A0908;
vshuf_mask.i[2] = 0x03020100;
for (j = 0; j < src_fmt->nr_channels; ++j) {
unsigned mask = 0;
unsigned sa = src_fmt->channel[j].shift;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned from_lsb = j;
#else
unsigned from_lsb = src_fmt->nr_channels - j - 1;
for (j = 0; j < src_fmt->nr_channels; ++j) {
unsigned mask = 0;
unsigned sa = src_fmt->channel[j].shift;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned from_lsb = j;
#else
unsigned from_lsb = src_fmt->nr_channels - j - 1;
if (unlikely(!fp->buffer))
fp->buffer = pipe_buffer_create(pipe->screen, 0, 0, fp->insn_len * 4);
-#if !PIPE_ARCH_BIG_ENDIAN
+#if !UTIL_ARCH_BIG_ENDIAN
pipe_buffer_write(pipe, fp->buffer, 0, fp->insn_len * 4, fp->insn);
#else
{
if (!nv30->vertex || nv30->draw_flags)
return;
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
if (1) { /* Figure out where the buffers are getting messed up */
#else
if (unlikely(vertex->need_conversion)) {
rs->rs_draw.offset_tri = 0;
rs->rs_draw.offset_clamp = 0;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
vap_control_status = R300_VC_NO_SWAP;
#else
vap_control_status = R300_VC_32BIT_SWAP;
R600_COHERENCY_CB_META,
};
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
#define R600_BIG_ENDIAN 1
#else
#define R600_BIG_ENDIAN 0
int i;
/* This function is broken in BE, so just disable this path for now */
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
return;
#endif
int i;
/* This function is broken in BE, so just disable this path for now */
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
return;
#endif
#include "util/u_idalloc.h"
#include "util/u_threaded_context.h"
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
#define SI_BIG_ENDIAN 1
#else
#define SI_BIG_ENDIAN 0
*/
union si_vgt_param_key {
struct {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned prim:4;
unsigned uses_instancing:1;
unsigned multi_instances_smaller_than_primgroup:1;
unsigned tess_uses_prim_id:1;
unsigned uses_gs:1;
unsigned _pad:32 - SI_NUM_VGT_PARAM_KEY_BITS;
-#else /* PIPE_ARCH_BIG_ENDIAN */
+#else /* UTIL_ARCH_BIG_ENDIAN */
unsigned _pad:32 - SI_NUM_VGT_PARAM_KEY_BITS;
unsigned uses_gs:1;
unsigned tess_uses_prim_id:1;
*/
union si_vgt_stages_key {
struct {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
unsigned tess:1;
unsigned gs:1;
unsigned ngg:1; /* gfx10+ */
unsigned streamout:1; /* only used with NGG */
unsigned _pad:32 - SI_NUM_VGT_STAGES_KEY_BITS;
-#else /* PIPE_ARCH_BIG_ENDIAN */
+#else /* UTIL_ARCH_BIG_ENDIAN */
unsigned _pad:32 - SI_NUM_VGT_STAGES_KEY_BITS;
unsigned streamout:1;
unsigned ngg:1;
{
PIPE_ENDIAN_LITTLE = 0,
PIPE_ENDIAN_BIG = 1,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_LITTLE
-#elif PIPE_ARCH_BIG_ENDIAN
+#elif UTIL_ARCH_BIG_ENDIAN
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_BIG
#endif
};
PIPE_FORMAT_COUNT
};
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
#define PIPE_FORMAT_RGBA8888_UNORM PIPE_FORMAT_R8G8B8A8_UNORM
#define PIPE_FORMAT_RGBX8888_UNORM PIPE_FORMAT_R8G8B8X8_UNORM
#define PIPE_FORMAT_BGRA8888_UNORM PIPE_FORMAT_B8G8R8A8_UNORM
#define PIPE_FORMAT_GR1616_UNORM PIPE_FORMAT_G16R16_UNORM
#define PIPE_FORMAT_RG1616_SNORM PIPE_FORMAT_R16G16_SNORM
#define PIPE_FORMAT_GR1616_SNORM PIPE_FORMAT_G16R16_SNORM
-#elif PIPE_ARCH_BIG_ENDIAN
+#elif UTIL_ARCH_BIG_ENDIAN
#define PIPE_FORMAT_ABGR8888_UNORM PIPE_FORMAT_R8G8B8A8_UNORM
#define PIPE_FORMAT_XBGR8888_UNORM PIPE_FORMAT_R8G8B8X8_UNORM
#define PIPE_FORMAT_ARGB8888_UNORM PIPE_FORMAT_B8G8R8A8_UNORM
switch (format) {
case OSMESA_RGBA:
if (type == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
return PIPE_FORMAT_R8G8B8A8_UNORM;
#else
return PIPE_FORMAT_A8B8G8R8_UNORM;
break;
case OSMESA_BGRA:
if (type == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
return PIPE_FORMAT_B8G8R8A8_UNORM;
#else
return PIPE_FORMAT_A8R8G8B8_UNORM;
break;
case OSMESA_ARGB:
if (type == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
return PIPE_FORMAT_A8R8G8B8_UNORM;
#else
return PIPE_FORMAT_B8G8R8A8_UNORM;
# endif
#elif defined(USE_X86_64_ASM) && defined(__GNUC__) && defined(USE_ELF_TLS)
# include "entry_x86-64_tls.h"
-#elif defined(USE_PPC64LE_ASM) && defined(__GNUC__) && PIPE_ARCH_LITTLE_ENDIAN
+#elif defined(USE_PPC64LE_ASM) && defined(__GNUC__) && UTIL_ARCH_LITTLE_ENDIAN
# ifdef USE_ELF_TLS
# include "entry_ppc64le_tls.h"
# else
.image_format = __DRI_IMAGE_FORMAT_R8,
.mesa_format = MESA_FORMAT_L_UNORM8,
},
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR88,
.mesa_format = MESA_FORMAT_RG_UNORM8,
.image_format = __DRI_IMAGE_FORMAT_R16,
.mesa_format = MESA_FORMAT_L_UNORM16,
},
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR1616,
.mesa_format = MESA_FORMAT_RG_UNORM16,
{
/* XXX others? */
switch (mesa_format) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
case MESA_FORMAT_B8G8R8A8_UNORM:
case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_B5G6R5_UNORM:
assert(height <= 2048);
assert(offset % 32 == 0);
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
txformat |= tx_table_le[src_mesa_format].format;
#else
txformat |= tx_table_be[src_mesa_format].format;
break;
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_R8G8B8A8_UNORM:
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
if (dst_mesa_format == MESA_FORMAT_A8B8G8R8_UNORM) {
#else
if (dst_mesa_format == MESA_FORMAT_R8G8B8A8_UNORM) {
if (!t->image_override) {
if (VALID_FORMAT(firstImage->TexFormat)) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
const struct tx_table *table = tx_table_le;
#else
const struct tx_table *table = tx_table_be;
{
/* XXX others? */
switch (mesa_format) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
case MESA_FORMAT_B8G8R8A8_UNORM:
case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_B5G6R5_UNORM:
if (mesaVis->redBits == 5)
rgbFormat =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_B5G6R5_UNORM;
#else
MESA_FORMAT_R5G6B5_UNORM;
#endif
else if (mesaVis->alphaBits == 0)
rgbFormat =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_B8G8R8X8_UNORM;
#else
MESA_FORMAT_X8R8G8B8_UNORM;
#endif
else
rgbFormat =
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_B8G8R8A8_UNORM;
#else
MESA_FORMAT_A8R8G8B8_UNORM;
static void
radeonInitTextureFormats(void)
{
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
_radeon_texformat_rgba8888 = MESA_FORMAT_A8B8G8R8_UNORM;
_radeon_texformat_argb8888 = MESA_FORMAT_B8G8R8A8_UNORM;
_radeon_texformat_rgb565 = MESA_FORMAT_B5G6R5_UNORM;
*/
if (osmesa->format == OSMESA_RGBA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
#else
rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
}
else if (osmesa->format == OSMESA_BGRA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
#else
rb->Format = MESA_FORMAT_A8R8G8B8_UNORM;
}
else if (osmesa->format == OSMESA_ARGB) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
rb->Format = MESA_FORMAT_A8R8G8B8_UNORM;
#else
rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
}
static const uint8_t map_identity[7] = { 0, 1, 2, 3, 4, 5, 6 };
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
static const uint8_t map_3210[7] = { 3, 2, 1, 0, 4, 5, 6 };
static const uint8_t map_1032[7] = { 1, 0, 3, 2, 4, 5, 6 };
#endif
endian = map_identity;
break;
case 2:
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
endian = map_identity;
#else
endian = map_1032;
#endif
break;
case 4:
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
endian = map_identity;
#else
endian = map_3210;
endian = map_identity;
break;
case 2:
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
endian = map_identity;
#else
endian = map_1032;
_mesa_format_to_array_format(mesa_format format)
{
const struct mesa_format_info *info = _mesa_get_format_info(format);
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
if (info->ArrayFormat && info->Layout == MESA_FORMAT_LAYOUT_PACKED)
return _mesa_array_format_flip_channels(info->ArrayFormat);
else
if (!info->ArrayFormat)
continue;
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
array_format = info->ArrayFormat;
#else
array_format = _mesa_array_format_flip_channels(info->ArrayFormat);
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_R8G8B8A8_UNORM,
#else
MESA_FORMAT_A8B8G8R8_UNORM,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_R8G8B8A8_UNORM,
#else
MESA_FORMAT_A8B8G8R8_UNORM,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_R8G8B8A8_UNORM,
#else
MESA_FORMAT_A8B8G8R8_UNORM,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_R8G8B8A8_UNORM,
#else
MESA_FORMAT_A8B8G8R8_UNORM,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
MESA_FORMAT_R8G8B8A8_UNORM,
#else
MESA_FORMAT_A8B8G8R8_UNORM,
if (srcPacking->SwapBytes ^
(srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA) ^
(dstFormat == MESA_FORMAT_YCBCR_REV) ^
- !PIPE_ARCH_LITTLE_ENDIAN) {
+ !UTIL_ARCH_LITTLE_ENDIAN) {
GLint img, row;
for (img = 0; img < srcDepth; img++) {
GLubyte *dstRow = dstSlices[img];
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
#else
rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
#if CHAN_BITS != 8
USE(general_triangle);
#else
- if (format == MESA_FORMAT_A8B8G8R8_UNORM && !PIPE_ARCH_LITTLE_ENDIAN) {
+ if (format == MESA_FORMAT_A8B8G8R8_UNORM && !UTIL_ARCH_LITTLE_ENDIAN) {
/* We only handle RGBA8888 correctly on little endian
* in the optimized code above.
*/
* blk0() and blk() perform the initial expand.
* I got the idea of expanding during the round function from SSLeay
*/
-#if PIPE_ARCH_LITTLE_ENDIAN
+#if UTIL_ARCH_LITTLE_ENDIAN
# define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
|(rol(block->l[i],8)&0x00FF00FF))
#else
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 1
-# define PIPE_ARCH_BIG_ENDIAN 0
+# define UTIL_ARCH_LITTLE_ENDIAN 1
+# define UTIL_ARCH_BIG_ENDIAN 0
#elif __BYTE_ORDER == __BIG_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 0
-# define PIPE_ARCH_BIG_ENDIAN 1
+# define UTIL_ARCH_LITTLE_ENDIAN 0
+# define UTIL_ARCH_BIG_ENDIAN 1
#endif
#elif defined(__APPLE__)
#include <machine/endian.h>
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 1
-# define PIPE_ARCH_BIG_ENDIAN 0
+# define UTIL_ARCH_LITTLE_ENDIAN 1
+# define UTIL_ARCH_BIG_ENDIAN 0
#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 0
-# define PIPE_ARCH_BIG_ENDIAN 1
+# define UTIL_ARCH_LITTLE_ENDIAN 0
+# define UTIL_ARCH_BIG_ENDIAN 1
#endif
#elif defined(__sun)
#include <sys/isa_defs.h>
#if defined(_LITTLE_ENDIAN)
-# define PIPE_ARCH_LITTLE_ENDIAN 1
-# define PIPE_ARCH_BIG_ENDIAN 0
+# define UTIL_ARCH_LITTLE_ENDIAN 1
+# define UTIL_ARCH_BIG_ENDIAN 0
#elif defined(_BIG_ENDIAN)
-# define PIPE_ARCH_LITTLE_ENDIAN 0
-# define PIPE_ARCH_BIG_ENDIAN 1
+# define UTIL_ARCH_LITTLE_ENDIAN 0
+# define UTIL_ARCH_BIG_ENDIAN 1
#endif
#elif defined(__OpenBSD__) || defined(__NetBSD__) || \
#include <machine/endian.h>
#if _BYTE_ORDER == _LITTLE_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 1
-# define PIPE_ARCH_BIG_ENDIAN 0
+# define UTIL_ARCH_LITTLE_ENDIAN 1
+# define UTIL_ARCH_BIG_ENDIAN 0
#elif _BYTE_ORDER == _BIG_ENDIAN
-# define PIPE_ARCH_LITTLE_ENDIAN 0
-# define PIPE_ARCH_BIG_ENDIAN 1
+# define UTIL_ARCH_LITTLE_ENDIAN 0
+# define UTIL_ARCH_BIG_ENDIAN 1
#endif
#elif defined(_WIN32)
-#define PIPE_ARCH_LITTLE_ENDIAN 1
-#define PIPE_ARCH_BIG_ENDIAN 0
+#define UTIL_ARCH_LITTLE_ENDIAN 1
+#define UTIL_ARCH_BIG_ENDIAN 0
#endif
#include <stdarg.h>
#include "bitscan.h"
-#include "u_endian.h" /* for PIPE_ARCH_BIG_ENDIAN */
+#include "u_endian.h" /* for UTIL_ARCH_BIG_ENDIAN */
#ifdef __cplusplus
extern "C" {
* Convert from little endian to CPU byte order.
*/
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
#define util_le64_to_cpu(x) util_bswap64(x)
#define util_le32_to_cpu(x) util_bswap32(x)
#define util_le16_to_cpu(x) util_bswap16(x)
static inline void*
util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t n)
{
-#if PIPE_ARCH_BIG_ENDIAN
+#if UTIL_ARCH_BIG_ENDIAN
size_t i, e;
assert(n % 4 == 0);