value |= (((uint32_t)(CLAMP(src[1], 0, 1) * 0x3ff)) & 0x3ff) << 10;
value |= (((uint32_t)(CLAMP(src[0], 0, 1) * 0x3ff)) & 0x3ff) << 20;
value |= ((uint32_t)(CLAMP(src[3], 0, 1) * 0x3)) << 30;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (((uint32_t)CLAMP(src[1], 0, 1023)) & 0x3ff) << 10;
value |= (((uint32_t)CLAMP(src[0], 0, 1023)) & 0x3ff) << 20;
value |= ((uint32_t)CLAMP(src[3], 0, 3)) << 30;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (uint32_t)((((uint32_t)(CLAMP(src[1], -1, 1) * 0x1ff)) & 0x3ff) << 10) ;
value |= (uint32_t)((((uint32_t)(CLAMP(src[0], -1, 1) * 0x1ff)) & 0x3ff) << 20) ;
value |= (uint32_t)(((uint32_t)(CLAMP(src[3], -1, 1) * 0x1)) << 30) ;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (uint32_t)((((uint32_t)CLAMP(src[1], -512, 511)) & 0x3ff) << 10) ;
value |= (uint32_t)((((uint32_t)CLAMP(src[0], -512, 511)) & 0x3ff) << 20) ;
value |= (uint32_t)(((uint32_t)CLAMP(src[3], -2, 1)) << 30) ;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (((uint32_t)(CLAMP(src[1], 0, 1) * 0x3ff)) & 0x3ff) << 10;
value |= (((uint32_t)(CLAMP(src[2], 0, 1) * 0x3ff)) & 0x3ff) << 20;
value |= ((uint32_t)(CLAMP(src[3], 0, 1) * 0x3)) << 30;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (((uint32_t)CLAMP(src[1], 0, 1023)) & 0x3ff) << 10;
value |= (((uint32_t)CLAMP(src[2], 0, 1023)) & 0x3ff) << 20;
value |= ((uint32_t)CLAMP(src[3], 0, 3)) << 30;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (uint32_t)((((uint32_t)(CLAMP(src[1], -1, 1) * 0x1ff)) & 0x3ff) << 10) ;
value |= (uint32_t)((((uint32_t)(CLAMP(src[2], -1, 1) * 0x1ff)) & 0x3ff) << 20) ;
value |= (uint32_t)(((uint32_t)(CLAMP(src[3], -1, 1) * 0x1)) << 30) ;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
value |= (uint32_t)((((uint32_t)CLAMP(src[1], -512, 511)) & 0x3ff) << 10) ;
value |= (uint32_t)((((uint32_t)CLAMP(src[2], -512, 511)) & 0x3ff) << 20) ;
value |= (uint32_t)(((uint32_t)CLAMP(src[3], -2, 1)) << 30) ;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *(uint32_t *)attrib = value;
+ *(uint32_t *)attrib = util_le32_to_cpu(value);
}
static void
float *dst = dst_row;
const uint8_t *src = src_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
rgb9e5_to_float3(value, dst);
dst[3] = 1; /* a */
src += 4;
const float *src = src_row;
uint8_t *dst = dst_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = float3_to_rgb9e5(src);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(float3_to_rgb9e5(src));
*(uint32_t *)dst = value;
src += 4;
dst += 4;
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
rgb9e5_to_float3(value, dst);
dst[3] = 1; /* a */
}
uint8_t *dst = dst_row;
const uint8_t *src = src_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
rgb9e5_to_float3(value, p);
dst[0] = float_to_ubyte(p[0]); /* r */
dst[1] = float_to_ubyte(p[1]); /* g */
p[0] = ubyte_to_float(src[0]);
p[1] = ubyte_to_float(src[1]);
p[2] = ubyte_to_float(src[2]);
- value = float3_to_rgb9e5(p);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(float3_to_rgb9e5(p));
*(uint32_t *)dst = value;
src += 4;
dst += 4;
float *dst = dst_row;
const uint8_t *src = src_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
r11g11b10f_to_float3(value, dst);
dst[3] = 1; /* a */
src += 4;
const float *src = src_row;
uint8_t *dst = dst_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = float3_to_r11g11b10f(src);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(float3_to_r11g11b10f(src));
*(uint32_t *)dst = value;
src += 4;
dst += 4;
util_format_r11g11b10_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
r11g11b10f_to_float3(value, dst);
dst[3] = 1; /* a */
}
uint8_t *dst = dst_row;
const uint8_t *src = src_row;
for(x = 0; x < width; x += 1) {
- uint32_t value = *(const uint32_t *)src;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
r11g11b10f_to_float3(value, p);
dst[0] = float_to_ubyte(p[0]); /* r */
dst[1] = float_to_ubyte(p[1]); /* g */
p[0] = ubyte_to_float(src[0]);
p[1] = ubyte_to_float(src[1]);
p[2] = ubyte_to_float(src[2]);
- value = float3_to_r11g11b10f(p);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(float3_to_r11g11b10f(p));
*(uint32_t *)dst = value;
src += 4;
dst += 4;
float *dst = dst_row;
const uint16_t *src = (const uint16_t *)src_row;
for(x = 0; x < width; x += 1) {
- uint16_t value = *src++;
+ uint16_t value = util_cpu_to_le16(*src++);
int16_t r, g;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
-
r = ((int16_t)(value << 8)) >> 8;
g = ((int16_t)(value << 0)) >> 8;
uint8_t *dst = dst_row;
const uint16_t *src = (const uint16_t *)src_row;
for(x = 0; x < width; x += 1) {
- uint16_t value = *src++;
+ uint16_t value = util_cpu_to_le16(*src++);
int16_t r, g;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
-
r = ((int16_t)(value << 8)) >> 8;
g = ((int16_t)(value << 0)) >> 8;
value |= (uint16_t)(((int8_t)(CLAMP(src[0], -1, 1) * 0x7f)) & 0xff) ;
value |= (uint16_t)((((int8_t)(CLAMP(src[1], -1, 1) * 0x7f)) & 0xff) << 8) ;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le16_to_cpu(value);
src += 4;
}
value |= src[0] >> 1;
value |= (src[1] >> 1) << 8;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le16_to_cpu(value);
src += 4;
}
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
- uint16_t value = *(const uint16_t *)src;
+ uint16_t value = util_cpu_to_le16(*(const uint16_t *)src);
int16_t r, g;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
-
r = ((int16_t)(value << 8)) >> 8;
g = ((int16_t)(value << 0)) >> 8;
float r, g0, g1, b;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
r = ubyte_to_float((value >> 0) & 0xff);
g0 = ubyte_to_float((value >> 8) & 0xff);
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
r = ubyte_to_float((value >> 0) & 0xff);
g0 = ubyte_to_float((value >> 8) & 0xff);
uint8_t r, g0, g1, b;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
r = (value >> 0) & 0xff;
g0 = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
r = (value >> 0) & 0xff;
g0 = (value >> 8) & 0xff;
value |= float_to_ubyte(b) << 16;
value |= float_to_ubyte(g1) << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= float_to_ubyte(b) << 16;
value |= float_to_ubyte(g1) << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
value |= b << 16;
value |= g1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= b << 16;
value |= g1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
float r, g0, g1, b;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
g0 = ubyte_to_float((value >> 0) & 0xff);
r = ubyte_to_float((value >> 8) & 0xff);
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
g0 = ubyte_to_float((value >> 0) & 0xff);
r = ubyte_to_float((value >> 8) & 0xff);
uint8_t r, g0, g1, b;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
g0 = (value >> 0) & 0xff;
r = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
g0 = (value >> 0) & 0xff;
r = (value >> 8) & 0xff;
value |= float_to_ubyte(g1) << 16;
value |= float_to_ubyte(b) << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= float_to_ubyte(g1) << 16;
value |= float_to_ubyte(b) << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
value |= g1 << 16;
value |= b << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= g1 << 16;
value |= b << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
uint8_t y0, y1, u, v;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
u = (value >> 0) & 0xff;
y0 = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
u = (value >> 0) & 0xff;
y0 = (value >> 8) & 0xff;
uint8_t y0, y1, u, v;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
u = (value >> 0) & 0xff;
y0 = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
u = (value >> 0) & 0xff;
y0 = (value >> 8) & 0xff;
value |= v << 16;
value |= y1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= v << 16;
value |= y1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
value |= v << 16;
value |= y1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= v << 16;
value |= y1 << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
uint8_t y0, y1, u, v;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
y0 = (value >> 0) & 0xff;
u = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
y0 = (value >> 0) & 0xff;
u = (value >> 8) & 0xff;
uint8_t y0, y1, u, v;
for (x = 0; x + 1 < width; x += 2) {
- value = *src++;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src++);
y0 = (value >> 0) & 0xff;
u = (value >> 8) & 0xff;
}
if (x < width) {
- value = *src;
-
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ value = util_cpu_to_le32(*src);
y0 = (value >> 0) & 0xff;
u = (value >> 8) & 0xff;
value |= y1 << 16;
value |= v << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= y1 << 16;
value |= v << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
value |= y1 << 16;
value |= v << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
src += 8;
}
value |= y1 << 16;
value |= v << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
-
- *dst = value;
+ *dst = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
float *dst = dst_row;
const uint16_t *src = (const uint16_t *)src_row;
for(x = 0; x < width; ++x) {
- uint16_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
+ uint16_t value = util_cpu_to_le16(*src++);
*dst++ = z16_unorm_to_z32_float(value);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint16_t value;
value = z32_float_to_z16_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
- *dst++ = value;
+ *dst++ = util_le16_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint32_t *dst = dst_row;
const uint16_t *src = (const uint16_t *)src_row;
for(x = 0; x < width; ++x) {
- uint16_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
+ uint16_t value = util_cpu_to_le16(*src++);
*dst++ = z16_unorm_to_z32_unorm(value);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint16_t value;
value = z32_unorm_to_z16_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap16(value);
-#endif
- *dst++ = value;
+ *dst++ = util_le16_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
float *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z32_unorm_to_z32_float(value);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint32_t value;
value = z32_float_to_z32_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
float *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_float(value & 0xffffff);
}
src_row += src_stride/sizeof(*src_row);
const float *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0xff000000;
value |= z32_float_to_z24_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint32_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_unorm(value & 0xffffff);
}
src_row += src_stride/sizeof(*src_row);
const uint32_t *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value= *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0xff000000;
value |= z32_unorm_to_z24_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint8_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = value >> 24;
}
src_row += src_stride/sizeof(*src_row);
const uint8_t *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0x00ffffff;
value |= *src++ << 24;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
float *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_float(value >> 8);
}
src_row += src_stride/sizeof(*src_row);
const float *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0x000000ff;
value |= z32_float_to_z24_unorm(*src++) << 8;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint32_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_unorm(value >> 8);
}
src_row += src_stride/sizeof(*src_row);
const uint32_t *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0x000000ff;
value |= *src++ & 0xffffff00;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint8_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = value & 0xff;
}
src_row += src_stride/sizeof(*src_row);
const uint8_t *src = src_row;
uint32_t *dst = (uint32_t *)dst_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *dst;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_le32_to_cpu(*dst);
value &= 0xffffff00;
value |= *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
float *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_float(value & 0xffffff);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint32_t value;
value = z32_float_to_z24_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_le32_to_cpu(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint32_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_unorm(value & 0xffffff);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint32_t value;
value = z32_unorm_to_z24_unorm(*src++);
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
float *dst = dst_row;
const uint32_t *src = (uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_float(value >> 8);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint32_t value;
value = z32_float_to_z24_unorm(*src++) << 8;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
uint32_t *dst = dst_row;
const uint32_t *src = (const uint32_t *)src_row;
for(x = 0; x < width; ++x) {
- uint32_t value = *src++;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint32_t value = util_cpu_to_le32(*src++);
*dst++ = z24_unorm_to_z32_unorm(value >> 8);
}
src_row += src_stride/sizeof(*src_row);
for(x = 0; x < width; ++x) {
uint32_t value;
value = z32_unorm_to_z24_unorm(*src++) << 8;
-#ifdef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
- *dst++ = value;
+ *dst++ = util_cpu_to_le32(value);
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
} else if (bytes_left >= 4) {
/* enough bytes in buffer, read in a whole dword */
- uint64_t value = *(const uint32_t*)vlc->data;
-
-#ifndef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint64_t value = util_cpu_to_le32(*(const uint32_t*)vlc->data);
vlc->buffer |= value << vlc->invalid_bits;
vlc->data += 4;