summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/integer/clz_if.ll
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
commite78344dfae4abb858bb04bc1fcafb57f4bd9f49d (patch)
tree23ab99d482d158be55a84acc311107753141030f /libclc/generic/lib/integer/clz_if.ll
parent34f513df7c06ac786dc9389e80217f95677ea1d5 (diff)
downloadbcm5719-llvm-e78344dfae4abb858bb04bc1fcafb57f4bd9f49d.tar.gz
bcm5719-llvm-e78344dfae4abb858bb04bc1fcafb57f4bd9f49d.zip
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 llvm-svn: 185004
Diffstat (limited to 'libclc/generic/lib/integer/clz_if.ll')
-rw-r--r--libclc/generic/lib/integer/clz_if.ll55
1 files changed, 55 insertions, 0 deletions
diff --git a/libclc/generic/lib/integer/clz_if.ll b/libclc/generic/lib/integer/clz_if.ll
new file mode 100644
index 00000000000..23dfc74a8a8
--- /dev/null
+++ b/libclc/generic/lib/integer/clz_if.ll
@@ -0,0 +1,55 @@
+declare i8 @__clc_clz_impl_s8(i8 %x)
+
+define i8 @__clc_clz_s8(i8 %x) nounwind readnone alwaysinline {
+ %call = call i8 @__clc_clz_impl_s8(i8 %x)
+ ret i8 %call
+}
+
+declare i8 @__clc_clz_impl_u8(i8 %x)
+
+define i8 @__clc_clz_u8(i8 %x) nounwind readnone alwaysinline {
+ %call = call i8 @__clc_clz_impl_u8(i8 %x)
+ ret i8 %call
+}
+
+declare i16 @__clc_clz_impl_s16(i16 %x)
+
+define i16 @__clc_clz_s16(i16 %x) nounwind readnone alwaysinline {
+ %call = call i16 @__clc_clz_impl_s16(i16 %x)
+ ret i16 %call
+}
+
+declare i16 @__clc_clz_impl_u16(i16 %x)
+
+define i16 @__clc_clz_u16(i16 %x) nounwind readnone alwaysinline {
+ %call = call i16 @__clc_clz_impl_u16(i16 %x)
+ ret i16 %call
+}
+
+declare i32 @__clc_clz_impl_s32(i32 %x)
+
+define i32 @__clc_clz_s32(i32 %x) nounwind readnone alwaysinline {
+ %call = call i32 @__clc_clz_impl_s32(i32 %x)
+ ret i32 %call
+}
+
+declare i32 @__clc_clz_impl_u32(i32 %x)
+
+define i32 @__clc_clz_u32(i32 %x) nounwind readnone alwaysinline {
+ %call = call i32 @__clc_clz_impl_u32(i32 %x)
+ ret i32 %call
+}
+
+declare i64 @__clc_clz_impl_s64(i64 %x)
+
+define i64 @__clc_clz_s64(i64 %x) nounwind readnone alwaysinline {
+ %call = call i64 @__clc_clz_impl_s64(i64 %x)
+ ret i64 %call
+}
+
+declare i64 @__clc_clz_impl_u64(i64 %x)
+
+define i64 @__clc_clz_u64(i64 %x) nounwind readnone alwaysinline {
+ %call = call i64 @__clc_clz_impl_u64(i64 %x)
+ ret i64 %call
+}
OpenPOWER on IntegriCloud