19#include <asm/byteorder.h>
21#elif defined(XRT_BIG_ENDIAN)
23#error "@todo: Add byte order constants and functions for this OS or big endian machines."
27#define __be64 uint64_t
28#define __be32 uint32_t
29#define __be16 uint16_t
31#define __be16_to_cpu(x) ((((uint16_t)x & (uint16_t)0x00FFU) << 8) | (((uint16_t)x & (uint16_t)0xFF00U) >> 8))
32#define __cpu_to_be16(x) __be16_to_cpu(x)
34#define __be32_to_cpu(x) \
35 ((((uint32_t)x & (uint32_t)0x000000FFUL) << 24) | (((uint32_t)x & (uint32_t)0x0000FF00UL) << 8) | \
36 (((uint32_t)x & (uint32_t)0x00FF0000UL) >> 8) | (((uint32_t)x & (uint32_t)0xFF000000UL) >> 24))
37#define __cpu_to_be32(x) __be32_to_cpu(x)
39#define __be64_to_cpu(x) \
40 ((((uint64_t)x & (uint64_t)0x00000000000000FFULL) << 56) | \
41 (((uint64_t)x & (uint64_t)0x000000000000FF00ULL) << 40) | \
42 (((uint64_t)x & (uint64_t)0x0000000000FF0000ULL) << 24) | \
43 (((uint64_t)x & (uint64_t)0x00000000FF000000ULL) << 8) | \
44 (((uint64_t)x & (uint64_t)0x000000FF00000000ULL) >> 8) | \
45 (((uint64_t)x & (uint64_t)0x0000FF0000000000ULL) >> 24) | \
46 (((uint64_t)x & (uint64_t)0x00FF000000000000ULL) >> 40) | \
47 (((uint64_t)x & (uint64_t)0xFF00000000000000ULL) >> 56)) |
48#define __cpu_to_be64(x) __be64_to_cpu(x)
50#define __le64 uint64_t
51#define __le32 uint32_t
52#define __le16 uint16_t
88 safe_copy.raw = __le32_to_cpu(f.val);
93__cpu_to_lef32(
float f)
101 return (
__lef32){.val = __cpu_to_le32(safe_copy.wire)};
112 safe_copy.raw = __be32_to_cpu(f.val);
113 return safe_copy.f32;
117__cpu_to_bef32(
float f)
125 return (
__bef32){.val = __cpu_to_be32(safe_copy.wire)};
144 .x = __lef32_to_cpu(v.x),
145 .y = __lef32_to_cpu(v.y),
153 .x = __cpu_to_lef32(v.x),
154 .y = __cpu_to_lef32(v.y),
175 .x = __lef32_to_cpu(v.x),
176 .y = __lef32_to_cpu(v.y),
177 .z = __lef32_to_cpu(v.z),
185 .x = __cpu_to_lef32(v.x),
186 .y = __cpu_to_lef32(v.y),
187 .z = __cpu_to_lef32(v.z),
Big endian 32-bit float wrapper struct.
Definition: xrt_byte_order.h:76
Little endian 32-bit float wrapper struct.
Definition: xrt_byte_order.h:68
Definition: xrt_byte_order.h:135
Definition: xrt_byte_order.h:165
A 2 element vector with single floats.
Definition: xrt_defines.h:268
A 3 element vector with single floats.
Definition: xrt_defines.h:289
Header holding common defines.