On 12/01/2012 08:08 PM, Liu wrote:
> Hi, Chad,
>
> I notice that you have submitted a fix android build for
> glsl.(5497cc428fa7c6670d252d34f4a67c9498ae3895). as you pointed out, you
> included "external/astl" and plan to submit the second half fix to upstream.
> what's going on for the second half?
>
> i update my android astl to the newest, and the
> numeric_limits<float>::infinity
> is still misssing? further, google dropped external/mesa from official
> repository. does it mean that it won't accept any fix for mesa?
>
> what's your patch for it? i just copied the definition from GNU stdc++, is it
> right?
>
> xliu@xliu-desktop:~/Development/android-dev/external/astl$ git diff .
> diff --git a/include/limits b/include/limits
> index 5213a65..df11641 100644
> --- a/include/limits
> +++ b/include/limits
> @@ -110,6 +110,7 @@ struct numeric_limits<float>
>
> static float min() { return __FLT_MIN__; }
> static float max() { return __FLT_MAX__; }
> + static float infinity() throw() { return __builtin_huge_valf (); }
>
> static const bool is_signed = true;
> static const bool is_integer = false
Liu,
In ssh://otc-android.intel.com/aosp/platform/external/astl, my fix is in commit
commit 42aa24afc7b3fecc332262ee948ceafc2d9c186e
Author: Chad Versace <[email protected]>
Date: Wed Feb 8 11:20:42 2012 -0800
Implement numeric_limits::infinty
This is required by Mesa's GLSL compiler. See
git://anongit.freedesktop.org/mesa/mesa.git, commit 4f82fed4.
Signed-off-by: Chad Versace <[email protected]>
I've also attached the patch. The just does what you suggest, plus a little
bit more. Your patch looks sufficient to solve Mesa's problem.
It seems that OTC never attempted to push the commit upstream. I need to
follow-up on that.
-Chad
>From 42aa24afc7b3fecc332262ee948ceafc2d9c186e Mon Sep 17 00:00:00 2001
From: Chad Versace <[email protected]>
Date: Wed, 8 Feb 2012 11:20:42 -0800
Subject: [PATCH] Implement numeric_limits::infinty
This is required by Mesa's GLSL compiler. See
git://anongit.freedesktop.org/mesa/mesa.git, commit 4f82fed4.
Signed-off-by: Chad Versace <[email protected]>
---
include/limits | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/limits b/include/limits
index 5213a65..b655f22 100644
--- a/include/limits
+++ b/include/limits
@@ -85,6 +85,9 @@ struct __numeric_limits_base
// The number of base 10 digits that can be represented without change.
// Equivalent to FLT_DIG, DBL_DIG, LDBL_MANT_DIG.
static const int digits10 = 0;
+
+ // True if the type has a reprensentation for positive infinity.
+ static const bool has_infinity = false;
};
@@ -98,6 +101,9 @@ struct numeric_limits : public __numeric_limits_base
// The maximum finite value.
static _T max() { return static_cast<_T>(0); }
+
+ // If has_infinity, the representation of positive infinity. Else, 0.
+ static _T infinity() { return static_cast<_T>(0); }
};
// Specializations for some fundamental types.
@@ -116,6 +122,10 @@ struct numeric_limits<float>
static const int digits = __FLT_MANT_DIG__;
static const int digits10 = __FLT_DIG__;
+
+ static const bool has_infinity = __FLT_HAS_INFINITY__;
+
+ static float infinity() { return __builtin_huge_valf(); }
};
// numeric_limits<double>
@@ -132,6 +142,10 @@ struct numeric_limits<double>
static const int digits = __DBL_MANT_DIG__;
static const int digits10 = __DBL_DIG__;
+
+ static const bool has_infinity = __DBL_HAS_INFINITY__;
+
+ static float infinity() { return __builtin_huge_val(); }
};
// numeric_limits<int>
--
1.7.11.7
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev