summaryrefslogtreecommitdiff
path: root/generic/lib
diff options
context:
space:
mode:
Diffstat (limited to 'generic/lib')
-rw-r--r--generic/lib/shared/clamp.inc6
-rw-r--r--generic/lib/shared/max.inc6
2 files changed, 12 insertions, 0 deletions
diff --git a/generic/lib/shared/clamp.inc b/generic/lib/shared/clamp.inc
index ed49b8e..58370d3 100644
--- a/generic/lib/shared/clamp.inc
+++ b/generic/lib/shared/clamp.inc
@@ -1,3 +1,9 @@
_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, GENTYPE y, GENTYPE z) {
return (x > z ? z : (x < y ? y : x));
}
+
+#ifndef SCALAR
+_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, SCALAR_GENTYPE y, SCALAR_GENTYPE z) {
+ return (x > (GENTYPE)z ? (GENTYPE)z : (x < (GENTYPE)y ? (GENTYPE)y : x));
+}
+#endif \ No newline at end of file
diff --git a/generic/lib/shared/max.inc b/generic/lib/shared/max.inc
index 37409fc..6a12b6f 100644
--- a/generic/lib/shared/max.inc
+++ b/generic/lib/shared/max.inc
@@ -1,3 +1,9 @@
_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) {
return (a > b ? a : b);
}
+
+#ifndef SCALAR
+_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, SCALAR_GENTYPE b) {
+ return (a > (GENTYPE)b ? a : (GENTYPE)b);
+}
+#endif \ No newline at end of file