1 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
3 %opencl.image2d_t = type opaque
4 %opencl.image3d_t = type opaque
6 declare i32 @llvm.OpenCL.image.get.resource.id.2d(
7 %opencl.image2d_t addrspace(1)*) nounwind readnone
8 declare i32 @llvm.OpenCL.image.get.resource.id.3d(
9 %opencl.image3d_t addrspace(1)*) nounwind readnone
11 declare void @llvm.r600.rat.store.typed(<4 x i32> %color, <4 x i32> %coord, i32 %rat_id)
13 define void @__clc_write_imageui_2d(
14 %opencl.image2d_t addrspace(1)* nocapture %img,
15 <2 x i32> %coord, <4 x i32> %color) #0 {
17 ; Coordinate int2 -> int4.
18 %e0 = extractelement <2 x i32> %coord, i32 0
19 %e1 = extractelement <2 x i32> %coord, i32 1
20 %coord.0 = insertelement <4 x i32> undef, i32 %e0, i32 0
21 %coord.1 = insertelement <4 x i32> %coord.0, i32 %e1, i32 1
22 %coord.2 = insertelement <4 x i32> %coord.1, i32 0, i32 2
23 %coord.3 = insertelement <4 x i32> %coord.2, i32 0, i32 3
26 %img_id = call i32 @llvm.OpenCL.image.get.resource.id.2d(
27 %opencl.image2d_t addrspace(1)* %img)
28 %rat_id = add i32 %img_id, 1
30 ; Call store intrinsic.
31 call void @llvm.r600.rat.store.typed(<4 x i32> %color, <4 x i32> %coord.3, i32 %rat_id)
35 define void @__clc_write_imagei_2d(
36 %opencl.image2d_t addrspace(1)* nocapture %img,
37 <2 x i32> %coord, <4 x i32> %color) #0 {
38 call void @__clc_write_imageui_2d(
39 %opencl.image2d_t addrspace(1)* nocapture %img,
40 <2 x i32> %coord, <4 x i32> %color)
44 define void @__clc_write_imagef_2d(
45 %opencl.image2d_t addrspace(1)* nocapture %img,
46 <2 x i32> %coord, <4 x float> %color) #0 {
47 %color.i32 = bitcast <4 x float> %color to <4 x i32>
48 call void @__clc_write_imageui_2d(
49 %opencl.image2d_t addrspace(1)* nocapture %img,
50 <2 x i32> %coord, <4 x i32> %color.i32)
54 attributes #0 = { alwaysinline }