diff options
author | Eric Anholt <[email protected]> | 2018-07-30 11:41:15 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-07-30 14:29:01 -0700 |
commit | 89ac6fa4036da815b5cf4985f438cec73df67480 (patch) | |
tree | 28f33d348e354b1e42c1b7fb77e9ee2e140cc5e8 /src/broadcom/cle/v3d_packet_helpers.h | |
parent | e146e3a795ecd070679b8dfd1ad7f370e9ec5665 (diff) |
v3d: Add pack header support for f187 values.
V3D only has one of these (the top 16 bits of a float32) left in its CLs,
but VC4 had many more. This gets us proper pretty-printing of the values
instead of a large uint.
Diffstat (limited to 'src/broadcom/cle/v3d_packet_helpers.h')
-rw-r--r-- | src/broadcom/cle/v3d_packet_helpers.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/broadcom/cle/v3d_packet_helpers.h b/src/broadcom/cle/v3d_packet_helpers.h index 4720f643328..f340b790697 100644 --- a/src/broadcom/cle/v3d_packet_helpers.h +++ b/src/broadcom/cle/v3d_packet_helpers.h @@ -26,6 +26,7 @@ #include <stdbool.h> #include <assert.h> #include <math.h> +#include <gallium/auxiliary/util/u_math.h> #ifdef HAVE_VALGRIND #include <valgrind.h> @@ -205,3 +206,11 @@ __gen_unpack_float(const uint8_t *restrict cl, uint32_t start, uint32_t end) return f->f; } +static inline float +__gen_unpack_f187(const uint8_t *restrict cl, uint32_t start, uint32_t end) +{ + assert(end - start == 15); + uint32_t bits = __gen_unpack_uint(cl, start, end); + return uif(bits << 16); +} + |