[Libclc-dev] [PATCH] Add remaining float constants

Aaron Watry awatry at gmail.com
Mon Jun 16 07:08:23 PDT 2014


Reviewed-by: Aaron Watry <awatry at gmail.com>

While you're at it, could you also add (end of section 6.11.2 in
version 1.1 spec):
#define MAXFLOAT FLT_MAX

MAXFLOAT is currently missing and is required for some of the
applications I'm currently working on getting up and running.  I had
already written most of this patch, but lost the content when I
accidently did a 'git checkout .' while revising some patches.

--Aaron

On Mon, Jun 16, 2014 at 4:52 AM, Jeroen Ketema <j.ketema at imperial.ac.uk> wrote:
> ---
> generic/include/clc/float/definitions.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/generic/include/clc/float/definitions.h b/generic/include/clc/float/definitions.h
> index af54fdf..0fb0edf 100644
> --- a/generic/include/clc/float/definitions.h
> +++ b/generic/include/clc/float/definitions.h
> @@ -9,11 +9,19 @@
> #define FLT_MIN         0x1.0p-126f
> #define FLT_EPSILON     0x1.0p-23f
>
> +#define M_E_F           0x1.5bf0a8p+1f
> #define M_LOG2E_F       0x1.715476p+0f
> #define M_LOG10E_F      0x1.bcb7b2p-2f
> #define M_LN2_F         0x1.62e430p-1f
> #define M_LN10_F        0x1.26bb1cp+1f
> #define M_PI_F          0x1.921fb6p+1f
> +#define M_PI_2_F        0x1.921fb6p+0f
> +#define M_PI_4_F        0x1.921fb6p-1f
> +#define M_1_PI_F        0x1.45f306p-2f
> +#define M_2_PI_F        0x1.45f306p-1f
> +#define M_2_SQRTPI_F    0x1.20dd76p+0f
> +#define M_SQRT2_F       0x1.6a09e6p+0f
> +#define M_SQRT1_2_F     0x1.6a09e6p-1f
>
> #ifdef cl_khr_fp64
>
> --
> 1.8.5.2 (Apple Git-48)
>
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list