[Libclc-dev] [PATCH 2/2] r600: Use __clc_ldexp on asics that don't implement the intruction

Tom Stellard tom at stellard.net
Wed May 6 13:57:56 PDT 2015


On Wed, May 06, 2015 at 09:48:35AM -0400, Jan Vesely wrote:
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

LGTM.

> ---
>  r600/lib/math/ldexp.cl | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/r600/lib/math/ldexp.cl b/r600/lib/math/ldexp.cl
> index 0461a53..80439ce 100644
> --- a/r600/lib/math/ldexp.cl
> +++ b/r600/lib/math/ldexp.cl
> @@ -24,8 +24,15 @@
>  
>  #include "../../../generic/lib/clcmacro.h"
>  
> +#ifdef __HAS_LDEXPF__
> +#define BUILTINF __builtin_amdgpu_ldexpf
> +#else
> +#include "math/clc_ldexp.h"
> +#define BUILTINF __clc_ldexp
> +#endif
> +
>  // This defines all the ldexp(floatN, intN) variants.
> -_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, __builtin_amdgpu_ldexpf, float, int);
> +_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, BUILTINF, float, int);
>  
>  #ifdef cl_khr_fp64
>    #pragma OPENCL EXTENSION cl_khr_fp64 : enable
> @@ -36,3 +43,5 @@ _CLC_DEFINE_BINARY_BUILTIN(float, ldexp, __builtin_amdgpu_ldexpf, float, int);
>  // This defines all the ldexp(GENTYPE, int);
>  #define __CLC_BODY <../../../generic/lib/math/ldexp.inc>
>  #include <clc/math/gentype.inc>
> +
> +#undef BUILTINF
> -- 
> 2.1.0
> 
> 
> _______________________________________________
> 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