+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN %s
-; GCN-LABEL: {{^}}gather4_2d:
-; GCN: image_gather4 v[0:3], v0, s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t) {
+; GCN-LABEL: gather4_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4 v[0:3], v0, s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.2d.v4f32.f16(i32 1, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_cube:
-; GCN: image_gather4 v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16 da{{$}}
define amdgpu_ps <4 x float> @gather4_cube(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %face) {
+; GCN-LABEL: gather4_cube:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4 v[0:3], v[1:2], s[0:7], s[8:11] dmask:0x1 a16 da
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.cube.v4f32.f16(i32 1, half %s, half %t, half %face, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_2darray:
-; GCN: image_gather4 v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16 da{{$}}
define amdgpu_ps <4 x float> @gather4_2darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %slice) {
+; GCN-LABEL: gather4_2darray:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4 v[0:3], v[1:2], s[0:7], s[8:11] dmask:0x1 a16 da
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.2darray.v4f32.f16(i32 1, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_c_2d:
-; GCN: image_gather4_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t) {
+; GCN-LABEL: gather4_c_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.2d.v4f32.f32(i32 1, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_cl_2d:
-; GCN: image_gather4_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %clamp) {
+; GCN-LABEL: gather4_cl_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_cl v[0:3], v[1:2], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.cl.2d.v4f32.f16(i32 1, 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
}
-; GCN-LABEL: {{^}}gather4_c_cl_2d:
-; GCN: image_gather4_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t, half %clamp) {
+; GCN-LABEL: gather4_c_cl_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_c_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.cl.2d.v4f32.f32(i32 1, float %zcompare, 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
}
-; GCN-LABEL: {{^}}gather4_b_2d:
-; GCN: image_gather4_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s, half %t) {
+; GCN-LABEL: gather4_b_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.b.2d.v4f32.f32.f16(i32 1, float %bias, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_c_b_2d:
-; GCN: image_gather4_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s, half %t) {
+; GCN-LABEL: gather4_c_b_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v2, 0xffff, v2
+; GCN-NEXT: v_lshl_or_b32 v2, v3, 16, v2
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.b.2d.v4f32.f32.f16(i32 1, float %bias, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_b_cl_2d:
-; GCN: image_gather4_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s, half %t, half %clamp) {
+; GCN-LABEL: gather4_b_cl_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_b_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.b.cl.2d.v4f32.f32.f16(i32 1, float %bias, 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
}
-; GCN-LABEL: {{^}}gather4_c_b_cl_2d:
-; GCN: image_gather4_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s, half %t, half %clamp) {
+; GCN-LABEL: gather4_c_b_cl_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: s_mov_b64 s[12:13], exec
+; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_mov_b32_e32 v7, v4
+; GCN-NEXT: v_mov_b32_e32 v4, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v2
+; GCN-NEXT: v_mov_b32_e32 v5, v1
+; GCN-NEXT: v_lshl_or_b32 v6, v3, 16, v0
+; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
+; GCN-NEXT: image_gather4_c_b_cl v[0:3], v[4:7], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.b.cl.2d.v4f32.f32.f16(i32 1, float %bias, float %zcompare, 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
}
-; GCN-LABEL: {{^}}gather4_l_2d:
-; GCN: image_gather4_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %lod) {
+; GCN-LABEL: gather4_l_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
+; GCN-NEXT: image_gather4_l v[0:3], v[1:2], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.l.2d.v4f32.f16(i32 1, half %s, half %t, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_c_l_2d:
-; GCN: image_gather4_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t, half %lod) {
+; GCN-LABEL: gather4_c_l_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
+; GCN-NEXT: image_gather4_c_l v[0:3], v[3:5], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.l.2d.v4f32.f32(i32 1, float %zcompare, half %s, half %t, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_lz_2d:
-; GCN: image_gather4_lz v[0:3], v0, s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t) {
+; GCN-LABEL: gather4_lz_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
+; GCN-NEXT: image_gather4_lz v[0:3], v0, s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.lz.2d.v4f32.f16(i32 1, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
}
-; GCN-LABEL: {{^}}gather4_c_lz_2d:
-; GCN: image_gather4_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16{{$}}
define amdgpu_ps <4 x float> @gather4_c_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t) {
+; GCN-LABEL: gather4_c_lz_2d:
+; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
+; GCN-NEXT: image_gather4_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0x1 a16
+; GCN-NEXT: s_waitcnt vmcnt(0)
+; GCN-NEXT: ; return to shader part epilog
main_body:
%v = call <4 x float> @llvm.amdgcn.image.gather4.c.lz.2d.v4f32.f32(i32 1, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
ret <4 x float> %v
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v1, v2
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v1, v2
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16 da
+; GCN-NEXT: image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16 da
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16 da
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v1, v2
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16 da
+; GCN-NEXT: image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16 da
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_cl v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v1, v2
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: image_sample_cl v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_c_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v2, v3
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: image_sample_c_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v2, 0xffff, v2
+; GCN-NEXT: v_lshl_or_b32 v2, v3, 16, v2
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_b_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v2, v3
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: image_sample_b_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
+; GCN-NEXT: v_and_b32_e32 v2, 0xffff, v2
+; GCN-NEXT: v_lshl_or_b32 v2, v3, 16, v2
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
; GCN-NEXT: image_sample_c_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN: ; %bb.0: ; %main_body
; GCN-NEXT: s_mov_b64 s[12:13], exec
; GCN-NEXT: s_wqm_b64 exec, exec
-; GCN-NEXT: v_mov_b32_e32 v3, v4
+; GCN-NEXT: v_mov_b32_e32 v7, v4
+; GCN-NEXT: v_mov_b32_e32 v4, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v2
+; GCN-NEXT: v_mov_b32_e32 v5, v1
+; GCN-NEXT: v_lshl_or_b32 v6, v3, 16, v0
; GCN-NEXT: s_and_b64 exec, exec, s[12:13]
-; GCN-NEXT: image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: image_sample_c_b_cl v[0:3], v[4:7], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {
; GCN-LABEL: sample_d_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v3, v4
-; GCN-NEXT: v_mov_b32_e32 v1, v0
-; GCN-NEXT: image_sample_d v[0:3], v[1:3], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v6, 0xffff
+; GCN-NEXT: v_and_b32_e32 v4, v6, v4
+; GCN-NEXT: v_and_b32_e32 v2, v6, v2
+; GCN-NEXT: v_and_b32_e32 v0, v6, v0
+; GCN-NEXT: v_lshl_or_b32 v3, v3, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v4, v5, 16, v4
+; GCN-NEXT: v_lshl_or_b32 v2, v1, 16, v0
+; GCN-NEXT: image_sample_d v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_d_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, half %s, half %t, half %r) {
; GCN-LABEL: sample_d_3d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v4, v3
-; GCN-NEXT: v_mov_b32_e32 v3, v2
-; GCN-NEXT: v_mov_b32_e32 v7, v8
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_d v[0:3], v[2:9], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v12, v8
+; GCN-NEXT: v_mov_b32_e32 v8, v2
+; GCN-NEXT: v_mov_b32_e32 v2, 0xffff
+; GCN-NEXT: v_mov_b32_e32 v10, v5
+; GCN-NEXT: v_and_b32_e32 v5, v2, v6
+; GCN-NEXT: v_and_b32_e32 v3, v2, v3
+; GCN-NEXT: v_and_b32_e32 v0, v2, v0
+; GCN-NEXT: v_lshl_or_b32 v11, v7, 16, v5
+; GCN-NEXT: v_lshl_or_b32 v9, v4, 16, v3
+; GCN-NEXT: v_lshl_or_b32 v7, v1, 16, v0
+; GCN-NEXT: image_sample_d v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_c_d_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) {
; GCN-LABEL: sample_c_d_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v2, v1
-; GCN-NEXT: v_mov_b32_e32 v4, v5
-; GCN-NEXT: v_mov_b32_e32 v1, v0
-; GCN-NEXT: image_sample_c_d v[0:3], v[1:4], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v9, 0xffff
+; GCN-NEXT: v_mov_b32_e32 v8, v2
+; GCN-NEXT: v_mov_b32_e32 v7, v3
+; GCN-NEXT: v_and_b32_e32 v2, v9, v5
+; GCN-NEXT: v_and_b32_e32 v1, v9, v1
+; GCN-NEXT: v_lshl_or_b32 v3, v6, 16, v2
+; GCN-NEXT: v_and_b32_e32 v2, v9, v7
+; GCN-NEXT: v_lshl_or_b32 v2, v4, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v1, v8, 16, v1
+; GCN-NEXT: image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s, half %clamp) {
; GCN-LABEL: sample_d_cl_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v2, 0xffff, v2
+; GCN-NEXT: v_lshl_or_b32 v2, v3, 16, v2
; GCN-NEXT: image_sample_d_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps <4 x float> @sample_d_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) {
; GCN-LABEL: sample_d_cl_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v3, v2
-; GCN-NEXT: v_mov_b32_e32 v5, v6
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_d_cl v[0:3], v[2:5], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v7, 0xffff
+; GCN-NEXT: v_and_b32_e32 v4, v7, v4
+; GCN-NEXT: v_and_b32_e32 v2, v7, v2
+; GCN-NEXT: v_and_b32_e32 v0, v7, v0
+; GCN-NEXT: v_lshl_or_b32 v5, v5, 16, v4
+; GCN-NEXT: v_lshl_or_b32 v4, v3, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v3, v1, 16, v0
+; GCN-NEXT: image_sample_d_cl v[0:3], v[3:6], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp) {
; GCN-LABEL: sample_c_d_cl_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v3, 0xffff, v3
+; GCN-NEXT: v_lshl_or_b32 v3, v4, 16, v3
; GCN-NEXT: image_sample_c_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps <4 x float> @sample_c_d_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) {
; GCN-LABEL: sample_c_d_cl_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v4, v3
-; GCN-NEXT: v_mov_b32_e32 v6, v7
-; GCN-NEXT: v_mov_b32_e32 v3, v1
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_c_d_cl v[0:3], v[2:9], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v11, v7
+; GCN-NEXT: v_mov_b32_e32 v7, v0
+; GCN-NEXT: v_mov_b32_e32 v0, 0xffff
+; GCN-NEXT: v_and_b32_e32 v5, v0, v5
+; GCN-NEXT: v_and_b32_e32 v3, v0, v3
+; GCN-NEXT: v_and_b32_e32 v0, v0, v1
+; GCN-NEXT: v_lshl_or_b32 v10, v6, 16, v5
+; GCN-NEXT: v_lshl_or_b32 v9, v4, 16, v3
+; GCN-NEXT: v_lshl_or_b32 v8, v2, 16, v0
+; GCN-NEXT: image_sample_c_d_cl v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
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) {
; GCN-LABEL: sample_cd_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v3, v4
-; GCN-NEXT: v_mov_b32_e32 v1, v0
-; GCN-NEXT: image_sample_cd v[0:3], v[1:3], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v6, 0xffff
+; GCN-NEXT: v_and_b32_e32 v4, v6, v4
+; GCN-NEXT: v_and_b32_e32 v2, v6, v2
+; GCN-NEXT: v_and_b32_e32 v0, v6, v0
+; GCN-NEXT: v_lshl_or_b32 v3, v3, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v4, v5, 16, v4
+; GCN-NEXT: v_lshl_or_b32 v2, v1, 16, v0
+; GCN-NEXT: image_sample_cd v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
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) {
; GCN-LABEL: sample_c_cd_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v2, v1
-; GCN-NEXT: v_mov_b32_e32 v4, v5
-; GCN-NEXT: v_mov_b32_e32 v1, v0
-; GCN-NEXT: image_sample_c_cd v[0:3], v[1:4], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v9, 0xffff
+; GCN-NEXT: v_mov_b32_e32 v8, v2
+; GCN-NEXT: v_mov_b32_e32 v7, v3
+; GCN-NEXT: v_and_b32_e32 v2, v9, v5
+; GCN-NEXT: v_and_b32_e32 v1, v9, v1
+; GCN-NEXT: v_lshl_or_b32 v3, v6, 16, v2
+; GCN-NEXT: v_and_b32_e32 v2, v9, v7
+; GCN-NEXT: v_lshl_or_b32 v2, v4, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v1, v8, 16, v1
+; GCN-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
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) {
; GCN-LABEL: sample_cd_cl_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v2, 0xffff, v2
+; GCN-NEXT: v_lshl_or_b32 v2, v3, 16, v2
; GCN-NEXT: image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
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) {
; GCN-LABEL: sample_cd_cl_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v3, v2
-; GCN-NEXT: v_mov_b32_e32 v5, v6
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_cd_cl v[0:3], v[2:5], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v7, 0xffff
+; GCN-NEXT: v_and_b32_e32 v4, v7, v4
+; GCN-NEXT: v_and_b32_e32 v2, v7, v2
+; GCN-NEXT: v_and_b32_e32 v0, v7, v0
+; GCN-NEXT: v_lshl_or_b32 v5, v5, 16, v4
+; GCN-NEXT: v_lshl_or_b32 v4, v3, 16, v2
+; GCN-NEXT: v_lshl_or_b32 v3, v1, 16, v0
+; GCN-NEXT: image_sample_cd_cl v[0:3], v[3:6], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
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) {
; GCN-LABEL: sample_c_cd_cl_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v3, 0xffff, v3
+; GCN-NEXT: v_lshl_or_b32 v3, v4, 16, v3
; GCN-NEXT: image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
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) {
; GCN-LABEL: sample_c_cd_cl_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v4, v3
-; GCN-NEXT: v_mov_b32_e32 v6, v7
-; GCN-NEXT: v_mov_b32_e32 v3, v1
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_c_cd_cl v[0:3], v[2:9], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v11, v7
+; GCN-NEXT: v_mov_b32_e32 v7, v0
+; GCN-NEXT: v_mov_b32_e32 v0, 0xffff
+; GCN-NEXT: v_and_b32_e32 v5, v0, v5
+; GCN-NEXT: v_and_b32_e32 v3, v0, v3
+; GCN-NEXT: v_and_b32_e32 v0, v0, v1
+; GCN-NEXT: v_lshl_or_b32 v10, v6, 16, v5
+; GCN-NEXT: v_lshl_or_b32 v9, v4, 16, v3
+; GCN-NEXT: v_lshl_or_b32 v8, v2, 16, v0
+; GCN-NEXT: image_sample_c_cd_cl v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %lod) {
; GCN-LABEL: sample_l_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GCN-NEXT: image_sample_l v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps <4 x float> @sample_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %lod) {
; GCN-LABEL: sample_l_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v1, v2
-; GCN-NEXT: image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v1, v1, 16, v0
+; GCN-NEXT: image_sample_l v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_c_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %lod) {
; GCN-LABEL: sample_c_l_1d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: image_sample_c_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps <4 x float> @sample_c_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t, half %lod) {
; GCN-LABEL: sample_c_l_2d:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v2, v3
-; GCN-NEXT: image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
+; GCN-NEXT: v_mov_b32_e32 v5, v3
+; GCN-NEXT: v_mov_b32_e32 v3, v0
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v4, v2, 16, v0
+; GCN-NEXT: image_sample_c_l v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <4 x float> @sample_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t) {
; GCN-LABEL: sample_lz_2d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v0, 0xffff, v0
+; GCN-NEXT: v_lshl_or_b32 v0, v1, 16, v0
; GCN-NEXT: image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps <4 x float> @sample_c_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t) {
; GCN-LABEL: sample_c_lz_2d:
; GCN: ; %bb.0: ; %main_body
+; GCN-NEXT: v_and_b32_e32 v1, 0xffff, v1
+; GCN-NEXT: v_lshl_or_b32 v1, v2, 16, v1
; GCN-NEXT: image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
define amdgpu_ps float @sample_c_d_o_2darray_V1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice) {
; GCN-LABEL: sample_c_d_o_2darray_V1:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v5, v4
-; GCN-NEXT: v_mov_b32_e32 v4, v2
-; GCN-NEXT: v_mov_b32_e32 v7, v8
-; GCN-NEXT: v_mov_b32_e32 v3, v1
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_c_d_o v0, v[2:9], s[0:7], s[8:11] dmask:0x4 a16 da
+; GCN-NEXT: v_mov_b32_e32 v13, v8
+; GCN-NEXT: v_mov_b32_e32 v8, v0
+; GCN-NEXT: v_mov_b32_e32 v0, 0xffff
+; GCN-NEXT: v_mov_b32_e32 v9, v1
+; GCN-NEXT: v_and_b32_e32 v1, v0, v6
+; GCN-NEXT: v_lshl_or_b32 v12, v7, 16, v1
+; GCN-NEXT: v_and_b32_e32 v1, v0, v4
+; GCN-NEXT: v_and_b32_e32 v0, v0, v2
+; GCN-NEXT: v_lshl_or_b32 v11, v5, 16, v1
+; GCN-NEXT: v_lshl_or_b32 v10, v3, 16, v0
+; GCN-NEXT: image_sample_c_d_o v0, v[8:15], s[0:7], s[8:11] dmask:0x4 a16 da
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body:
define amdgpu_ps <2 x float> @sample_c_d_o_2darray_V2(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice) {
; GCN-LABEL: sample_c_d_o_2darray_V2:
; GCN: ; %bb.0: ; %main_body
-; GCN-NEXT: v_mov_b32_e32 v5, v4
-; GCN-NEXT: v_mov_b32_e32 v4, v2
-; GCN-NEXT: v_mov_b32_e32 v7, v8
-; GCN-NEXT: v_mov_b32_e32 v3, v1
-; GCN-NEXT: v_mov_b32_e32 v2, v0
-; GCN-NEXT: image_sample_c_d_o v[0:1], v[2:9], s[0:7], s[8:11] dmask:0x6 a16 da
+; GCN-NEXT: v_mov_b32_e32 v13, v8
+; GCN-NEXT: v_mov_b32_e32 v8, v0
+; GCN-NEXT: v_mov_b32_e32 v0, 0xffff
+; GCN-NEXT: v_mov_b32_e32 v9, v1
+; GCN-NEXT: v_and_b32_e32 v1, v0, v6
+; GCN-NEXT: v_lshl_or_b32 v12, v7, 16, v1
+; GCN-NEXT: v_and_b32_e32 v1, v0, v4
+; GCN-NEXT: v_and_b32_e32 v0, v0, v2
+; GCN-NEXT: v_lshl_or_b32 v11, v5, 16, v1
+; GCN-NEXT: v_lshl_or_b32 v10, v3, 16, v0
+; GCN-NEXT: image_sample_c_d_o v[0:1], v[8:15], s[0:7], s[8:11] dmask:0x6 a16 da
; GCN-NEXT: s_waitcnt vmcnt(0)
; GCN-NEXT: ; return to shader part epilog
main_body: