| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,212 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9 %s | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s) { | ||
| ; GFX9-LABEL: sample_cd_1d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) { | ||
| ; GFX9-LABEL: sample_cd_2d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_and_b32_e32 v4, 0xffff, v4 | ||
| ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX9-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v4, v5, 16, v4 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v3, v3, 16, v2 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v2, v1, 16, v0 | ||
| ; GFX9-NEXT: image_sample_cd v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v4, 0xffff, v4 | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v4, v5, 16, v4 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v3, 16, v2 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v1, 16, v0 | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s) { | ||
| ; GFX9-LABEL: sample_c_cd_1d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) { | ||
| ; GFX9-LABEL: sample_c_cd_2d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_mov_b32_e32 v7, v3 | ||
| ; GFX9-NEXT: v_mov_b32_e32 v8, v2 | ||
| ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v5 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v3, v6, 16, v2 | ||
| ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v7 | ||
| ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v2, v4, 16, v2 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v1, v8, 16, v1 | ||
| ; GFX9-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff, v5 | ||
| ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3 | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v5, v6, 16, v5 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v4, 16, v3 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1 | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], [v0, v1, v3, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s, half %clamp) { | ||
| ; GFX9-LABEL: sample_cd_cl_1d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v2, v3, 16, v2 | ||
| ; GFX9-NEXT: image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) { | ||
| ; GFX9-LABEL: sample_cd_cl_2d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_and_b32_e32 v4, 0xffff, v4 | ||
| ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX9-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v5, v5, 16, v4 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v4, v3, 16, v2 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v3, v1, 16, v0 | ||
| ; GFX9-NEXT: image_sample_cd_cl v[0:3], v[3:6], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v4, 0xffff, v4 | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v4, v5, 16, v4 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v0, v1, 16, v0 | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], [v0, v2, v4, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp) { | ||
| ; GFX9-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_and_b32_e32 v3, 0xffff, v3 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v3, v4, 16, v3 | ||
| ; GFX9-NEXT: image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v4, 16, v3 | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) { | ||
| ; GFX9-LABEL: sample_c_cd_cl_2d: | ||
| ; GFX9: ; %bb.0: ; %main_body | ||
| ; GFX9-NEXT: v_mov_b32_e32 v11, v7 | ||
| ; GFX9-NEXT: v_mov_b32_e32 v7, v0 | ||
| ; GFX9-NEXT: v_and_b32_e32 v0, 0xffff, v5 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v10, v6, 16, v0 | ||
| ; GFX9-NEXT: v_and_b32_e32 v0, 0xffff, v3 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v9, v4, 16, v0 | ||
| ; GFX9-NEXT: v_and_b32_e32 v0, 0xffff, v1 | ||
| ; GFX9-NEXT: v_lshl_or_b32 v8, v2, 16, v0 | ||
| ; GFX9-NEXT: image_sample_c_cd_cl v[0:3], v[7:11], s[0:7], s[8:11] dmask:0xf a16 | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff, v5 | ||
| ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3 | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v5, v6, 16, v5 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v4, 16, v3 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1 | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], [v0, v1, v3, v5, v7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f16(i32, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32, float, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readonly } | ||
| attributes #2 = { nounwind readnone } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefixes=VERDE %s | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX6789 %s | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_cd_1d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_cd_1d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_cd_2d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_cd_2d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_c_cd_1d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_c_cd_1d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; 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 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_c_cd_2d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_c_cd v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_c_cd_2d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_c_cd v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; 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 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_cd_cl_1d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_cd_cl_1d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; 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 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_cd_cl_2d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_cd_cl_2d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; 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 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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) { | ||
| ; VERDE-LABEL: sample_c_cd_cl_1d: | ||
| ; VERDE: ; %bb.0: ; %main_body | ||
| ; VERDE-NEXT: image_sample_c_cd_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf | ||
| ; VERDE-NEXT: s_waitcnt vmcnt(0) | ||
| ; VERDE-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX6789-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX6789: ; %bb.0: ; %main_body | ||
| ; GFX6789-NEXT: image_sample_c_cd_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf | ||
| ; GFX6789-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX6789-NEXT: ; return to shader part epilog | ||
| ; | ||
| ; GFX10-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; 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 | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %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) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readonly } | ||
| attributes #2 = { nounwind readnone } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx1010 -show-mc-encoding < %s | FileCheck -check-prefix=GFX10 %s | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s) { | ||
| ; GFX10-LABEL: sample_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x01,0x0f,0xa0,0xf1,0x00,0x00,0x40,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f32(i32 15, half %dsdh, half %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) { | ||
| ; GFX10-LABEL: sample_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 ; encoding: [0xff,0x04,0x04,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 ; encoding: [0xff,0x00,0x00,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 ; encoding: [0x02,0x00,0x6f,0xd7,0x03,0x21,0x09,0x04] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v0, v1, 16, v0 ; encoding: [0x00,0x00,0x6f,0xd7,0x01,0x21,0x01,0x04] | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], [v0, v2, v4, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x0b,0x0f,0xa0,0xf1,0x00,0x00,0x40,0x00,0x02,0x04,0x05,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f32(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s) { | ||
| ; GFX10-LABEL: sample_c_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x01,0x0f,0xa8,0xf1,0x00,0x00,0x40,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) { | ||
| ; GFX10-LABEL: sample_c_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3 ; encoding: [0xff,0x06,0x06,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 ; encoding: [0xff,0x02,0x02,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v4, 16, v3 ; encoding: [0x03,0x00,0x6f,0xd7,0x04,0x21,0x0d,0x04] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1 ; encoding: [0x01,0x00,0x6f,0xd7,0x02,0x21,0x05,0x04] | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], [v0, v1, v3, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x0b,0x0f,0xa8,0xf1,0x00,0x00,0x40,0x00,0x01,0x03,0x05,0x06] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s, float %clamp) { | ||
| ; GFX10-LABEL: sample_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x01,0x0f,0xa4,0xf1,0x00,0x00,0x40,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f32(i32 15, half %dsdh, half %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp) { | ||
| ; GFX10-LABEL: sample_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 ; encoding: [0xff,0x04,0x04,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 ; encoding: [0xff,0x00,0x00,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 ; encoding: [0x02,0x00,0x6f,0xd7,0x03,0x21,0x09,0x04] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v0, v1, 16, v0 ; encoding: [0x00,0x00,0x6f,0xd7,0x01,0x21,0x01,0x04] | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], [v0, v2, v4, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x0b,0x0f,0xa4,0xf1,0x00,0x00,0x40,0x00,0x02,0x04,0x05,0x06] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f32(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp) { | ||
| ; GFX10-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x01,0x0f,0xac,0xf1,0x00,0x00,0x40,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp) { | ||
| ; GFX10-LABEL: sample_c_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_mov_b32_e32 v8, v2 ; encoding: [0x02,0x03,0x10,0x7e] | ||
| ; GFX10-NEXT: v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e] | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v3 ; encoding: [0xff,0x06,0x00,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 ; encoding: [0xff,0x02,0x02,0x36,0xff,0xff,0x00,0x00] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v4, v4, 16, v0 ; encoding: [0x04,0x00,0x6f,0xd7,0x04,0x21,0x01,0x04] | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v8, 16, v1 ; encoding: [0x03,0x00,0x6f,0xd7,0x08,0x21,0x05,0x04] | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x09,0x0f,0xac,0xf1,0x02,0x00,0x40,0x00] | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf] | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f32(i32, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f16.f32(i32, float, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f32(i32, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f16.f32(i32, float, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readonly } | ||
| attributes #2 = { nounwind readnone } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefix=GFX10 %s | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s) { | ||
| ; GFX10-LABEL: sample_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f32(i32 15, half %dsdh, half %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) { | ||
| ; GFX10-LABEL: sample_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v0, v1, 16, v0 | ||
| ; GFX10-NEXT: image_sample_cd_g16 v[0:3], [v0, v2, v4, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f32(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s) { | ||
| ; GFX10-LABEL: sample_c_cd_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) { | ||
| ; GFX10-LABEL: sample_c_cd_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3 | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v4, 16, v3 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1 | ||
| ; GFX10-NEXT: image_sample_c_cd_g16 v[0:3], [v0, v1, v3, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s, float %clamp) { | ||
| ; GFX10-LABEL: sample_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f32(i32 15, half %dsdh, half %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp) { | ||
| ; GFX10-LABEL: sample_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2 | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v0 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v0, v1, 16, v0 | ||
| ; GFX10-NEXT: image_sample_cd_cl_g16 v[0:3], [v0, v2, v4, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f32(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp) { | ||
| ; GFX10-LABEL: sample_c_cd_cl_1d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp) { | ||
| ; GFX10-LABEL: sample_c_cd_cl_2d: | ||
| ; GFX10: ; %bb.0: ; %main_body | ||
| ; GFX10-NEXT: v_mov_b32_e32 v8, v2 | ||
| ; GFX10-NEXT: v_mov_b32_e32 v2, v0 | ||
| ; GFX10-NEXT: v_and_b32_e32 v0, 0xffff, v3 | ||
| ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v4, v4, 16, v0 | ||
| ; GFX10-NEXT: v_lshl_or_b32 v3, v8, 16, v1 | ||
| ; GFX10-NEXT: image_sample_c_cd_cl_g16 v[0:3], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D | ||
| ; GFX10-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX10-NEXT: ; return to shader part epilog | ||
| main_body: | ||
| %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f16.f32(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0) | ||
| ret <4 x float> %v | ||
| } | ||
|
|
||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f32(i32, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f16.f32(i32, float, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f32(i32, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f16.f32(i32, float, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
| declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1 | ||
|
|
||
| attributes #0 = { nounwind } | ||
| attributes #1 = { nounwind readonly } | ||
| attributes #2 = { nounwind readnone } |