Neil Henning | 63718b2 | 2018-10-31 10:34:48 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN %s |
| 2 | |
| 3 | ; GCN-LABEL: {{^}}load_1d: |
| 4 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 5 | define amdgpu_ps <4 x float> @load_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 6 | main_body: |
| 7 | %s = extractelement <2 x i16> %coords, i32 0 |
| 8 | %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 9 | ret <4 x float> %v |
| 10 | } |
| 11 | |
| 12 | ; GCN-LABEL: {{^}}load_2d: |
| 13 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 14 | define amdgpu_ps <4 x float> @load_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 15 | main_body: |
| 16 | %s = extractelement <2 x i16> %coords, i32 0 |
| 17 | %t = extractelement <2 x i16> %coords, i32 1 |
| 18 | %v = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0) |
| 19 | ret <4 x float> %v |
| 20 | } |
| 21 | |
| 22 | ; GCN-LABEL: {{^}}load_3d: |
| 23 | ; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 |
| 24 | define amdgpu_ps <4 x float> @load_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 25 | main_body: |
| 26 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 27 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 28 | %r = extractelement <2 x i16> %coords_hi, i32 0 |
| 29 | %v = call <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0) |
| 30 | ret <4 x float> %v |
| 31 | } |
| 32 | |
| 33 | ; GCN-LABEL: {{^}}load_cube: |
| 34 | ; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 35 | define amdgpu_ps <4 x float> @load_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 36 | main_body: |
| 37 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 38 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 39 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 40 | %v = call <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 41 | ret <4 x float> %v |
| 42 | } |
| 43 | |
| 44 | ; GCN-LABEL: {{^}}load_1darray: |
| 45 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 46 | define amdgpu_ps <4 x float> @load_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 47 | main_body: |
| 48 | %s = extractelement <2 x i16> %coords, i32 0 |
| 49 | %slice = extractelement <2 x i16> %coords, i32 1 |
| 50 | %v = call <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 51 | ret <4 x float> %v |
| 52 | } |
| 53 | |
| 54 | ; GCN-LABEL: {{^}}load_2darray: |
| 55 | ; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 56 | define amdgpu_ps <4 x float> @load_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 57 | main_body: |
| 58 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 59 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 60 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 61 | %v = call <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 62 | ret <4 x float> %v |
| 63 | } |
| 64 | |
| 65 | ; GCN-LABEL: {{^}}load_2dmsaa: |
| 66 | ; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 |
| 67 | define amdgpu_ps <4 x float> @load_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 68 | main_body: |
| 69 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 70 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 71 | %fragid = extractelement <2 x i16> %coords_hi, i32 0 |
| 72 | %v = call <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0) |
| 73 | ret <4 x float> %v |
| 74 | } |
| 75 | |
| 76 | ; GCN-LABEL: {{^}}load_2darraymsaa: |
| 77 | ; GCN: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 78 | define amdgpu_ps <4 x float> @load_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 79 | main_body: |
| 80 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 81 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 82 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 83 | %fragid = extractelement <2 x i16> %coords_hi, i32 1 |
| 84 | %v = call <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0) |
| 85 | ret <4 x float> %v |
| 86 | } |
| 87 | |
| 88 | ; GCN-LABEL: {{^}}load_mip_1d: |
| 89 | ; GCN: image_load_mip v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 90 | define amdgpu_ps <4 x float> @load_mip_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 91 | main_body: |
| 92 | %s = extractelement <2 x i16> %coords, i32 0 |
| 93 | %mip = extractelement <2 x i16> %coords, i32 1 |
| 94 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 95 | ret <4 x float> %v |
| 96 | } |
| 97 | |
| 98 | ; GCN-LABEL: {{^}}load_mip_2d: |
| 99 | ; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 |
| 100 | define amdgpu_ps <4 x float> @load_mip_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 101 | main_body: |
| 102 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 103 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 104 | %mip = extractelement <2 x i16> %coords_hi, i32 0 |
| 105 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 106 | ret <4 x float> %v |
| 107 | } |
| 108 | |
| 109 | ; GCN-LABEL: {{^}}load_mip_3d: |
| 110 | ; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 |
| 111 | define amdgpu_ps <4 x float> @load_mip_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 112 | main_body: |
| 113 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 114 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 115 | %r = extractelement <2 x i16> %coords_hi, i32 0 |
| 116 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 117 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 118 | ret <4 x float> %v |
| 119 | } |
| 120 | |
| 121 | ; GCN-LABEL: {{^}}load_mip_cube: |
| 122 | ; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 123 | define amdgpu_ps <4 x float> @load_mip_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 124 | main_body: |
| 125 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 126 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 127 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 128 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 129 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 130 | ret <4 x float> %v |
| 131 | } |
| 132 | |
| 133 | ; GCN-LABEL: {{^}}load_mip_1darray: |
| 134 | ; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 135 | define amdgpu_ps <4 x float> @load_mip_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 136 | main_body: |
| 137 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 138 | %slice = extractelement <2 x i16> %coords_lo, i32 1 |
| 139 | %mip = extractelement <2 x i16> %coords_hi, i32 0 |
| 140 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 141 | ret <4 x float> %v |
| 142 | } |
| 143 | |
| 144 | ; GCN-LABEL: {{^}}load_mip_2darray: |
| 145 | ; GCN: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 146 | define amdgpu_ps <4 x float> @load_mip_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 147 | main_body: |
| 148 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 149 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 150 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 151 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 152 | %v = call <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 153 | ret <4 x float> %v |
| 154 | } |
| 155 | |
| 156 | ; GCN-LABEL: {{^}}store_1d: |
| 157 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 |
| 158 | define amdgpu_ps void @store_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 159 | main_body: |
| 160 | %s = extractelement <2 x i16> %coords, i32 0 |
| 161 | call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 162 | ret void |
| 163 | } |
| 164 | |
| 165 | ; GCN-LABEL: {{^}}store_2d: |
| 166 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 |
| 167 | define amdgpu_ps void @store_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 168 | main_body: |
| 169 | %s = extractelement <2 x i16> %coords, i32 0 |
| 170 | %t = extractelement <2 x i16> %coords, i32 1 |
| 171 | call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0) |
| 172 | ret void |
| 173 | } |
| 174 | |
| 175 | ; GCN-LABEL: {{^}}store_3d: |
| 176 | ; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 |
| 177 | define amdgpu_ps void @store_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 178 | main_body: |
| 179 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 180 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 181 | %r = extractelement <2 x i16> %coords_hi, i32 0 |
| 182 | call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0) |
| 183 | ret void |
| 184 | } |
| 185 | |
| 186 | ; GCN-LABEL: {{^}}store_cube: |
| 187 | ; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 188 | define amdgpu_ps void @store_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 189 | main_body: |
| 190 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 191 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 192 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 193 | call void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 194 | ret void |
| 195 | } |
| 196 | |
| 197 | ; GCN-LABEL: {{^}}store_1darray: |
| 198 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 199 | define amdgpu_ps void @store_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 200 | main_body: |
| 201 | %s = extractelement <2 x i16> %coords, i32 0 |
| 202 | %slice = extractelement <2 x i16> %coords, i32 1 |
| 203 | call void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 204 | ret void |
| 205 | } |
| 206 | |
| 207 | ; GCN-LABEL: {{^}}store_2darray: |
| 208 | ; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 209 | define amdgpu_ps void @store_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 210 | main_body: |
| 211 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 212 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 213 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 214 | call void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0) |
| 215 | ret void |
| 216 | } |
| 217 | |
| 218 | ; GCN-LABEL: {{^}}store_2dmsaa: |
| 219 | ; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 |
| 220 | define amdgpu_ps void @store_2dmsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 221 | main_body: |
| 222 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 223 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 224 | %fragid = extractelement <2 x i16> %coords_hi, i32 0 |
| 225 | call void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0) |
| 226 | ret void |
| 227 | } |
| 228 | |
| 229 | ; GCN-LABEL: {{^}}store_2darraymsaa: |
| 230 | ; GCN: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 231 | define amdgpu_ps void @store_2darraymsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 232 | main_body: |
| 233 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 234 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 235 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 236 | %fragid = extractelement <2 x i16> %coords_hi, i32 1 |
| 237 | call void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0) |
| 238 | ret void |
| 239 | } |
| 240 | |
| 241 | ; GCN-LABEL: {{^}}store_mip_1d: |
| 242 | ; GCN: image_store_mip v[0:3], v4, s[0:7] dmask:0xf unorm a16 |
| 243 | define amdgpu_ps void @store_mip_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 244 | main_body: |
| 245 | %s = extractelement <2 x i16> %coords, i32 0 |
| 246 | %mip = extractelement <2 x i16> %coords, i32 1 |
| 247 | call void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 248 | ret void |
| 249 | } |
| 250 | |
| 251 | ; GCN-LABEL: {{^}}store_mip_2d: |
| 252 | ; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 |
| 253 | define amdgpu_ps void @store_mip_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 254 | main_body: |
| 255 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 256 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 257 | %mip = extractelement <2 x i16> %coords_hi, i32 0 |
| 258 | call void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 259 | ret void |
| 260 | } |
| 261 | |
| 262 | ; GCN-LABEL: {{^}}store_mip_3d: |
| 263 | ; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 |
| 264 | define amdgpu_ps void @store_mip_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 265 | main_body: |
| 266 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 267 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 268 | %r = extractelement <2 x i16> %coords_hi, i32 0 |
| 269 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 270 | call void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 271 | ret void |
| 272 | } |
| 273 | |
| 274 | ; GCN-LABEL: {{^}}store_mip_cube: |
| 275 | ; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 276 | define amdgpu_ps void @store_mip_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 277 | main_body: |
| 278 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 279 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 280 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 281 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 282 | call void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 283 | ret void |
| 284 | } |
| 285 | |
| 286 | ; GCN-LABEL: {{^}}store_mip_1darray: |
| 287 | ; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 288 | define amdgpu_ps void @store_mip_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 289 | main_body: |
| 290 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 291 | %slice = extractelement <2 x i16> %coords_lo, i32 1 |
| 292 | %mip = extractelement <2 x i16> %coords_hi, i32 0 |
| 293 | call void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 294 | ret void |
| 295 | } |
| 296 | |
| 297 | ; GCN-LABEL: {{^}}store_mip_2darray: |
| 298 | ; GCN: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da{{$}} |
| 299 | define amdgpu_ps void @store_mip_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) { |
| 300 | main_body: |
| 301 | %s = extractelement <2 x i16> %coords_lo, i32 0 |
| 302 | %t = extractelement <2 x i16> %coords_lo, i32 1 |
| 303 | %slice = extractelement <2 x i16> %coords_hi, i32 0 |
| 304 | %mip = extractelement <2 x i16> %coords_hi, i32 1 |
| 305 | call void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 306 | ret void |
| 307 | } |
| 308 | |
| 309 | ; GCN-LABEL: {{^}}getresinfo_1d: |
| 310 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 311 | define amdgpu_ps <4 x float> @getresinfo_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 312 | main_body: |
| 313 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 314 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 315 | ret <4 x float> %v |
| 316 | } |
| 317 | |
| 318 | ; GCN-LABEL: {{^}}getresinfo_2d: |
| 319 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 320 | define amdgpu_ps <4 x float> @getresinfo_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 321 | main_body: |
| 322 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 323 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 324 | ret <4 x float> %v |
| 325 | } |
| 326 | |
| 327 | ; GCN-LABEL: {{^}}getresinfo_3d: |
| 328 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 329 | define amdgpu_ps <4 x float> @getresinfo_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 330 | main_body: |
| 331 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 332 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 333 | ret <4 x float> %v |
| 334 | } |
| 335 | |
| 336 | ; GCN-LABEL: {{^}}getresinfo_cube: |
| 337 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 338 | define amdgpu_ps <4 x float> @getresinfo_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 339 | main_body: |
| 340 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 341 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 342 | ret <4 x float> %v |
| 343 | } |
| 344 | |
| 345 | ; GCN-LABEL: {{^}}getresinfo_1darray: |
| 346 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 347 | define amdgpu_ps <4 x float> @getresinfo_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 348 | main_body: |
| 349 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 350 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 351 | ret <4 x float> %v |
| 352 | } |
| 353 | |
| 354 | ; GCN-LABEL: {{^}}getresinfo_2darray: |
| 355 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 356 | define amdgpu_ps <4 x float> @getresinfo_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 357 | main_body: |
| 358 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 359 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 360 | ret <4 x float> %v |
| 361 | } |
| 362 | |
| 363 | ; GCN-LABEL: {{^}}getresinfo_2dmsaa: |
| 364 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 |
| 365 | define amdgpu_ps <4 x float> @getresinfo_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 366 | main_body: |
| 367 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 368 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 369 | ret <4 x float> %v |
| 370 | } |
| 371 | |
| 372 | ; GCN-LABEL: {{^}}getresinfo_2darraymsaa: |
| 373 | ; GCN: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da{{$}} |
| 374 | define amdgpu_ps <4 x float> @getresinfo_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 375 | main_body: |
| 376 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 377 | %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 378 | ret <4 x float> %v |
| 379 | } |
| 380 | |
| 381 | ; GCN-LABEL: {{^}}load_1d_V1: |
| 382 | ; GCN: image_load v0, v0, s[0:7] dmask:0x8 unorm a16 |
| 383 | define amdgpu_ps float @load_1d_V1(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 384 | main_body: |
| 385 | %s = extractelement <2 x i16> %coords, i32 0 |
| 386 | %v = call float @llvm.amdgcn.image.load.1d.f32.i16(i32 8, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 387 | ret float %v |
| 388 | } |
| 389 | |
| 390 | ; GCN-LABEL: {{^}}load_1d_V2: |
| 391 | ; GCN: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm a16 |
| 392 | define amdgpu_ps <2 x float> @load_1d_V2(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 393 | main_body: |
| 394 | %s = extractelement <2 x i16> %coords, i32 0 |
| 395 | %v = call <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32 9, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 396 | ret <2 x float> %v |
| 397 | } |
| 398 | |
| 399 | ; GCN-LABEL: {{^}}store_1d_V1: |
| 400 | ; GCN: image_store v0, v1, s[0:7] dmask:0x2 unorm a16 |
| 401 | define amdgpu_ps void @store_1d_V1(<8 x i32> inreg %rsrc, float %vdata, <2 x i16> %coords) { |
| 402 | main_body: |
| 403 | %s = extractelement <2 x i16> %coords, i32 0 |
| 404 | call void @llvm.amdgcn.image.store.1d.f32.i16(float %vdata, i32 2, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 405 | ret void |
| 406 | } |
| 407 | |
| 408 | ; GCN-LABEL: {{^}}store_1d_V2: |
| 409 | ; GCN: image_store v[0:1], v2, s[0:7] dmask:0xc unorm a16 |
| 410 | define amdgpu_ps void @store_1d_V2(<8 x i32> inreg %rsrc, <2 x float> %vdata, <2 x i16> %coords) { |
| 411 | main_body: |
| 412 | %s = extractelement <2 x i16> %coords, i32 0 |
| 413 | call void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float> %vdata, i32 12, i16 %s, <8 x i32> %rsrc, i32 0, i32 0) |
| 414 | ret void |
| 415 | } |
| 416 | |
| 417 | ; GCN-LABEL: {{^}}load_1d_glc: |
| 418 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc a16{{$}} |
| 419 | define amdgpu_ps <4 x float> @load_1d_glc(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 420 | main_body: |
| 421 | %s = extractelement <2 x i16> %coords, i32 0 |
| 422 | %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1) |
| 423 | ret <4 x float> %v |
| 424 | } |
| 425 | |
| 426 | ; GCN-LABEL: {{^}}load_1d_slc: |
| 427 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc a16{{$}} |
| 428 | define amdgpu_ps <4 x float> @load_1d_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 429 | main_body: |
| 430 | %s = extractelement <2 x i16> %coords, i32 0 |
| 431 | %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2) |
| 432 | ret <4 x float> %v |
| 433 | } |
| 434 | |
| 435 | ; GCN-LABEL: {{^}}load_1d_glc_slc: |
| 436 | ; GCN: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc a16{{$}} |
| 437 | define amdgpu_ps <4 x float> @load_1d_glc_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) { |
| 438 | main_body: |
| 439 | %s = extractelement <2 x i16> %coords, i32 0 |
| 440 | %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3) |
| 441 | ret <4 x float> %v |
| 442 | } |
| 443 | |
| 444 | ; GCN-LABEL: {{^}}store_1d_glc: |
| 445 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc a16{{$}} |
| 446 | define amdgpu_ps void @store_1d_glc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 447 | main_body: |
| 448 | %s = extractelement <2 x i16> %coords, i32 0 |
| 449 | call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1) |
| 450 | ret void |
| 451 | } |
| 452 | |
| 453 | ; GCN-LABEL: {{^}}store_1d_slc: |
| 454 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc a16{{$}} |
| 455 | define amdgpu_ps void @store_1d_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 456 | main_body: |
| 457 | %s = extractelement <2 x i16> %coords, i32 0 |
| 458 | call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2) |
| 459 | ret void |
| 460 | } |
| 461 | |
| 462 | ; GCN-LABEL: {{^}}store_1d_glc_slc: |
| 463 | ; GCN: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc a16{{$}} |
| 464 | define amdgpu_ps void @store_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) { |
| 465 | main_body: |
| 466 | %s = extractelement <2 x i16> %coords, i32 0 |
| 467 | call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3) |
| 468 | ret void |
| 469 | } |
| 470 | |
| 471 | ; GCN-LABEL: {{^}}getresinfo_dmask0: |
| 472 | ; GCN-NOT: image |
| 473 | ; GCN: ; return to shader part epilog |
| 474 | define amdgpu_ps <4 x float> @getresinfo_dmask0(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) #0 { |
| 475 | main_body: |
| 476 | %mip = extractelement <2 x i16> %coords, i32 0 |
| 477 | %r = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 0, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0) |
| 478 | ret <4 x float> %r |
| 479 | } |
| 480 | |
| 481 | declare <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #1 |
| 482 | declare <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1 |
| 483 | declare <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 484 | declare <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 485 | declare <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1 |
| 486 | declare <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 487 | declare <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 488 | declare <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 489 | |
| 490 | declare <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1 |
| 491 | declare <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 492 | declare <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 493 | declare <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 494 | declare <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 495 | declare <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1 |
| 496 | |
| 497 | declare void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float>, i32, i16, <8 x i32>, i32, i32) #0 |
| 498 | declare void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0 |
| 499 | declare void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 500 | declare void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 501 | declare void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0 |
| 502 | declare void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 503 | declare void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 504 | declare void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 505 | |
| 506 | declare void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0 |
| 507 | declare void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 508 | declare void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 509 | declare void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 510 | declare void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 511 | declare void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0 |
| 512 | |
| 513 | declare <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 514 | declare <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 515 | declare <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 516 | declare <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 517 | declare <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 518 | declare <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 519 | declare <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 520 | declare <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2 |
| 521 | |
| 522 | declare float @llvm.amdgcn.image.load.1d.f32.i16(i32, i16, <8 x i32>, i32, i32) #1 |
| 523 | declare float @llvm.amdgcn.image.load.2d.f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1 |
| 524 | declare <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32, i16, <8 x i32>, i32, i32) #1 |
| 525 | declare void @llvm.amdgcn.image.store.1d.f32.i16(float, i32, i16, <8 x i32>, i32, i32) #0 |
| 526 | declare void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float>, i32, i16, <8 x i32>, i32, i32) #0 |
| 527 | |
| 528 | attributes #0 = { nounwind } |
| 529 | attributes #1 = { nounwind readonly } |
| 530 | attributes #2 = { nounwind readnone } |