libclc: implement initial version of min()

This doesn't handle the integer cases for min(vector, scalar).

Patch by: Aaron Watry

llvm-svn: 185001
This commit is contained in:
Tom Stellard 2013-06-26 18:21:38 +00:00
parent 29b5b9816b
commit 0be3acfc70
6 changed files with 22 additions and 0 deletions

View File

@ -69,6 +69,7 @@
/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
#include <clc/shared/clamp.h>
#include <clc/shared/max.h>
#include <clc/shared/min.h>
/* 6.11.5 Geometric Functions */
#include <clc/geometric/cross.h>

View File

@ -0,0 +1,5 @@
#define BODY <clc/shared/min.inc>
#include <clc/integer/gentype.inc>
#define BODY <clc/shared/min.inc>
#include <clc/math/gentype.inc>

View File

@ -0,0 +1 @@
_CLC_OVERLOAD _CLC_DECL GENTYPE min(GENTYPE a, GENTYPE b);

View File

@ -19,5 +19,6 @@ math/mad.cl
relational/any.cl
shared/clamp.cl
shared/max.cl
shared/min.cl
workitem/get_global_id.cl
workitem/get_global_size.cl

View File

@ -0,0 +1,11 @@
#include <clc/clc.h>
#define BODY <min.inc>
#include <clc/integer/gentype.inc>
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
#define BODY <min.inc>
#include <clc/math/gentype.inc>

View File

@ -0,0 +1,3 @@
_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, GENTYPE b) {
return (a < b ? a : b);
}