1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefixes=VERDE %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX6789 %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s
6 define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s) {
7 ; VERDE-LABEL: sample_cd_1d:
8 ; VERDE: ; %bb.0: ; %main_body
9 ; VERDE-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
10 ; VERDE-NEXT: s_waitcnt vmcnt(0)
11 ; VERDE-NEXT: ; return to shader part epilog
13 ; GFX6789-LABEL: sample_cd_1d:
14 ; GFX6789: ; %bb.0: ; %main_body
15 ; GFX6789-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
16 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
17 ; GFX6789-NEXT: ; return to shader part epilog
19 ; GFX10-LABEL: sample_cd_1d:
20 ; GFX10: ; %bb.0: ; %main_body
21 ; GFX10-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D
22 ; GFX10-NEXT: s_waitcnt vmcnt(0)
23 ; GFX10-NEXT: ; return to shader part epilog
25 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
29 define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
30 ; VERDE-LABEL: sample_cd_2d:
31 ; VERDE: ; %bb.0: ; %main_body
32 ; VERDE-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf
33 ; VERDE-NEXT: s_waitcnt vmcnt(0)
34 ; VERDE-NEXT: ; return to shader part epilog
36 ; GFX6789-LABEL: sample_cd_2d:
37 ; GFX6789: ; %bb.0: ; %main_body
38 ; GFX6789-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf
39 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
40 ; GFX6789-NEXT: ; return to shader part epilog
42 ; GFX10-LABEL: sample_cd_2d:
43 ; GFX10: ; %bb.0: ; %main_body
44 ; GFX10-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
45 ; GFX10-NEXT: s_waitcnt vmcnt(0)
46 ; GFX10-NEXT: ; return to shader part epilog
48 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
52 define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {
53 ; VERDE-LABEL: sample_c_cd_1d:
54 ; VERDE: ; %bb.0: ; %main_body
55 ; VERDE-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
56 ; VERDE-NEXT: s_waitcnt vmcnt(0)
57 ; VERDE-NEXT: ; return to shader part epilog
59 ; GFX6789-LABEL: sample_c_cd_1d:
60 ; GFX6789: ; %bb.0: ; %main_body
61 ; GFX6789-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
62 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
63 ; GFX6789-NEXT: ; return to shader part epilog
65 ; GFX10-LABEL: sample_c_cd_1d:
66 ; GFX10: ; %bb.0: ; %main_body
67 ; GFX10-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D
68 ; GFX10-NEXT: s_waitcnt vmcnt(0)
69 ; GFX10-NEXT: ; return to shader part epilog
71 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
75 define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
76 ; VERDE-LABEL: sample_c_cd_2d:
77 ; VERDE: ; %bb.0: ; %main_body
78 ; VERDE-NEXT: image_sample_c_cd v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf
79 ; VERDE-NEXT: s_waitcnt vmcnt(0)
80 ; VERDE-NEXT: ; return to shader part epilog
82 ; GFX6789-LABEL: sample_c_cd_2d:
83 ; GFX6789: ; %bb.0: ; %main_body
84 ; GFX6789-NEXT: image_sample_c_cd v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf
85 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
86 ; GFX6789-NEXT: ; return to shader part epilog
88 ; GFX10-LABEL: sample_c_cd_2d:
89 ; GFX10: ; %bb.0: ; %main_body
90 ; GFX10-NEXT: image_sample_c_cd v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
91 ; GFX10-NEXT: s_waitcnt vmcnt(0)
92 ; GFX10-NEXT: ; return to shader part epilog
94 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
98 define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s, float %clamp) {
99 ; VERDE-LABEL: sample_cd_cl_1d:
100 ; VERDE: ; %bb.0: ; %main_body
101 ; VERDE-NEXT: image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
102 ; VERDE-NEXT: s_waitcnt vmcnt(0)
103 ; VERDE-NEXT: ; return to shader part epilog
105 ; GFX6789-LABEL: sample_cd_cl_1d:
106 ; GFX6789: ; %bb.0: ; %main_body
107 ; GFX6789-NEXT: image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
108 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
109 ; GFX6789-NEXT: ; return to shader part epilog
111 ; GFX10-LABEL: sample_cd_cl_1d:
112 ; GFX10: ; %bb.0: ; %main_body
113 ; GFX10-NEXT: image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D
114 ; GFX10-NEXT: s_waitcnt vmcnt(0)
115 ; GFX10-NEXT: ; return to shader part epilog
117 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
121 define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {
122 ; VERDE-LABEL: sample_cd_cl_2d:
123 ; VERDE: ; %bb.0: ; %main_body
124 ; VERDE-NEXT: image_sample_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf
125 ; VERDE-NEXT: s_waitcnt vmcnt(0)
126 ; VERDE-NEXT: ; return to shader part epilog
128 ; GFX6789-LABEL: sample_cd_cl_2d:
129 ; GFX6789: ; %bb.0: ; %main_body
130 ; GFX6789-NEXT: image_sample_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf
131 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
132 ; GFX6789-NEXT: ; return to shader part epilog
134 ; GFX10-LABEL: sample_cd_cl_2d:
135 ; GFX10: ; %bb.0: ; %main_body
136 ; GFX10-NEXT: image_sample_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
137 ; GFX10-NEXT: s_waitcnt vmcnt(0)
138 ; GFX10-NEXT: ; return to shader part epilog
140 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
144 define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp) {
145 ; VERDE-LABEL: sample_c_cd_cl_1d:
146 ; VERDE: ; %bb.0: ; %main_body
147 ; VERDE-NEXT: image_sample_c_cd_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf
148 ; VERDE-NEXT: s_waitcnt vmcnt(0)
149 ; VERDE-NEXT: ; return to shader part epilog
151 ; GFX6789-LABEL: sample_c_cd_cl_1d:
152 ; GFX6789: ; %bb.0: ; %main_body
153 ; GFX6789-NEXT: image_sample_c_cd_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf
154 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
155 ; GFX6789-NEXT: ; return to shader part epilog
157 ; GFX10-LABEL: sample_c_cd_cl_1d:
158 ; GFX10: ; %bb.0: ; %main_body
159 ; GFX10-NEXT: image_sample_c_cd_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D
160 ; GFX10-NEXT: s_waitcnt vmcnt(0)
161 ; GFX10-NEXT: ; return to shader part epilog
163 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
167 declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
168 declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
169 declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
170 declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
171 declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
172 declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
173 declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
174 declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
176 attributes #0 = { nounwind }
177 attributes #1 = { nounwind readonly }
178 attributes #2 = { nounwind readnone }