mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
libclc: Add max() builtin function
Adds this function for both int and floating data types. Patch by: Aaron Watry llvm-svn: 184992
This commit is contained in:
parent
30f554b23d
commit
ec87fb0b0c
@ -45,6 +45,7 @@
|
||||
#include <clc/math/log.h>
|
||||
#include <clc/math/log2.h>
|
||||
#include <clc/math/mad.h>
|
||||
#include <clc/math/max.h>
|
||||
#include <clc/math/pow.h>
|
||||
#include <clc/math/sin.h>
|
||||
#include <clc/math/sqrt.h>
|
||||
@ -63,6 +64,7 @@
|
||||
#include <clc/integer/abs.h>
|
||||
#include <clc/integer/abs_diff.h>
|
||||
#include <clc/integer/add_sat.h>
|
||||
#include <clc/integer/max.h>
|
||||
#include <clc/integer/sub_sat.h>
|
||||
|
||||
/* 6.11.5 Geometric Functions */
|
||||
|
2
libclc/generic/include/clc/integer/max.h
Normal file
2
libclc/generic/include/clc/integer/max.h
Normal file
@ -0,0 +1,2 @@
|
||||
#define BODY <clc/integer/max.inc>
|
||||
#include <clc/integer/gentype.inc>
|
1
libclc/generic/include/clc/integer/max.inc
Normal file
1
libclc/generic/include/clc/integer/max.inc
Normal file
@ -0,0 +1 @@
|
||||
_CLC_OVERLOAD _CLC_DECL GENTYPE max(GENTYPE a, GENTYPE b);
|
2
libclc/generic/include/clc/math/max.h
Normal file
2
libclc/generic/include/clc/math/max.h
Normal file
@ -0,0 +1,2 @@
|
||||
#define BODY <clc/math/max.inc>
|
||||
#include <clc/math/gentype.inc>
|
1
libclc/generic/include/clc/math/max.inc
Normal file
1
libclc/generic/include/clc/math/max.inc
Normal file
@ -0,0 +1 @@
|
||||
_CLC_OVERLOAD _CLC_DECL GENTYPE max(GENTYPE a, GENTYPE b);
|
@ -7,6 +7,7 @@ integer/abs.cl
|
||||
integer/add_sat.cl
|
||||
integer/add_sat.ll
|
||||
integer/add_sat_impl.ll
|
||||
integer/max.cl
|
||||
integer/sub_sat.cl
|
||||
integer/sub_sat.ll
|
||||
integer/sub_sat_impl.ll
|
||||
@ -14,6 +15,7 @@ math/fmax.cl
|
||||
math/fmin.cl
|
||||
math/hypot.cl
|
||||
math/mad.cl
|
||||
math/max.cl
|
||||
relational/any.cl
|
||||
workitem/get_global_id.cl
|
||||
workitem/get_global_size.cl
|
||||
|
4
libclc/generic/lib/integer/max.cl
Normal file
4
libclc/generic/lib/integer/max.cl
Normal file
@ -0,0 +1,4 @@
|
||||
#include <clc/clc.h>
|
||||
|
||||
#define BODY <max.inc>
|
||||
#include <clc/integer/gentype.inc>
|
3
libclc/generic/lib/integer/max.inc
Normal file
3
libclc/generic/lib/integer/max.inc
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) {
|
||||
return (a > b ? a : b);
|
||||
}
|
8
libclc/generic/lib/math/max.cl
Normal file
8
libclc/generic/lib/math/max.cl
Normal file
@ -0,0 +1,8 @@
|
||||
#include <clc/clc.h>
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
#endif
|
||||
|
||||
#define BODY <max.inc>
|
||||
#include <clc/math/gentype.inc>
|
3
libclc/generic/lib/math/max.inc
Normal file
3
libclc/generic/lib/math/max.inc
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) {
|
||||
return (a > b ? a : b);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user