diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 21:35:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 23:01:52 +0000 |
commit | c0008242b0f162d8c7717009ba792ed61b2924d1 (patch) | |
tree | cf8a59f4e46aa596f3fd7ede9c67d4d540deca7f /src/cairo-misc.c | |
parent | 1236c41072a7966eda7db48a381fd0508e5289be (diff) |
misc: Only use custom lround() under DISABLE_SOME_FLOATING_POINT
On my Core2, the library version of lround() is faster than our
hand-rolled non-floating point implementation. So only enable our code
if we are trying to minimise the number of floating point operations --
even then, it would worth investigating the library performance first.
[Just a reminder that optimisation choices will change over time as our
hardware and software evolves.]
Diffstat (limited to 'src/cairo-misc.c')
-rw-r--r-- | src/cairo-misc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cairo-misc.c b/src/cairo-misc.c index 56409afc..32c2428c 100644 --- a/src/cairo-misc.c +++ b/src/cairo-misc.c @@ -463,6 +463,7 @@ _cairo_operator_bounded_by_either (cairo_operator_t op) } +#if DISABLE_SOME_FLOATING_POINT /* This function is identical to the C99 function lround(), except that it * performs arithmetic rounding (floor(d + .5) instead of away-from-zero rounding) and * has a valid input range of (INT_MIN, INT_MAX] instead of @@ -673,6 +674,7 @@ _cairo_lround (double d) #undef MSW #undef LSW } +#endif /* Convert a 32-bit IEEE single precision floating point number to a * 'half' representation (s10.5) |