[libclc] r187059 - Added get_num_groups
Aaron Watry
awatry at gmail.com
Wed Jul 24 11:03:38 PDT 2013
Author: awatry
Date: Wed Jul 24 13:03:38 2013
New Revision: 187059
URL: http://llvm.org/viewvc/llvm-project?rev=187059&view=rev
Log:
Added get_num_groups
The get_num_groups function was missing for r600g. I did the same
thing as the other workitem functions.
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Reviewed-by: Aaron Watry <awatry at gmail.com>
Added:
libclc/trunk/r600/lib/workitem/get_num_groups.ll
Modified:
libclc/trunk/r600/lib/SOURCES
Modified: libclc/trunk/r600/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=187059&r1=187058&r2=187059&view=diff
==============================================================================
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Wed Jul 24 13:03:38 2013
@@ -1,3 +1,4 @@
+workitem/get_num_groups.ll
workitem/get_group_id.ll
workitem/get_local_size.ll
workitem/get_local_id.ll
Added: libclc/trunk/r600/lib/workitem/get_num_groups.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_num_groups.ll?rev=187059&view=auto
==============================================================================
--- libclc/trunk/r600/lib/workitem/get_num_groups.ll (added)
+++ libclc/trunk/r600/lib/workitem/get_num_groups.ll Wed Jul 24 13:03:38 2013
@@ -0,0 +1,18 @@
+declare i32 @llvm.r600.read.ngroups.x() nounwind readnone
+declare i32 @llvm.r600.read.ngroups.y() nounwind readnone
+declare i32 @llvm.r600.read.ngroups.z() nounwind readnone
+
+define i32 @get_num_groups(i32 %dim) nounwind readnone alwaysinline {
+ switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim]
+x_dim:
+ %x = call i32 @llvm.r600.read.ngroups.x() nounwind readnone
+ ret i32 %x
+y_dim:
+ %y = call i32 @llvm.r600.read.ngroups.y() nounwind readnone
+ ret i32 %y
+z_dim:
+ %z = call i32 @llvm.r600.read.ngroups.z() nounwind readnone
+ ret i32 %z
+default:
+ ret i32 0
+}
More information about the cfe-commits
mailing list