summaryrefslogtreecommitdiff
path: root/generic/include
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-26 18:21:55 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-26 18:21:55 +0000
commit80f66b1b0e84b953e0cd55984beaff616617394f (patch)
tree835c34a7a2fe81b97e1a992656a37f79b0fb8844 /generic/include
parent7424a799130628aae0c61e78299e4f5e06b2bd74 (diff)
libclc: Implement clz() builtin
Squashed commit of the following: commit a0df0a0e86c55c1bdc0b9c0f5a739e5adef4b056 Author: Aaron Watry <awatry@gmail.com> Date: Mon Apr 15 18:42:04 2013 -0500 libclc: Rename clz.ll to clz_if.ll to ensure it gets built. configure.py treats files that have the same name with the .cl and .ll extensions as overriding eachother. E.g. If you have clz.cl and clz.ll both specified to be built in the same SOURCES file, only the first file listed will actually be built. Since the contents of clz.ll were an interface that is implemented in clz_impl.ll, rename clz.ll to clz_if.ll to make sure that the interface is built. commit 931b62bed05c58f737de625bd415af09571a6a5a Author: Aaron Watry <awatry@gmail.com> Date: Sat Apr 13 12:32:54 2013 -0500 libclc: llvm assembly implementation of clz Untested... currently crashes in the same manner as add_sat. commit 6ef0b7b0b6d2e5584086b4b9a9243743b2e0538f Author: Aaron Watry <awatry@gmail.com> Date: Sat Mar 23 12:35:27 2013 -0500 libclc: Add stub clz builtin For scalar int/uint, attempt to use the clz llvm builtin.. for all others return 0 until an actual implementation is finished. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'generic/include')
-rw-r--r--generic/include/clc/clc.h1
-rw-r--r--generic/include/clc/integer/clz.h2
-rw-r--r--generic/include/clc/integer/clz.inc1
3 files changed, 4 insertions, 0 deletions
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 74f1126..d2858a8 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -63,6 +63,7 @@
#include <clc/integer/abs.h>
#include <clc/integer/abs_diff.h>
#include <clc/integer/add_sat.h>
+#include <clc/integer/clz.h>
#include <clc/integer/rotate.h>
#include <clc/integer/sub_sat.h>
diff --git a/generic/include/clc/integer/clz.h b/generic/include/clc/integer/clz.h
new file mode 100644
index 0000000..5708eb4
--- /dev/null
+++ b/generic/include/clc/integer/clz.h
@@ -0,0 +1,2 @@
+#define BODY <clc/integer/clz.inc>
+#include <clc/integer/gentype.inc>
diff --git a/generic/include/clc/integer/clz.inc b/generic/include/clc/integer/clz.inc
new file mode 100644
index 0000000..ac73a31
--- /dev/null
+++ b/generic/include/clc/integer/clz.inc
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL GENTYPE clz(GENTYPE x);