Nicolai Haehnle | 2f5a738 | 2018-04-04 10:58:54 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck -check-prefix=GCN -check-prefix=UNPACKED %s |
| 2 | ; RUN: llc < %s -march=amdgcn -mcpu=gfx810 -verify-machineinstrs | FileCheck -check-prefix=GCN -check-prefix=PACKED -check-prefix=GFX81 %s |
| 3 | ; RUN: llc < %s -march=amdgcn -mcpu=gfx900 -verify-machineinstrs | FileCheck -check-prefix=GCN -check-prefix=PACKED -check-prefix=GFX9 %s |
| 4 | |
| 5 | ; GCN-LABEL: {{^}}image_sample_2d_f16: |
| 6 | ; GCN: image_sample v0, v[0:1], s[0:7], s[8:11] dmask:0x1 d16{{$}} |
| 7 | define amdgpu_ps half @image_sample_2d_f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) { |
| 8 | main_body: |
| 9 | %tex = call half @llvm.amdgcn.image.sample.2d.f16.f32(i32 1, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0) |
| 10 | ret half %tex |
| 11 | } |
| 12 | |
| 13 | ; GCN-LABEL: {{^}}image_sample_c_d_1d_v2f16: |
| 14 | ; UNPACKED: image_sample_c_d v[0:1], v[0:3], s[0:7], s[8:11] dmask:0x3 d16{{$}} |
| 15 | ; PACKED: image_sample_c_d v0, v[0:3], s[0:7], s[8:11] dmask:0x3 d16{{$}} |
| 16 | define amdgpu_ps float @image_sample_c_d_1d_v2f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) { |
| 17 | main_body: |
| 18 | %tex = call <2 x half> @llvm.amdgcn.image.sample.c.d.1d.v2f16.f32.f32(i32 3, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0) |
| 19 | %r = bitcast <2 x half> %tex to float |
| 20 | ret float %r |
| 21 | } |
| 22 | |
| 23 | ; GCN-LABEL: {{^}}image_sample_b_2d_v4f16: |
| 24 | ; UNPACKED: image_sample_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf d16{{$}} |
| 25 | ; PACKED: image_sample_b v[0:1], v[0:3], s[0:7], s[8:11] dmask:0xf d16{{$}} |
| 26 | define amdgpu_ps <2 x float> @image_sample_b_2d_v4f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) { |
| 27 | main_body: |
| 28 | %tex = call <4 x half> @llvm.amdgcn.image.sample.b.2d.v4f16.f32.f32(i32 15, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0) |
| 29 | %r = bitcast <4 x half> %tex to <2 x float> |
| 30 | ret <2 x float> %r |
| 31 | } |
| 32 | |
| 33 | declare half @llvm.amdgcn.image.sample.2d.f16.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 |
| 34 | declare <2 x half> @llvm.amdgcn.image.sample.c.d.1d.v2f16.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 |
| 35 | declare <4 x half> @llvm.amdgcn.image.sample.b.2d.v4f16.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 |
| 36 | |
| 37 | attributes #0 = { nounwind } |
| 38 | attributes #1 = { nounwind readonly } |
| 39 | attributes #2 = { nounwind readnone } |