summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_math.h
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-12-22 09:40:39 +0000
committerKeith Whitwell <keithw@vmware.com>2009-12-22 09:40:39 +0000
commitaa02683e45f1eaf61bba2ba7eeda7686efeed2ca (patch)
tree63e0ef2fa85e5d7ebd6ffc6ae9043ce0819251a2 /src/gallium/auxiliary/util/u_math.h
parentebbc73d1aed283c9bc4aa2b37bed4374bbaec5b5 (diff)
parent0fc4dd3819af252c028ed43bbd668b4f34104e32 (diff)
Merge branch 'i965g-restart'
Conflicts: configure.ac
Diffstat (limited to 'src/gallium/auxiliary/util/u_math.h')
-rw-r--r--src/gallium/auxiliary/util/u_math.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index b76592d1ec..81aeb83cbb 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -583,6 +583,19 @@ do { \
#endif
+static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits)
+{
+ value *= (1<<frac_bits);
+ return value < 0 ? 0 : value;
+}
+
+static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits)
+{
+ return value * (1<<frac_bits);
+}
+
+
+
#ifdef __cplusplus
}
#endif