2015-01-07 02:00:21 +08:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=verde | FileCheck %s
|
2015-01-28 01:27:15 +08:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=tonga | FileCheck %s
|
2013-10-23 10:53:47 +08:00
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v1:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xd
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v1(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v2:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xb
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v2(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v3:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xe
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v3(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v4:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0x7
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v4(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v5:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xa
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v5(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v6:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0x6
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v6(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}v7:
|
2016-02-26 17:51:05 +08:00
|
|
|
; CHECK: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0x9
|
2016-04-07 03:40:20 +08:00
|
|
|
define amdgpu_ps void @v7(i32 %a1) {
|
2013-10-23 10:53:47 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <1 x i32> undef, i32 %a1, i32 0
|
2016-01-26 12:38:08 +08:00
|
|
|
%1 = call <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32> %0, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
|
2013-10-23 10:53:47 +08:00
|
|
|
%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
|
|
|
|
}
|
|
|
|
|
2016-01-26 12:38:08 +08:00
|
|
|
declare <4 x float> @llvm.SI.image.sample.v1i32(<1 x i32>, <8 x i32>, <4 x i32>, i32, i32, i32, i32, i32, i32, i32, i32) readnone
|
2013-10-23 10:53:47 +08:00
|
|
|
|
|
|
|
declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
|