summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/shared
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-26 18:21:44 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-26 18:21:44 +0000
commit075b31a2fa8b5405ce8c1afa736cd240016f1ec8 (patch)
tree1380fe587234faf8e9ea855847a43fda88cedfba /libclc/generic/lib/shared
parent0be3acfc7067d6f1d951735f8d7d3c5e1c0a316c (diff)
downloadbcm5719-llvm-075b31a2fa8b5405ce8c1afa736cd240016f1ec8.tar.gz
bcm5719-llvm-075b31a2fa8b5405ce8c1afa736cd240016f1ec8.zip
libclc: Implement the min(vec, scalar) version of the min builtin.
Checks if the current GENTYPE is scalar, and if not, then defines a separate implementation of the function which casts the second arg to vector before proceeding. Patch by: Aaron Watry llvm-svn: 185002
Diffstat (limited to 'libclc/generic/lib/shared')
-rw-r--r--libclc/generic/lib/shared/min.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libclc/generic/lib/shared/min.inc b/libclc/generic/lib/shared/min.inc
index b99bc35f7bc..58a22e1b6e2 100644
--- a/libclc/generic/lib/shared/min.inc
+++ b/libclc/generic/lib/shared/min.inc
@@ -1,3 +1,9 @@
_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, GENTYPE b) {
return (a < b ? a : b);
}
+
+#ifndef SCALAR
+_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, SCALAR_GENTYPE b) {
+ return (a < (GENTYPE)b ? a : (GENTYPE)b);
+}
+#endif
OpenPOWER on IntegriCloud