[cairo] Re: Flag for FP-challenged platforms
Daniel Amelang
daniel.amelang at gmail.com
Wed Nov 29 16:04:32 PST 2006
On 11/27/06, Daniel Amelang <daniel.amelang at gmail.com> wrote:
> I've recently developed some optimizations in cairo that speed up
> platforms w/out an FPU, but slow down those that do. Carl has also
> mentioned being in this situation, and so I'm proposing a new
> configure option and flag. How do you all feel about the following
> proposed names?
>
> --avoid-floating-point and AVOID_FLOATING_POINT
> --avoid-floats and AVOID_FLOATS
> --avoid-float and AVOID_FLOAT
> --avoid-float-operations and AVOID_FLOAT_OPERATIONS
>
> I'm shying away from --enable-embedded or the like, as I'd prefer the
> flag to describe the effect that it has on the code produced instead
> of describing the context where it is expected to be used.
>
> Also, it would be nice to be able to guess this value for a given
> arch, but that's a little tricky. Like ARM with VFP would actually
> want to use FP, while ARM w/out VFP would not. I've seen people do
> this:
>
> #if defined(__arm__) && !defined(__VFP__)
>
> which I think would cover the one and only situation that we know of
> where cairo should avoid FP operations. Thoughts?
Hmmm...not much feedback. I'll take that to mean "looks good". I'm
attaching a patch for final review just in case. If I don't hear any
objections, I'll then commit with my newly bestowed cairo commit
powers!
Notice that I don't try to guess what the value should be. If someone
wants to build some smarts into this, be my guest. In the meantime,
the embedded people will have to remember to specify
--enable-avoid-floating-point at configure time.
Dan
-------------- next part --------------
From nobody Mon Sep 17 00:00:00 2001
From: Dan Amelang <dan at amelang.net>
Date: Wed Nov 29 15:38:14 2006 -0800
Subject: [PATCH] Add AVOID_FLOATING_POINT flag activated via --enable-avoid-floating-point configure option
---
configure.in | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
67a8d2cee935c0220201d52f5933405d9361c92c
diff --git a/configure.in b/configure.in
index ea1de98..bb4ba3f 100644
--- a/configure.in
+++ b/configure.in
@@ -773,6 +773,18 @@ fi
dnl ===========================================================================
+AC_ARG_ENABLE(avoid-floating-point,
+ AS_HELP_STRING([--enable-avoid-floating-point],
+ [Enable code paths that avoid floating-point operations]),
+ [avoid_floating_point=$enableval], [avoid_floating_point=no])
+
+if test "x$avoid_floating_point" = "xyes"; then
+ AC_DEFINE(AVOID_FLOATING_POINT, 1,
+ [Define to 1 to enable code paths that avoid floating-point operations])
+fi
+
+dnl ===========================================================================
+
AC_CONFIG_COMMANDS([src/cairo-features.h],
[
featuresfile=src/cairo-features.h
--
1.2.6
More information about the cairo
mailing list