summaryrefslogtreecommitdiff
path: root/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
commit213e719bf2c298d99efda128d87c80f0cc737aa9 (patch)
tree457fddabcc00e6c1fc48513bafed100de12356e3 /generic/include
parent56a70faadd8266175535c49f9296c0976662e9d2 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'generic/include')
-rw-r--r--generic/include/clc/clc.h3
-rw-r--r--generic/include/clc/shared/clamp.h5
-rw-r--r--generic/include/clc/shared/clamp.inc1
3 files changed, 9 insertions, 0 deletions
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index f6668a3..80ecd01 100644
--- a/generic/include/clc/clc.h
+++ b/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/generic/include/clc/shared/clamp.h b/generic/include/clc/shared/clamp.h
new file mode 100644
index 0000000..5c2ebd0
--- /dev/null
+++ b/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/generic/include/clc/shared/clamp.inc b/generic/include/clc/shared/clamp.inc
new file mode 100644
index 0000000..3e3a435
--- /dev/null
+++ b/generic/include/clc/shared/clamp.inc
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL GENTYPE clamp(GENTYPE x, GENTYPE y, GENTYPE z);