2013-10-23 02:53:47 +00:00
|
|
|
;RUN: llc < %s -march=r600 -mcpu=verde | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v1
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 13
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v1(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 0
|
|
|
|
%3 = extractelement <4 x float> %1, i32 2
|
|
|
|
%4 = extractelement <4 x float> %1, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %4, float %4)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v2
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 11
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v2(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 0
|
|
|
|
%3 = extractelement <4 x float> %1, i32 1
|
|
|
|
%4 = extractelement <4 x float> %1, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %4, float %4)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v3
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 14
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v3(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 1
|
|
|
|
%3 = extractelement <4 x float> %1, i32 2
|
|
|
|
%4 = extractelement <4 x float> %1, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %4, float %4)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v4
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 7
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v4(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 0
|
|
|
|
%3 = extractelement <4 x float> %1, i32 1
|
|
|
|
%4 = extractelement <4 x float> %1, i32 2
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %4, float %4)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v5
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 10
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v5(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 1
|
|
|
|
%3 = extractelement <4 x float> %1, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %3, float %3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v6
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 6
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v6(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 1
|
|
|
|
%3 = extractelement <4 x float> %1, i32 2
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %3, float %3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: @v7
|
2013-11-12 02:35:51 +00:00
|
|
|
; CHECK: IMAGE_SAMPLE {{v\[[0-9]+:[0-9]+\]}}, 9
|
2014-02-13 23:34:07 +00:00
|
|
|
define void @v7(i32 %a1) #0 {
|
2013-10-23 02:53:47 +00:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
|
|
|
%1 = call <4 x float> @llvm.SI.sample.v1i32(<1 x i32> %0, <32 x i8> undef, <16 x i8> undef, i32 0)
|
|
|
|
%2 = extractelement <4 x float> %1, i32 0
|
|
|
|
%3 = extractelement <4 x float> %1, i32 3
|
|
|
|
call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %2, float %3, float %3, float %3)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <4 x float> @llvm.SI.sample.v1i32(<1 x i32>, <32 x i8>, <16 x i8>, i32) readnone
|
|
|
|
|
|
|
|
declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
|
2014-02-13 23:34:07 +00:00
|
|
|
|
|
|
|
attributes #0 = { "ShaderType"="0" }
|