Changpeng Fang | fb9c381 | 2016-08-10 21:15:30 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=GCN %s |
| 2 | ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck --check-prefix=GCN %s |
| 3 | |
| 4 | ; GCN-LABEL: {{^}}sample: |
| 5 | ; GCN: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 6 | define void @sample(<4 x float> addrspace(1)* %out) { |
| 7 | main_body: |
| 8 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 9 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 10 | ret void |
| 11 | } |
| 12 | |
| 13 | ; GCN-LABEL: {{^}}sample_cl: |
| 14 | ; GCN: image_sample_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 15 | define void @sample_cl(<4 x float> addrspace(1)* %out) { |
| 16 | main_body: |
| 17 | %r = call <4 x float> @llvm.amdgcn.image.sample.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 18 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 19 | ret void |
| 20 | } |
| 21 | |
| 22 | ; GCN-LABEL: {{^}}sample_d: |
| 23 | ; GCN: image_sample_d {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 24 | define void @sample_d(<4 x float> addrspace(1)* %out) { |
| 25 | main_body: |
| 26 | %r = call <4 x float> @llvm.amdgcn.image.sample.d.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 27 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 28 | ret void |
| 29 | } |
| 30 | |
| 31 | ; GCN-LABEL: {{^}}sample_d_cl: |
| 32 | ; GCN: image_sample_d_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 33 | define void @sample_d_cl(<4 x float> addrspace(1)* %out) { |
| 34 | main_body: |
| 35 | %r = call <4 x float> @llvm.amdgcn.image.sample.d.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 36 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 37 | ret void |
| 38 | } |
| 39 | |
| 40 | ; GCN-LABEL: {{^}}sample_l: |
| 41 | ; GCN: image_sample_l {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 42 | define void @sample_l(<4 x float> addrspace(1)* %out) { |
| 43 | main_body: |
| 44 | %r = call <4 x float> @llvm.amdgcn.image.sample.l.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 45 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 46 | ret void |
| 47 | } |
| 48 | |
| 49 | ; GCN-LABEL: {{^}}sample_b: |
| 50 | ; GCN: image_sample_b {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 51 | define void @sample_b(<4 x float> addrspace(1)* %out) { |
| 52 | main_body: |
| 53 | %r = call <4 x float> @llvm.amdgcn.image.sample.b.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 54 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 55 | ret void |
| 56 | } |
| 57 | |
| 58 | ; GCN-LABEL: {{^}}sample_b_cl: |
| 59 | ; GCN: image_sample_b_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 60 | define void @sample_b_cl(<4 x float> addrspace(1)* %out) { |
| 61 | main_body: |
| 62 | %r = call <4 x float> @llvm.amdgcn.image.sample.b.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 63 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 64 | ret void |
| 65 | } |
| 66 | |
| 67 | ; GCN-LABEL: {{^}}sample_lz: |
| 68 | ; GCN: image_sample_lz {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 69 | define void @sample_lz(<4 x float> addrspace(1)* %out) { |
| 70 | main_body: |
| 71 | %r = call <4 x float> @llvm.amdgcn.image.sample.lz.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 72 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 73 | ret void |
| 74 | } |
| 75 | |
| 76 | ; GCN-LABEL: {{^}}sample_cd: |
| 77 | ; GCN: image_sample_cd {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 78 | define void @sample_cd(<4 x float> addrspace(1)* %out) { |
| 79 | main_body: |
| 80 | %r = call <4 x float> @llvm.amdgcn.image.sample.cd.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 81 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 82 | ret void |
| 83 | } |
| 84 | |
| 85 | ; GCN-LABEL: {{^}}sample_cd_cl: |
| 86 | ; GCN: image_sample_cd_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 87 | define void @sample_cd_cl(<4 x float> addrspace(1)* %out) { |
| 88 | main_body: |
| 89 | %r = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 90 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 91 | ret void |
| 92 | } |
| 93 | |
| 94 | ; GCN-LABEL: {{^}}sample_c: |
| 95 | ; GCN: image_sample_c {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 96 | define void @sample_c(<4 x float> addrspace(1)* %out) { |
| 97 | main_body: |
| 98 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 99 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 100 | ret void |
| 101 | } |
| 102 | |
| 103 | ; GCN-LABEL: {{^}}sample_c_cl: |
| 104 | ; GCN: image_sample_c_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 105 | define void @sample_c_cl(<4 x float> addrspace(1)* %out) { |
| 106 | main_body: |
| 107 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 108 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 109 | ret void |
| 110 | } |
| 111 | |
| 112 | ; GCN-LABEL: {{^}}sample_c_d: |
| 113 | ; GCN: image_sample_c_d {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 114 | define void @sample_c_d(<4 x float> addrspace(1)* %out) { |
| 115 | main_body: |
| 116 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.d.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 117 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 118 | ret void |
| 119 | } |
| 120 | |
| 121 | ; GCN-LABEL: {{^}}sample_c_d_cl: |
| 122 | ; GCN: image_sample_c_d_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 123 | define void @sample_c_d_cl(<4 x float> addrspace(1)* %out) { |
| 124 | main_body: |
| 125 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 126 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 127 | ret void |
| 128 | } |
| 129 | |
| 130 | ; GCN-LABEL: {{^}}sample_c_l: |
| 131 | ; GCN: image_sample_c_l {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 132 | define void @sample_c_l(<4 x float> addrspace(1)* %out) { |
| 133 | main_body: |
| 134 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.l.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 135 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 136 | ret void |
| 137 | } |
| 138 | |
| 139 | ; GCN-LABEL: {{^}}sample_c_b: |
| 140 | ; GCN: image_sample_c_b {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 141 | define void @sample_c_b(<4 x float> addrspace(1)* %out) { |
| 142 | main_body: |
| 143 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.b.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 144 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 145 | ret void |
| 146 | } |
| 147 | |
| 148 | ; GCN-LABEL: {{^}}sample_c_b_cl: |
| 149 | ; GCN: image_sample_c_b_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 150 | define void @sample_c_b_cl(<4 x float> addrspace(1)* %out) { |
| 151 | main_body: |
| 152 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 153 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 154 | ret void |
| 155 | } |
| 156 | |
| 157 | ; GCN-LABEL: {{^}}sample_c_lz: |
| 158 | ; GCN: image_sample_c_lz {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 159 | define void @sample_c_lz(<4 x float> addrspace(1)* %out) { |
| 160 | main_body: |
| 161 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.lz.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 162 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 163 | ret void |
| 164 | } |
| 165 | |
| 166 | ; GCN-LABEL: {{^}}sample_c_cd: |
| 167 | ; GCN: image_sample_c_cd {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 168 | define void @sample_c_cd(<4 x float> addrspace(1)* %out) { |
| 169 | main_body: |
| 170 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.cd.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 171 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 172 | ret void |
| 173 | } |
| 174 | |
| 175 | ; GCN-LABEL: {{^}}sample_c_cd_cl: |
| 176 | ; GCN: image_sample_c_cd_cl {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf |
| 177 | define void @sample_c_cd_cl(<4 x float> addrspace(1)* %out) { |
| 178 | main_body: |
| 179 | %r = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 180 | store <4 x float> %r, <4 x float> addrspace(1)* %out |
| 181 | ret void |
| 182 | } |
| 183 | |
Changpeng Fang | 8236fe1 | 2016-11-14 18:33:18 +0000 | [diff] [blame] | 184 | ; GCN-LABEL: {{^}}sample_f32: |
| 185 | ; GCN: image_sample {{v[0-9]+}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0x1 |
| 186 | define void @sample_f32(float addrspace(1)* %out) { |
| 187 | main_body: |
| 188 | %r = call float @llvm.amdgcn.image.sample.f32.v2f32.v8i32(<2 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 1, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 189 | store float %r, float addrspace(1)* %out |
| 190 | ret void |
| 191 | } |
| 192 | |
| 193 | ; GCN-LABEL: {{^}}sample_v2f32: |
| 194 | ; GCN: image_sample {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0x3 |
| 195 | define void @sample_v2f32(<2 x float> addrspace(1)* %out) { |
| 196 | main_body: |
| 197 | %r = call <2 x float> @llvm.amdgcn.image.sample.v2f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 3, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 198 | store <2 x float> %r, <2 x float> addrspace(1)* %out |
| 199 | ret void |
| 200 | } |
Changpeng Fang | fb9c381 | 2016-08-10 21:15:30 +0000 | [diff] [blame] | 201 | |
Matt Arsenault | 93e65ea | 2017-02-22 21:16:41 +0000 | [diff] [blame^] | 202 | ; GCN-LABEL: {{^}}adjust_writemask_sample_0: |
| 203 | ; GCN: image_sample v{{[0-9]+}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0x1{{$}} |
| 204 | define void @adjust_writemask_sample_0(float addrspace(1)* %out) { |
| 205 | main_body: |
| 206 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 207 | %elt0 = extractelement <4 x float> %r, i32 0 |
| 208 | store float %elt0, float addrspace(1)* %out |
| 209 | ret void |
| 210 | } |
| 211 | |
| 212 | ; GCN-LABEL: {{^}}adjust_writemask_sample_01: |
| 213 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0x3{{$}} |
| 214 | define void @adjust_writemask_sample_01(float addrspace(1)* %out) { |
| 215 | main_body: |
| 216 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 217 | %elt0 = extractelement <4 x float> %r, i32 0 |
| 218 | %elt1 = extractelement <4 x float> %r, i32 1 |
| 219 | store volatile float %elt0, float addrspace(1)* %out |
| 220 | store volatile float %elt1, float addrspace(1)* %out |
| 221 | ret void |
| 222 | } |
| 223 | |
| 224 | ; GCN-LABEL: {{^}}adjust_writemask_sample_012: |
| 225 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0x7{{$}} |
| 226 | define void @adjust_writemask_sample_012(float addrspace(1)* %out) { |
| 227 | main_body: |
| 228 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 229 | %elt0 = extractelement <4 x float> %r, i32 0 |
| 230 | %elt1 = extractelement <4 x float> %r, i32 1 |
| 231 | %elt2 = extractelement <4 x float> %r, i32 2 |
| 232 | store volatile float %elt0, float addrspace(1)* %out |
| 233 | store volatile float %elt1, float addrspace(1)* %out |
| 234 | store volatile float %elt2, float addrspace(1)* %out |
| 235 | ret void |
| 236 | } |
| 237 | |
| 238 | ; GCN-LABEL: {{^}}adjust_writemask_sample_12: |
| 239 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0x6{{$}} |
| 240 | define void @adjust_writemask_sample_12(float addrspace(1)* %out) { |
| 241 | main_body: |
| 242 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 243 | %elt1 = extractelement <4 x float> %r, i32 1 |
| 244 | %elt2 = extractelement <4 x float> %r, i32 2 |
| 245 | store volatile float %elt1, float addrspace(1)* %out |
| 246 | store volatile float %elt2, float addrspace(1)* %out |
| 247 | ret void |
| 248 | } |
| 249 | |
| 250 | ; GCN-LABEL: {{^}}adjust_writemask_sample_03: |
| 251 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0x9{{$}} |
| 252 | define void @adjust_writemask_sample_03(float addrspace(1)* %out) { |
| 253 | main_body: |
| 254 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 255 | %elt0 = extractelement <4 x float> %r, i32 0 |
| 256 | %elt3 = extractelement <4 x float> %r, i32 3 |
| 257 | store volatile float %elt0, float addrspace(1)* %out |
| 258 | store volatile float %elt3, float addrspace(1)* %out |
| 259 | ret void |
| 260 | } |
| 261 | |
| 262 | ; GCN-LABEL: {{^}}adjust_writemask_sample_13: |
| 263 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0xa{{$}} |
| 264 | define void @adjust_writemask_sample_13(float addrspace(1)* %out) { |
| 265 | main_body: |
| 266 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 267 | %elt1 = extractelement <4 x float> %r, i32 1 |
| 268 | %elt3 = extractelement <4 x float> %r, i32 3 |
| 269 | store volatile float %elt1, float addrspace(1)* %out |
| 270 | store volatile float %elt3, float addrspace(1)* %out |
| 271 | ret void |
| 272 | } |
| 273 | |
| 274 | ; GCN-LABEL: {{^}}adjust_writemask_sample_123: |
| 275 | ; GCN: image_sample v{{\[[0-9]+:[0-9]+\]}}, v{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}}, s{{\[[0-9]+:[0-9]+\]}} dmask:0xe{{$}} |
| 276 | define void @adjust_writemask_sample_123(float addrspace(1)* %out) { |
| 277 | main_body: |
| 278 | %r = call <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 0) |
| 279 | %elt1 = extractelement <4 x float> %r, i32 1 |
| 280 | %elt2 = extractelement <4 x float> %r, i32 2 |
| 281 | %elt3 = extractelement <4 x float> %r, i32 3 |
| 282 | store volatile float %elt1, float addrspace(1)* %out |
| 283 | store volatile float %elt2, float addrspace(1)* %out |
| 284 | store volatile float %elt3, float addrspace(1)* %out |
| 285 | ret void |
| 286 | } |
| 287 | |
Changpeng Fang | fb9c381 | 2016-08-10 21:15:30 +0000 | [diff] [blame] | 288 | declare <4 x float> @llvm.amdgcn.image.sample.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 289 | declare <4 x float> @llvm.amdgcn.image.sample.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 290 | declare <4 x float> @llvm.amdgcn.image.sample.d.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 291 | declare <4 x float> @llvm.amdgcn.image.sample.d.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 292 | declare <4 x float> @llvm.amdgcn.image.sample.l.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 293 | declare <4 x float> @llvm.amdgcn.image.sample.b.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 294 | declare <4 x float> @llvm.amdgcn.image.sample.b.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 295 | declare <4 x float> @llvm.amdgcn.image.sample.lz.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 296 | declare <4 x float> @llvm.amdgcn.image.sample.cd.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 297 | declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 298 | |
| 299 | declare <4 x float> @llvm.amdgcn.image.sample.c.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 300 | declare <4 x float> @llvm.amdgcn.image.sample.c.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 301 | declare <4 x float> @llvm.amdgcn.image.sample.c.d.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 302 | declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 303 | declare <4 x float> @llvm.amdgcn.image.sample.c.l.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 304 | declare <4 x float> @llvm.amdgcn.image.sample.c.b.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 305 | declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 306 | declare <4 x float> @llvm.amdgcn.image.sample.c.lz.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 307 | declare <4 x float> @llvm.amdgcn.image.sample.c.cd.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 308 | declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 309 | |
Changpeng Fang | 8236fe1 | 2016-11-14 18:33:18 +0000 | [diff] [blame] | 310 | declare float @llvm.amdgcn.image.sample.f32.v2f32.v8i32(<2 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
| 311 | declare <2 x float> @llvm.amdgcn.image.sample.v2f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0 |
Changpeng Fang | fb9c381 | 2016-08-10 21:15:30 +0000 | [diff] [blame] | 312 | |
| 313 | attributes #0 = { nounwind readnone } |