summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_half.h
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-04-02 00:39:08 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-04-02 00:48:27 +0200
commit6c5f444f596984778a786b49058d3cf2a4fd2c2c (patch)
treecd888d09154702d90f077a37e4b966cb3bce07e1 /src/gallium/auxiliary/util/u_half.h
parent7bb54c99a466883af3ac3e79426def17dcfa8d89 (diff)
gallium/util: reindent u_half.c and u_half.h with Mesa coding style
Sorry, forgout about that.
Diffstat (limited to 'src/gallium/auxiliary/util/u_half.h')
-rw-r--r--src/gallium/auxiliary/util/u_half.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/util/u_half.h b/src/gallium/auxiliary/util/u_half.h
index 5afdd925a6..4b80d45b91 100644
--- a/src/gallium/auxiliary/util/u_half.h
+++ b/src/gallium/auxiliary/util/u_half.h
@@ -8,7 +8,6 @@
extern "C" {
#endif
-
extern uint32_t util_half_to_float_mantissa_table[2048];
extern uint32_t util_half_to_float_exponent_table[64];
extern uint32_t util_half_to_float_offset_table[64];
@@ -29,33 +28,31 @@ extern uint8_t util_float_to_half_shift_table[512];
static INLINE uint32_t
util_half_to_floatui(half h)
{
- unsigned exp = h >> 10;
- return util_half_to_float_mantissa_table[util_half_to_float_offset_table[exp] + (h & 0x3ff)]
- + util_half_to_float_exponent_table[exp];
+ unsigned exp = h >> 10;
+ return util_half_to_float_mantissa_table[util_half_to_float_offset_table[exp] + (h & 0x3ff)] + util_half_to_float_exponent_table[exp];
}
static INLINE float
util_half_to_float(half h)
{
- union fi r;
- r.ui = util_half_to_floatui(h);
- return r.f;
+ union fi r;
+ r.ui = util_half_to_floatui(h);
+ return r.f;
}
static INLINE half
util_floatui_to_half(uint32_t v)
{
- unsigned signexp = v >> 23;
- return util_float_to_half_base_table[signexp]
- + ((v & 0x007fffff) >> util_float_to_half_shift_table[signexp]);
+ unsigned signexp = v >> 23;
+ return util_float_to_half_base_table[signexp] + ((v & 0x007fffff) >> util_float_to_half_shift_table[signexp]);
}
static INLINE half
util_float_to_half(float f)
{
- union fi i;
- i.f = f;
- return util_floatui_to_half(i.ui);
+ union fi i;
+ i.f = f;
+ return util_floatui_to_half(i.ui);
}
#ifdef __cplusplus
@@ -63,3 +60,4 @@ util_float_to_half(float f)
#endif
#endif /* U_HALF_H */
+