summaryrefslogtreecommitdiffstats
path: root/libclc/generic/include
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-26 18:20:56 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-26 18:20:56 +0000
commitfe23a30ef5febddf512d669e89e08f35a14872ee (patch)
tree14caf45c01dd290da691473d6ffa6464edfc0a28 /libclc/generic/include
parentcd88a4ebb61ed01575633e9955b89202927c33ff (diff)
downloadbcm5719-llvm-fe23a30ef5febddf512d669e89e08f35a14872ee.tar.gz
bcm5719-llvm-fe23a30ef5febddf512d669e89e08f35a14872ee.zip
libclc: Add clamp() builtin for integer/floating point
Created under a new shared/ directory for functions which are available for both integer and floating point types. Patch by: Aaron Watry llvm-svn: 184994
Diffstat (limited to 'libclc/generic/include')
-rw-r--r--libclc/generic/include/clc/clc.h3
-rw-r--r--libclc/generic/include/clc/shared/clamp.h5
-rw-r--r--libclc/generic/include/clc/shared/clamp.inc1
3 files changed, 9 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h
index f6668a36675..80ecd0175f3 100644
--- a/libclc/generic/include/clc/clc.h
+++ b/libclc/generic/include/clc/clc.h
@@ -67,6 +67,9 @@
#include <clc/integer/max.h>
#include <clc/integer/sub_sat.h>
+/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
+#include <clc/shared/clamp.h>
+
/* 6.11.5 Geometric Functions */
#include <clc/geometric/cross.h>
#include <clc/geometric/dot.h>
diff --git a/libclc/generic/include/clc/shared/clamp.h b/libclc/generic/include/clc/shared/clamp.h
new file mode 100644
index 00000000000..5c2ebd06e9d
--- /dev/null
+++ b/libclc/generic/include/clc/shared/clamp.h
@@ -0,0 +1,5 @@
+#define BODY <clc/shared/clamp.inc>
+#include <clc/integer/gentype.inc>
+
+#define BODY <clc/shared/clamp.inc>
+#include <clc/math/gentype.inc>
diff --git a/libclc/generic/include/clc/shared/clamp.inc b/libclc/generic/include/clc/shared/clamp.inc
new file mode 100644
index 00000000000..3e3a4357d38
--- /dev/null
+++ b/libclc/generic/include/clc/shared/clamp.inc
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL GENTYPE clamp(GENTYPE x, GENTYPE y, GENTYPE z);
OpenPOWER on IntegriCloud