2015-01-06 18:00:21 +00:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck %s
|
2015-01-27 17:27:15 +00:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s
|
2014-07-11 17:11:46 +00:00
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
;CHECK-LABEL: {{^}}image_load:
|
2014-11-05 14:50:53 +00:00
|
|
|
;CHECK: image_load {{v\[[0-9]+:[0-9]+\]}}, 15, 0, 0, 0, 0, 0, 0, 0, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}
|
2014-07-11 17:11:46 +00:00
|
|
|
define void @image_load() #0 {
|
|
|
|
main_body:
|
2014-07-11 17:11:52 +00:00
|
|
|
%r = call <4 x float> @llvm.SI.image.load.v4i32(<4 x i32> undef, <8 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2014-07-11 17:11:46 +00:00
|
|
|
%r0 = extractelement <4 x float> %r, i32 0
|
|
|
|
%r1 = extractelement <4 x float> %r, i32 1
|
|
|
|
%r2 = extractelement <4 x float> %r, i32 2
|
|
|
|
%r3 = extractelement <4 x float> %r, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %r0, float %r1, float %r2, float %r3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
;CHECK-LABEL: {{^}}image_load_mip:
|
2014-11-05 14:50:53 +00:00
|
|
|
;CHECK: image_load_mip {{v\[[0-9]+:[0-9]+\]}}, 15, 0, 0, 0, 0, 0, 0, 0, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}
|
2014-07-11 17:11:46 +00:00
|
|
|
define void @image_load_mip() #0 {
|
|
|
|
main_body:
|
2014-07-11 17:11:52 +00:00
|
|
|
%r = call <4 x float> @llvm.SI.image.load.mip.v4i32(<4 x i32> undef, <8 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2014-07-11 17:11:46 +00:00
|
|
|
%r0 = extractelement <4 x float> %r, i32 0
|
|
|
|
%r1 = extractelement <4 x float> %r, i32 1
|
|
|
|
%r2 = extractelement <4 x float> %r, i32 2
|
|
|
|
%r3 = extractelement <4 x float> %r, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %r0, float %r1, float %r2, float %r3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
;CHECK-LABEL: {{^}}getresinfo:
|
2014-11-05 14:50:53 +00:00
|
|
|
;CHECK: image_get_resinfo {{v\[[0-9]+:[0-9]+\]}}, 15, 0, 0, 0, 0, 0, 0, 0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}
|
2014-07-11 17:11:46 +00:00
|
|
|
define void @getresinfo() #0 {
|
|
|
|
main_body:
|
2014-07-11 17:11:52 +00:00
|
|
|
%r = call <4 x float> @llvm.SI.getresinfo.i32(i32 undef, <8 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2014-07-11 17:11:46 +00:00
|
|
|
%r0 = extractelement <4 x float> %r, i32 0
|
|
|
|
%r1 = extractelement <4 x float> %r, i32 1
|
|
|
|
%r2 = extractelement <4 x float> %r, i32 2
|
|
|
|
%r3 = extractelement <4 x float> %r, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %r0, float %r1, float %r2, float %r3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-07-11 17:11:52 +00:00
|
|
|
declare <4 x float> @llvm.SI.image.load.v4i32(<4 x i32>, <8 x i32>, i32, i32, i32, i32, i32, i32, i32, i32) #1
|
|
|
|
declare <4 x float> @llvm.SI.image.load.mip.v4i32(<4 x i32>, <8 x i32>, i32, i32, i32, i32, i32, i32, i32, i32) #1
|
|
|
|
declare <4 x float> @llvm.SI.getresinfo.i32(i32, <8 x i32>, i32, i32, i32, i32, i32, i32, i32, i32) #1
|
2014-07-11 17:11:46 +00:00
|
|
|
|
|
|
|
declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
|
|
|
|
|
|
|
|
attributes #0 = { "ShaderType"="0" }
|
|
|
|
attributes #1 = { nounwind readnone }
|