relational: Add islessequal(floatN) builtin

v2: remove the initial undef

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 214568
This commit is contained in:
Jan Vesely 2014-08-01 21:50:59 +00:00
parent acba2c98eb
commit 12c660827e
4 changed files with 31 additions and 0 deletions

View File

@ -116,6 +116,7 @@
#include <clc/relational/isgreater.h>
#include <clc/relational/isgreaterequal.h>
#include <clc/relational/isless.h>
#include <clc/relational/islessequal.h>
#include <clc/relational/isnan.h>
#include <clc/relational/isnotequal.h>
#include <clc/relational/select.h>

View File

@ -0,0 +1,7 @@
#define __CLC_FUNCTION islessequal
#define __CLC_BODY <clc/relational/binary_decl.inc>
#include <clc/relational/floatn.inc>
#undef __CLC_BODY
#undef __CLC_FUNCTION

View File

@ -49,6 +49,7 @@ relational/isequal.cl
relational/isgreater.cl
relational/isgreaterequal.cl
relational/isless.cl
relational/islessequal.cl
relational/isnan.cl
relational/isnotequal.cl
relational/signbit.cl

View File

@ -0,0 +1,22 @@
#include <clc/clc.h>
#include "relational.h"
//Note: It would be nice to use __builtin_islessequal with vector inputs, but it seems to only take scalar values as
// input, which will produce incorrect output for vector input types.
_CLC_DEFINE_RELATIONAL_BINARY(int, islessequal, __builtin_islessequal, float, float)
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
// The scalar version of islessequal(double, double) returns an int, but the vector versions
// return long.
_CLC_DEF _CLC_OVERLOAD int islessequal(double x, double y){
return __builtin_islessequal(x, y);
}
_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, islessequal, double, double)
#endif