diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:21:44 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:21:44 +0000 |
| commit | 075b31a2fa8b5405ce8c1afa736cd240016f1ec8 (patch) | |
| tree | 1380fe587234faf8e9ea855847a43fda88cedfba /libclc/generic/lib/shared | |
| parent | 0be3acfc7067d6f1d951735f8d7d3c5e1c0a316c (diff) | |
| download | bcm5719-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.inc | 6 |
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 |

