mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
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:
parent
29b5b9816b
commit
0be3acfc70
@ -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>
|
||||
|
5
libclc/generic/include/clc/shared/min.h
Normal file
5
libclc/generic/include/clc/shared/min.h
Normal 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>
|
1
libclc/generic/include/clc/shared/min.inc
Normal file
1
libclc/generic/include/clc/shared/min.inc
Normal file
@ -0,0 +1 @@
|
||||
_CLC_OVERLOAD _CLC_DECL GENTYPE min(GENTYPE a, GENTYPE b);
|
@ -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
|
||||
|
11
libclc/generic/lib/shared/min.cl
Normal file
11
libclc/generic/lib/shared/min.cl
Normal 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>
|
3
libclc/generic/lib/shared/min.inc
Normal file
3
libclc/generic/lib/shared/min.inc
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, GENTYPE b) {
|
||||
return (a < b ? a : b);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user