Mesa (gallium-0.2): cell: Specify constant as float for CEILF().

Jonathan Adamczewski jonathan at kemper.freedesktop.org
Wed Jan 14 01:47:03 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: f6d09531ff1588ea18048a842ab24338ae4bc5a7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6d09531ff1588ea18048a842ab24338ae4bc5a7

Author: Jonathan Adamczewski <jadamcze at utas.edu.au>
Date:   Wed Jan 14 12:37:46 2009 +1100

cell: Specify constant as float for CEILF().

Without the f, the constant is treated as a double, resulting in
slower arithmetic and libgcc conversion calls each time CEILF()
is used.

---

 src/gallium/drivers/cell/spu/spu_tri.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c
index 322be12..0d9fcb9 100644
--- a/src/gallium/drivers/cell/spu/spu_tri.c
+++ b/src/gallium/drivers/cell/spu/spu_tri.c
@@ -57,7 +57,7 @@ struct vertex_header {
 
 /* XXX fix this */
 #undef CEILF
-#define CEILF(X) ((float) (int) ((X) + 0.99999))
+#define CEILF(X) ((float) (int) ((X) + 0.99999f))
 
 
 #define QUAD_TOP_LEFT     0




More information about the mesa-commit mailing list