forked from OSchip/llvm-project
math: Implement minmag
Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 318265
This commit is contained in:
parent
7ba243cc3d
commit
fe7c045753
|
@ -84,6 +84,7 @@
|
|||
#include <clc/math/logb.h>
|
||||
#include <clc/math/mad.h>
|
||||
#include <clc/math/maxmag.h>
|
||||
#include <clc/math/minmag.h>
|
||||
#include <clc/math/modf.h>
|
||||
#include <clc/math/nextafter.h>
|
||||
#include <clc/math/pow.h>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#define __CLC_BODY <clc/math/binary_decl_tt.inc>
|
||||
#define __CLC_FUNCTION minmag
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_BODY
|
||||
#undef __CLC_FUNCTION
|
|
@ -119,6 +119,7 @@ math/log2.cl
|
|||
math/logb.cl
|
||||
math/mad.cl
|
||||
math/maxmag.cl
|
||||
math/minmag.cl
|
||||
math/modf.cl
|
||||
math/native_cos.cl
|
||||
math/native_divide.cl
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#include <clc/clc.h>
|
||||
|
||||
#define __CLC_BODY <minmag.inc>
|
||||
#include <clc/math/gentype.inc>
|
|
@ -0,0 +1,4 @@
|
|||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE minmag(__CLC_GENTYPE x, __CLC_GENTYPE y) {
|
||||
const __CLC_GENTYPE res = select(y, x, isless(fabs(x), fabs(y)));
|
||||
return select(res, fmin(x, y), isnan(x) | isnan(y) | isequal(fabs(x), fabs(y)));
|
||||
}
|
Loading…
Reference in New Issue