976 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10 %s3; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -global-isel < %s | FileCheck -check-prefixes=GFX10GISEL %s4; TODO: global-isel produces more code - there will need to be some more combines in the postregbankselectcombine phase5; Depends on some other changes to pass this test - those are in review separately6 7define amdgpu_ps <4 x float> @sample_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, half %s) {8; GFX10-LABEL: sample_d_1d:9; GFX10: ; %bb.0: ; %main_body10; GFX10-NEXT: image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a1611; GFX10-NEXT: s_waitcnt vmcnt(0)12; GFX10-NEXT: ; return to shader part epilog13;14; GFX10GISEL-LABEL: sample_d_1d:15; GFX10GISEL: ; %bb.0: ; %main_body16; GFX10GISEL-NEXT: image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a1617; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)18; GFX10GISEL-NEXT: ; return to shader part epilog19main_body:20 %v = call <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f16(i32 15, float %dsdh, float %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)21 ret <4 x float> %v22}23 24define amdgpu_ps <4 x float> @sample_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t) {25; GFX10-LABEL: sample_d_2d:26; GFX10: ; %bb.0: ; %main_body27; GFX10-NEXT: v_perm_b32 v4, v5, v4, 0x504010028; GFX10-NEXT: image_sample_d v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a1629; GFX10-NEXT: s_waitcnt vmcnt(0)30; GFX10-NEXT: ; return to shader part epilog31;32; GFX10GISEL-LABEL: sample_d_2d:33; GFX10GISEL: ; %bb.0: ; %main_body34; GFX10GISEL-NEXT: v_and_b32_e32 v4, 0xffff, v435; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v5, 16, v436; GFX10GISEL-NEXT: image_sample_d v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a1637; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)38; GFX10GISEL-NEXT: ; return to shader part epilog39main_body:40 %v = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f16(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)41 ret <4 x float> %v42}43 44define amdgpu_ps <4 x float> @sample_d_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %drdh, float %dsdv, float %dtdv, float %drdv, half %s, half %t, half %r) {45; GFX10-LABEL: sample_d_3d:46; GFX10: ; %bb.0: ; %main_body47; GFX10-NEXT: v_mov_b32_e32 v15, v848; GFX10-NEXT: v_mov_b32_e32 v13, v549; GFX10-NEXT: v_mov_b32_e32 v12, v450; GFX10-NEXT: v_mov_b32_e32 v11, v351; GFX10-NEXT: v_mov_b32_e32 v10, v252; GFX10-NEXT: v_mov_b32_e32 v9, v153; GFX10-NEXT: v_mov_b32_e32 v8, v054; GFX10-NEXT: v_perm_b32 v14, v7, v6, 0x504010055; GFX10-NEXT: image_sample_d v[0:3], v[8:15], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a1656; GFX10-NEXT: s_waitcnt vmcnt(0)57; GFX10-NEXT: ; return to shader part epilog58;59; GFX10GISEL-LABEL: sample_d_3d:60; GFX10GISEL: ; %bb.0: ; %main_body61; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v762; GFX10GISEL-NEXT: v_and_b32_e32 v6, 0xffff, v663; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v864; GFX10GISEL-NEXT: v_lshl_or_b32 v6, v9, 16, v665; GFX10GISEL-NEXT: image_sample_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a1666; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)67; GFX10GISEL-NEXT: ; return to shader part epilog68main_body:69 %v = call <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f32.f16(i32 15, float %dsdh, float %dtdh, float %drdh, float %dsdv, float %dtdv, float %drdv, half %s, half %t, half %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)70 ret <4 x float> %v71}72 73define amdgpu_ps <4 x float> @sample_c_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, half %s) {74; GFX10-LABEL: sample_c_d_1d:75; GFX10: ; %bb.0: ; %main_body76; GFX10-NEXT: image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a1677; GFX10-NEXT: s_waitcnt vmcnt(0)78; GFX10-NEXT: ; return to shader part epilog79;80; GFX10GISEL-LABEL: sample_c_d_1d:81; GFX10GISEL: ; %bb.0: ; %main_body82; GFX10GISEL-NEXT: image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a1683; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)84; GFX10GISEL-NEXT: ; return to shader part epilog85main_body:86 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)87 ret <4 x float> %v88}89 90define amdgpu_ps <4 x float> @sample_c_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t) {91; GFX10-LABEL: sample_c_d_2d:92; GFX10: ; %bb.0: ; %main_body93; GFX10-NEXT: v_perm_b32 v5, v6, v5, 0x504010094; GFX10-NEXT: image_sample_c_d v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a1695; GFX10-NEXT: s_waitcnt vmcnt(0)96; GFX10-NEXT: ; return to shader part epilog97;98; GFX10GISEL-LABEL: sample_c_d_2d:99; GFX10GISEL: ; %bb.0: ; %main_body100; GFX10GISEL-NEXT: v_and_b32_e32 v5, 0xffff, v5101; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v6, 16, v5102; GFX10GISEL-NEXT: image_sample_c_d v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16103; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)104; GFX10GISEL-NEXT: ; return to shader part epilog105main_body:106 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)107 ret <4 x float> %v108}109 110define amdgpu_ps <4 x float> @sample_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, half %s, half %clamp) {111; GFX10-LABEL: sample_d_cl_1d:112; GFX10: ; %bb.0: ; %main_body113; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100114; GFX10-NEXT: image_sample_d_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16115; GFX10-NEXT: s_waitcnt vmcnt(0)116; GFX10-NEXT: ; return to shader part epilog117;118; GFX10GISEL-LABEL: sample_d_cl_1d:119; GFX10GISEL: ; %bb.0: ; %main_body120; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2121; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v3, 16, v2122; GFX10GISEL-NEXT: image_sample_d_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16123; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)124; GFX10GISEL-NEXT: ; return to shader part epilog125main_body:126 %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f16(i32 15, float %dsdh, float %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)127 ret <4 x float> %v128}129 130define amdgpu_ps <4 x float> @sample_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp) {131; GFX10-LABEL: sample_d_cl_2d:132; GFX10: ; %bb.0: ; %main_body133; GFX10-NEXT: v_mov_b32_e32 v11, v6134; GFX10-NEXT: v_mov_b32_e32 v9, v3135; GFX10-NEXT: v_mov_b32_e32 v8, v2136; GFX10-NEXT: v_mov_b32_e32 v7, v1137; GFX10-NEXT: v_mov_b32_e32 v6, v0138; GFX10-NEXT: v_perm_b32 v10, v5, v4, 0x5040100139; GFX10-NEXT: image_sample_d_cl v[0:3], v[6:11], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16140; GFX10-NEXT: s_waitcnt vmcnt(0)141; GFX10-NEXT: ; return to shader part epilog142;143; GFX10GISEL-LABEL: sample_d_cl_2d:144; GFX10GISEL: ; %bb.0: ; %main_body145; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v5146; GFX10GISEL-NEXT: v_and_b32_e32 v4, 0xffff, v4147; GFX10GISEL-NEXT: v_mov_b32_e32 v5, v6148; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v7, 16, v4149; GFX10GISEL-NEXT: image_sample_d_cl v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16150; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)151; GFX10GISEL-NEXT: ; return to shader part epilog152main_body:153 %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f16(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)154 ret <4 x float> %v155}156 157define amdgpu_ps <4 x float> @sample_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, half %s, half %clamp) {158; GFX10-LABEL: sample_c_d_cl_1d:159; GFX10: ; %bb.0: ; %main_body160; GFX10-NEXT: v_perm_b32 v3, v4, v3, 0x5040100161; GFX10-NEXT: image_sample_c_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16162; GFX10-NEXT: s_waitcnt vmcnt(0)163; GFX10-NEXT: ; return to shader part epilog164;165; GFX10GISEL-LABEL: sample_c_d_cl_1d:166; GFX10GISEL: ; %bb.0: ; %main_body167; GFX10GISEL-NEXT: v_and_b32_e32 v3, 0xffff, v3168; GFX10GISEL-NEXT: v_lshl_or_b32 v3, v4, 16, v3169; GFX10GISEL-NEXT: image_sample_c_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16170; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)171; GFX10GISEL-NEXT: ; return to shader part epilog172main_body:173 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)174 ret <4 x float> %v175}176 177define amdgpu_ps <4 x float> @sample_c_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp) {178; GFX10-LABEL: sample_c_d_cl_2d:179; GFX10: ; %bb.0: ; %main_body180; GFX10-NEXT: v_mov_b32_e32 v13, v7181; GFX10-NEXT: v_mov_b32_e32 v11, v4182; GFX10-NEXT: v_mov_b32_e32 v10, v3183; GFX10-NEXT: v_mov_b32_e32 v9, v2184; GFX10-NEXT: v_mov_b32_e32 v8, v1185; GFX10-NEXT: v_mov_b32_e32 v7, v0186; GFX10-NEXT: v_perm_b32 v12, v6, v5, 0x5040100187; GFX10-NEXT: image_sample_c_d_cl v[0:3], v[7:13], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16188; GFX10-NEXT: s_waitcnt vmcnt(0)189; GFX10-NEXT: ; return to shader part epilog190;191; GFX10GISEL-LABEL: sample_c_d_cl_2d:192; GFX10GISEL: ; %bb.0: ; %main_body193; GFX10GISEL-NEXT: v_mov_b32_e32 v8, v6194; GFX10GISEL-NEXT: v_and_b32_e32 v5, 0xffff, v5195; GFX10GISEL-NEXT: v_mov_b32_e32 v6, v7196; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v8, 16, v5197; GFX10GISEL-NEXT: image_sample_c_d_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16198; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)199; GFX10GISEL-NEXT: ; return to shader part epilog200main_body:201 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)202 ret <4 x float> %v203}204 205define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, half %s) {206; GFX10-LABEL: sample_cd_1d:207; GFX10: ; %bb.0: ; %main_body208; GFX10-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16209; GFX10-NEXT: s_waitcnt vmcnt(0)210; GFX10-NEXT: ; return to shader part epilog211;212; GFX10GISEL-LABEL: sample_cd_1d:213; GFX10GISEL: ; %bb.0: ; %main_body214; GFX10GISEL-NEXT: image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16215; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)216; GFX10GISEL-NEXT: ; return to shader part epilog217main_body:218 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f16(i32 15, float %dsdh, float %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)219 ret <4 x float> %v220}221 222define 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, half %s, half %t) {223; GFX10-LABEL: sample_cd_2d:224; GFX10: ; %bb.0: ; %main_body225; GFX10-NEXT: v_perm_b32 v4, v5, v4, 0x5040100226; GFX10-NEXT: image_sample_cd v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16227; GFX10-NEXT: s_waitcnt vmcnt(0)228; GFX10-NEXT: ; return to shader part epilog229;230; GFX10GISEL-LABEL: sample_cd_2d:231; GFX10GISEL: ; %bb.0: ; %main_body232; GFX10GISEL-NEXT: v_and_b32_e32 v4, 0xffff, v4233; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v5, 16, v4234; GFX10GISEL-NEXT: image_sample_cd v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16235; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)236; GFX10GISEL-NEXT: ; return to shader part epilog237main_body:238 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f16(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)239 ret <4 x float> %v240}241 242define 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, half %s) {243; GFX10-LABEL: sample_c_cd_1d:244; GFX10: ; %bb.0: ; %main_body245; 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 a16246; GFX10-NEXT: s_waitcnt vmcnt(0)247; GFX10-NEXT: ; return to shader part epilog248;249; GFX10GISEL-LABEL: sample_c_cd_1d:250; GFX10GISEL: ; %bb.0: ; %main_body251; GFX10GISEL-NEXT: image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16252; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)253; GFX10GISEL-NEXT: ; return to shader part epilog254main_body:255 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)256 ret <4 x float> %v257}258 259define 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, half %s, half %t) {260; GFX10-LABEL: sample_c_cd_2d:261; GFX10: ; %bb.0: ; %main_body262; GFX10-NEXT: v_perm_b32 v5, v6, v5, 0x5040100263; GFX10-NEXT: image_sample_c_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16264; GFX10-NEXT: s_waitcnt vmcnt(0)265; GFX10-NEXT: ; return to shader part epilog266;267; GFX10GISEL-LABEL: sample_c_cd_2d:268; GFX10GISEL: ; %bb.0: ; %main_body269; GFX10GISEL-NEXT: v_and_b32_e32 v5, 0xffff, v5270; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v6, 16, v5271; GFX10GISEL-NEXT: image_sample_c_cd v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16272; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)273; GFX10GISEL-NEXT: ; return to shader part epilog274main_body:275 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)276 ret <4 x float> %v277}278 279define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, half %s, half %clamp) {280; GFX10-LABEL: sample_cd_cl_1d:281; GFX10: ; %bb.0: ; %main_body282; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100283; GFX10-NEXT: image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16284; GFX10-NEXT: s_waitcnt vmcnt(0)285; GFX10-NEXT: ; return to shader part epilog286;287; GFX10GISEL-LABEL: sample_cd_cl_1d:288; GFX10GISEL: ; %bb.0: ; %main_body289; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2290; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v3, 16, v2291; GFX10GISEL-NEXT: image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16292; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)293; GFX10GISEL-NEXT: ; return to shader part epilog294main_body:295 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f16(i32 15, float %dsdh, float %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)296 ret <4 x float> %v297}298 299define 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, half %s, half %t, half %clamp) {300; GFX10-LABEL: sample_cd_cl_2d:301; GFX10: ; %bb.0: ; %main_body302; GFX10-NEXT: v_mov_b32_e32 v11, v6303; GFX10-NEXT: v_mov_b32_e32 v9, v3304; GFX10-NEXT: v_mov_b32_e32 v8, v2305; GFX10-NEXT: v_mov_b32_e32 v7, v1306; GFX10-NEXT: v_mov_b32_e32 v6, v0307; GFX10-NEXT: v_perm_b32 v10, v5, v4, 0x5040100308; GFX10-NEXT: image_sample_cd_cl v[0:3], v[6:11], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16309; GFX10-NEXT: s_waitcnt vmcnt(0)310; GFX10-NEXT: ; return to shader part epilog311;312; GFX10GISEL-LABEL: sample_cd_cl_2d:313; GFX10GISEL: ; %bb.0: ; %main_body314; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v5315; GFX10GISEL-NEXT: v_and_b32_e32 v4, 0xffff, v4316; GFX10GISEL-NEXT: v_mov_b32_e32 v5, v6317; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v7, 16, v4318; GFX10GISEL-NEXT: image_sample_cd_cl v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16319; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)320; GFX10GISEL-NEXT: ; return to shader part epilog321main_body:322 %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f16(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)323 ret <4 x float> %v324}325 326define 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, half %s, half %clamp) {327; GFX10-LABEL: sample_c_cd_cl_1d:328; GFX10: ; %bb.0: ; %main_body329; GFX10-NEXT: v_perm_b32 v3, v4, v3, 0x5040100330; GFX10-NEXT: image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16331; GFX10-NEXT: s_waitcnt vmcnt(0)332; GFX10-NEXT: ; return to shader part epilog333;334; GFX10GISEL-LABEL: sample_c_cd_cl_1d:335; GFX10GISEL: ; %bb.0: ; %main_body336; GFX10GISEL-NEXT: v_and_b32_e32 v3, 0xffff, v3337; GFX10GISEL-NEXT: v_lshl_or_b32 v3, v4, 16, v3338; GFX10GISEL-NEXT: image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16339; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)340; GFX10GISEL-NEXT: ; return to shader part epilog341main_body:342 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)343 ret <4 x float> %v344}345 346define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp) {347; GFX10-LABEL: sample_c_cd_cl_2d:348; GFX10: ; %bb.0: ; %main_body349; GFX10-NEXT: v_mov_b32_e32 v13, v7350; GFX10-NEXT: v_mov_b32_e32 v11, v4351; GFX10-NEXT: v_mov_b32_e32 v10, v3352; GFX10-NEXT: v_mov_b32_e32 v9, v2353; GFX10-NEXT: v_mov_b32_e32 v8, v1354; GFX10-NEXT: v_mov_b32_e32 v7, v0355; GFX10-NEXT: v_perm_b32 v12, v6, v5, 0x5040100356; GFX10-NEXT: image_sample_c_cd_cl v[0:3], v[7:13], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16357; GFX10-NEXT: s_waitcnt vmcnt(0)358; GFX10-NEXT: ; return to shader part epilog359;360; GFX10GISEL-LABEL: sample_c_cd_cl_2d:361; GFX10GISEL: ; %bb.0: ; %main_body362; GFX10GISEL-NEXT: v_mov_b32_e32 v8, v6363; GFX10GISEL-NEXT: v_and_b32_e32 v5, 0xffff, v5364; GFX10GISEL-NEXT: v_mov_b32_e32 v6, v7365; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v8, 16, v5366; GFX10GISEL-NEXT: image_sample_c_cd_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16367; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)368; GFX10GISEL-NEXT: ; return to shader part epilog369main_body:370 %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)371 ret <4 x float> %v372}373 374define amdgpu_ps float @sample_c_d_o_2darray_V1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %slice) {375; GFX10-LABEL: sample_c_d_o_2darray_V1:376; GFX10: ; %bb.0: ; %main_body377; GFX10-NEXT: v_mov_b32_e32 v15, v8378; GFX10-NEXT: v_mov_b32_e32 v13, v5379; GFX10-NEXT: v_mov_b32_e32 v12, v4380; GFX10-NEXT: v_mov_b32_e32 v11, v3381; GFX10-NEXT: v_mov_b32_e32 v10, v2382; GFX10-NEXT: v_mov_b32_e32 v9, v1383; GFX10-NEXT: v_mov_b32_e32 v8, v0384; GFX10-NEXT: v_perm_b32 v14, v7, v6, 0x5040100385; GFX10-NEXT: image_sample_c_d_o v0, v[8:15], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY a16386; GFX10-NEXT: s_waitcnt vmcnt(0)387; GFX10-NEXT: ; return to shader part epilog388;389; GFX10GISEL-LABEL: sample_c_d_o_2darray_V1:390; GFX10GISEL: ; %bb.0: ; %main_body391; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v7392; GFX10GISEL-NEXT: v_and_b32_e32 v6, 0xffff, v6393; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v8394; GFX10GISEL-NEXT: v_lshl_or_b32 v6, v9, 16, v6395; GFX10GISEL-NEXT: image_sample_c_d_o v0, v[0:7], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY a16396; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)397; GFX10GISEL-NEXT: ; return to shader part epilog398main_body:399 %v = call float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f16(i32 4, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)400 ret float %v401}402 403define 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, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %slice) {404; GFX10-LABEL: sample_c_d_o_2darray_V2:405; GFX10: ; %bb.0: ; %main_body406; GFX10-NEXT: v_mov_b32_e32 v15, v8407; GFX10-NEXT: v_mov_b32_e32 v13, v5408; GFX10-NEXT: v_mov_b32_e32 v12, v4409; GFX10-NEXT: v_mov_b32_e32 v11, v3410; GFX10-NEXT: v_mov_b32_e32 v10, v2411; GFX10-NEXT: v_mov_b32_e32 v9, v1412; GFX10-NEXT: v_mov_b32_e32 v8, v0413; GFX10-NEXT: v_perm_b32 v14, v7, v6, 0x5040100414; GFX10-NEXT: image_sample_c_d_o v[0:1], v[8:15], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY a16415; GFX10-NEXT: s_waitcnt vmcnt(0)416; GFX10-NEXT: ; return to shader part epilog417;418; GFX10GISEL-LABEL: sample_c_d_o_2darray_V2:419; GFX10GISEL: ; %bb.0: ; %main_body420; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v7421; GFX10GISEL-NEXT: v_and_b32_e32 v6, 0xffff, v6422; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v8423; GFX10GISEL-NEXT: v_lshl_or_b32 v6, v9, 16, v6424; GFX10GISEL-NEXT: image_sample_c_d_o v[0:1], v[0:7], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY a16425; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)426; GFX10GISEL-NEXT: ; return to shader part epilog427main_body:428 %v = call <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f16(i32 6, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)429 ret <2 x float> %v430}431 432declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f16(i32, float, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1433declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f16(i32, float, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1434declare <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f32.f16(i32, float, float, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1435declare <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f16(i32, float, float, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1436declare <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f16(i32, float, float, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1437declare <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f16(i32, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1438declare <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f16(i32, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1439declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f16(i32, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1440declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f16(i32, float, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1441 442declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f16(i32, float, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1443declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f16(i32, float, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1444declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32, float, float, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1445declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32, float, float, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1446declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f16(i32, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1447declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f16(i32, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1448declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32, float, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1449declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32, float, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1450 451declare float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f16(i32, i32, float, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1452declare <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f16(i32, i32, float, float, float, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1453 454define amdgpu_ps <4 x float> @sample_g16_noa16_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s) {455; GFX10-LABEL: sample_g16_noa16_d_1d:456; GFX10: ; %bb.0: ; %main_body457; GFX10-NEXT: image_sample_d_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D458; GFX10-NEXT: s_waitcnt vmcnt(0)459; GFX10-NEXT: ; return to shader part epilog460;461; GFX10GISEL-LABEL: sample_g16_noa16_d_1d:462; GFX10GISEL: ; %bb.0: ; %main_body463; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D464; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)465; GFX10GISEL-NEXT: ; return to shader part epilog466main_body:467 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)468 ret <4 x float> %v469}470 471define amdgpu_ps <4 x float> @sample_g16_noa16_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) {472; GFX10-LABEL: sample_g16_noa16_d_2d:473; GFX10: ; %bb.0: ; %main_body474; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100475; GFX10-NEXT: v_perm_b32 v0, v1, v0, 0x5040100476; GFX10-NEXT: image_sample_d_g16 v[0:3], [v0, v2, v4, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D477; GFX10-NEXT: s_waitcnt vmcnt(0)478; GFX10-NEXT: ; return to shader part epilog479;480; GFX10GISEL-LABEL: sample_g16_noa16_d_2d:481; GFX10GISEL: ; %bb.0: ; %main_body482; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0483; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2484; GFX10GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0485; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v3, 16, v2486; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], [v0, v1, v4, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D487; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)488; GFX10GISEL-NEXT: ; return to shader part epilog489main_body:490 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)491 ret <4 x float> %v492}493 494define amdgpu_ps <4 x float> @sample_g16_noa16_d_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, float %s, float %t, float %r) {495; GFX10-LABEL: sample_g16_noa16_d_3d:496; GFX10: ; %bb.0: ; %main_body497; GFX10-NEXT: v_mov_b32_e32 v9, v3498; GFX10-NEXT: v_mov_b32_e32 v3, v2499; GFX10-NEXT: v_perm_b32 v2, v1, v0, 0x5040100500; GFX10-NEXT: v_perm_b32 v4, v4, v9, 0x5040100501; GFX10-NEXT: image_sample_d_g16 v[0:3], v[2:8], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D502; GFX10-NEXT: s_waitcnt vmcnt(0)503; GFX10-NEXT: ; return to shader part epilog504;505; GFX10GISEL-LABEL: sample_g16_noa16_d_3d:506; GFX10GISEL: ; %bb.0: ; %main_body507; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v3508; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0509; GFX10GISEL-NEXT: v_mov_b32_e32 v3, v2510; GFX10GISEL-NEXT: v_and_b32_e32 v9, 0xffff, v9511; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v1, 16, v0512; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v4, 16, v9513; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], v[2:8], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D514; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)515; GFX10GISEL-NEXT: ; return to shader part epilog516main_body:517 %v = call <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f32(i32 15, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, float %s, float %t, float %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)518 ret <4 x float> %v519}520 521define amdgpu_ps <4 x float> @sample_g16_noa16_c_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s) {522; GFX10-LABEL: sample_g16_noa16_c_d_1d:523; GFX10: ; %bb.0: ; %main_body524; GFX10-NEXT: image_sample_c_d_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D525; GFX10-NEXT: s_waitcnt vmcnt(0)526; GFX10-NEXT: ; return to shader part epilog527;528; GFX10GISEL-LABEL: sample_g16_noa16_c_d_1d:529; GFX10GISEL: ; %bb.0: ; %main_body530; GFX10GISEL-NEXT: image_sample_c_d_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D531; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)532; GFX10GISEL-NEXT: ; return to shader part epilog533main_body:534 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.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)535 ret <4 x float> %v536}537 538define amdgpu_ps <4 x float> @sample_g16_noa16_c_d_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) {539; GFX10-LABEL: sample_g16_noa16_c_d_2d:540; GFX10: ; %bb.0: ; %main_body541; GFX10-NEXT: v_perm_b32 v3, v4, v3, 0x5040100542; GFX10-NEXT: v_perm_b32 v1, v2, v1, 0x5040100543; GFX10-NEXT: image_sample_c_d_g16 v[0:3], [v0, v1, v3, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D544; GFX10-NEXT: s_waitcnt vmcnt(0)545; GFX10-NEXT: ; return to shader part epilog546;547; GFX10GISEL-LABEL: sample_g16_noa16_c_d_2d:548; GFX10GISEL: ; %bb.0: ; %main_body549; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v1550; GFX10GISEL-NEXT: v_and_b32_e32 v3, 0xffff, v3551; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v2, 16, v1552; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v4, 16, v3553; GFX10GISEL-NEXT: image_sample_c_d_g16 v[0:3], [v0, v1, v2, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D554; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)555; GFX10GISEL-NEXT: ; return to shader part epilog556main_body:557 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.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)558 ret <4 x float> %v559}560 561define amdgpu_ps <4 x float> @sample_g16_noa16_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s, float %clamp) {562; GFX10-LABEL: sample_g16_noa16_d_cl_1d:563; GFX10: ; %bb.0: ; %main_body564; GFX10-NEXT: image_sample_d_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D565; GFX10-NEXT: s_waitcnt vmcnt(0)566; GFX10-NEXT: ; return to shader part epilog567;568; GFX10GISEL-LABEL: sample_g16_noa16_d_cl_1d:569; GFX10GISEL: ; %bb.0: ; %main_body570; GFX10GISEL-NEXT: image_sample_d_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D571; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)572; GFX10GISEL-NEXT: ; return to shader part epilog573main_body:574 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)575 ret <4 x float> %v576}577 578define amdgpu_ps <4 x float> @sample_g16_noa16_d_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) {579; GFX10-LABEL: sample_g16_noa16_d_cl_2d:580; GFX10: ; %bb.0: ; %main_body581; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100582; GFX10-NEXT: v_perm_b32 v0, v1, v0, 0x5040100583; GFX10-NEXT: image_sample_d_cl_g16 v[0:3], [v0, v2, v4, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D584; GFX10-NEXT: s_waitcnt vmcnt(0)585; GFX10-NEXT: ; return to shader part epilog586;587; GFX10GISEL-LABEL: sample_g16_noa16_d_cl_2d:588; GFX10GISEL: ; %bb.0: ; %main_body589; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0590; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2591; GFX10GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0592; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v3, 16, v2593; GFX10GISEL-NEXT: image_sample_d_cl_g16 v[0:3], [v0, v1, v4, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D594; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)595; GFX10GISEL-NEXT: ; return to shader part epilog596main_body:597 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)598 ret <4 x float> %v599}600 601define amdgpu_ps <4 x float> @sample_g16_noa16_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp) {602; GFX10-LABEL: sample_g16_noa16_c_d_cl_1d:603; GFX10: ; %bb.0: ; %main_body604; GFX10-NEXT: image_sample_c_d_cl_g16 v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D605; GFX10-NEXT: s_waitcnt vmcnt(0)606; GFX10-NEXT: ; return to shader part epilog607;608; GFX10GISEL-LABEL: sample_g16_noa16_c_d_cl_1d:609; GFX10GISEL: ; %bb.0: ; %main_body610; GFX10GISEL-NEXT: image_sample_c_d_cl_g16 v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D611; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)612; GFX10GISEL-NEXT: ; return to shader part epilog613main_body:614 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.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)615 ret <4 x float> %v616}617 618define amdgpu_ps <4 x float> @sample_g16_noa16_c_d_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) {619; GFX10-LABEL: sample_g16_noa16_c_d_cl_2d:620; GFX10: ; %bb.0: ; %main_body621; GFX10-NEXT: v_mov_b32_e32 v8, v2622; GFX10-NEXT: v_mov_b32_e32 v2, v0623; GFX10-NEXT: v_perm_b32 v4, v4, v3, 0x5040100624; GFX10-NEXT: v_perm_b32 v3, v8, v1, 0x5040100625; GFX10-NEXT: image_sample_c_d_cl_g16 v[0:3], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D626; GFX10-NEXT: s_waitcnt vmcnt(0)627; GFX10-NEXT: ; return to shader part epilog628;629; GFX10GISEL-LABEL: sample_g16_noa16_c_d_cl_2d:630; GFX10GISEL: ; %bb.0: ; %main_body631; GFX10GISEL-NEXT: v_mov_b32_e32 v8, v2632; GFX10GISEL-NEXT: v_mov_b32_e32 v2, v0633; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v1634; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v3635; GFX10GISEL-NEXT: v_lshl_or_b32 v3, v8, 16, v0636; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v4, 16, v1637; GFX10GISEL-NEXT: image_sample_c_d_cl_g16 v[0:3], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D638; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)639; GFX10GISEL-NEXT: ; return to shader part epilog640main_body:641 %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.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)642 ret <4 x float> %v643}644 645define amdgpu_ps <4 x float> @sample_g16_noa16_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s) {646; GFX10-LABEL: sample_g16_noa16_cd_1d:647; GFX10: ; %bb.0: ; %main_body648; GFX10-NEXT: image_sample_cd_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D649; GFX10-NEXT: s_waitcnt vmcnt(0)650; GFX10-NEXT: ; return to shader part epilog651;652; GFX10GISEL-LABEL: sample_g16_noa16_cd_1d:653; GFX10GISEL: ; %bb.0: ; %main_body654; GFX10GISEL-NEXT: image_sample_cd_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D655; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)656; GFX10GISEL-NEXT: ; return to shader part epilog657main_body:658 %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)659 ret <4 x float> %v660}661 662define amdgpu_ps <4 x float> @sample_g16_noa16_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t) {663; GFX10-LABEL: sample_g16_noa16_cd_2d:664; GFX10: ; %bb.0: ; %main_body665; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100666; GFX10-NEXT: v_perm_b32 v0, v1, v0, 0x5040100667; 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_2D668; GFX10-NEXT: s_waitcnt vmcnt(0)669; GFX10-NEXT: ; return to shader part epilog670;671; GFX10GISEL-LABEL: sample_g16_noa16_cd_2d:672; GFX10GISEL: ; %bb.0: ; %main_body673; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0674; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2675; GFX10GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0676; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v3, 16, v2677; GFX10GISEL-NEXT: image_sample_cd_g16 v[0:3], [v0, v1, v4, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D678; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)679; GFX10GISEL-NEXT: ; return to shader part epilog680main_body:681 %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)682 ret <4 x float> %v683}684 685define amdgpu_ps <4 x float> @sample_g16_noa16_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s) {686; GFX10-LABEL: sample_g16_noa16_c_cd_1d:687; GFX10: ; %bb.0: ; %main_body688; 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_1D689; GFX10-NEXT: s_waitcnt vmcnt(0)690; GFX10-NEXT: ; return to shader part epilog691;692; GFX10GISEL-LABEL: sample_g16_noa16_c_cd_1d:693; GFX10GISEL: ; %bb.0: ; %main_body694; GFX10GISEL-NEXT: image_sample_c_cd_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D695; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)696; GFX10GISEL-NEXT: ; return to shader part epilog697main_body:698 %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)699 ret <4 x float> %v700}701 702define amdgpu_ps <4 x float> @sample_g16_noa16_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) {703; GFX10-LABEL: sample_g16_noa16_c_cd_2d:704; GFX10: ; %bb.0: ; %main_body705; GFX10-NEXT: v_perm_b32 v3, v4, v3, 0x5040100706; GFX10-NEXT: v_perm_b32 v1, v2, v1, 0x5040100707; 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_2D708; GFX10-NEXT: s_waitcnt vmcnt(0)709; GFX10-NEXT: ; return to shader part epilog710;711; GFX10GISEL-LABEL: sample_g16_noa16_c_cd_2d:712; GFX10GISEL: ; %bb.0: ; %main_body713; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v1714; GFX10GISEL-NEXT: v_and_b32_e32 v3, 0xffff, v3715; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v2, 16, v1716; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v4, 16, v3717; GFX10GISEL-NEXT: image_sample_c_cd_g16 v[0:3], [v0, v1, v2, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D718; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)719; GFX10GISEL-NEXT: ; return to shader part epilog720main_body:721 %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)722 ret <4 x float> %v723}724 725define amdgpu_ps <4 x float> @sample_g16_noa16_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, float %s, float %clamp) {726; GFX10-LABEL: sample_g16_noa16_cd_cl_1d:727; GFX10: ; %bb.0: ; %main_body728; 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_1D729; GFX10-NEXT: s_waitcnt vmcnt(0)730; GFX10-NEXT: ; return to shader part epilog731;732; GFX10GISEL-LABEL: sample_g16_noa16_cd_cl_1d:733; GFX10GISEL: ; %bb.0: ; %main_body734; GFX10GISEL-NEXT: image_sample_cd_cl_g16 v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D735; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)736; GFX10GISEL-NEXT: ; return to shader part epilog737main_body:738 %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)739 ret <4 x float> %v740}741 742define amdgpu_ps <4 x float> @sample_g16_noa16_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) {743; GFX10-LABEL: sample_g16_noa16_cd_cl_2d:744; GFX10: ; %bb.0: ; %main_body745; GFX10-NEXT: v_perm_b32 v2, v3, v2, 0x5040100746; GFX10-NEXT: v_perm_b32 v0, v1, v0, 0x5040100747; 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_2D748; GFX10-NEXT: s_waitcnt vmcnt(0)749; GFX10-NEXT: ; return to shader part epilog750;751; GFX10GISEL-LABEL: sample_g16_noa16_cd_cl_2d:752; GFX10GISEL: ; %bb.0: ; %main_body753; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0754; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2755; GFX10GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0756; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v3, 16, v2757; GFX10GISEL-NEXT: image_sample_cd_cl_g16 v[0:3], [v0, v1, v4, v5, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D758; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)759; GFX10GISEL-NEXT: ; return to shader part epilog760main_body:761 %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)762 ret <4 x float> %v763}764 765define amdgpu_ps <4 x float> @sample_g16_noa16_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, float %s, float %clamp) {766; GFX10-LABEL: sample_g16_noa16_c_cd_cl_1d:767; GFX10: ; %bb.0: ; %main_body768; 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_1D769; GFX10-NEXT: s_waitcnt vmcnt(0)770; GFX10-NEXT: ; return to shader part epilog771;772; GFX10GISEL-LABEL: sample_g16_noa16_c_cd_cl_1d:773; GFX10GISEL: ; %bb.0: ; %main_body774; GFX10GISEL-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_1D775; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)776; GFX10GISEL-NEXT: ; return to shader part epilog777main_body:778 %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)779 ret <4 x float> %v780}781 782define amdgpu_ps <4 x float> @sample_g16_noa16_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) {783; GFX10-LABEL: sample_g16_noa16_c_cd_cl_2d:784; GFX10: ; %bb.0: ; %main_body785; GFX10-NEXT: v_mov_b32_e32 v8, v2786; GFX10-NEXT: v_mov_b32_e32 v2, v0787; GFX10-NEXT: v_perm_b32 v4, v4, v3, 0x5040100788; GFX10-NEXT: v_perm_b32 v3, v8, v1, 0x5040100789; 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_2D790; GFX10-NEXT: s_waitcnt vmcnt(0)791; GFX10-NEXT: ; return to shader part epilog792;793; GFX10GISEL-LABEL: sample_g16_noa16_c_cd_cl_2d:794; GFX10GISEL: ; %bb.0: ; %main_body795; GFX10GISEL-NEXT: v_mov_b32_e32 v8, v2796; GFX10GISEL-NEXT: v_mov_b32_e32 v2, v0797; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v1798; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v3799; GFX10GISEL-NEXT: v_lshl_or_b32 v3, v8, 16, v0800; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v4, 16, v1801; GFX10GISEL-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_2D802; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)803; GFX10GISEL-NEXT: ; return to shader part epilog804main_body:805 %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)806 ret <4 x float> %v807}808 809define amdgpu_ps float @sample_g16_noa16_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, float %s, float %t, float %slice) {810; GFX10-LABEL: sample_g16_noa16_c_d_o_2darray_V1:811; GFX10: ; %bb.0: ; %main_body812; GFX10-NEXT: v_mov_b32_e32 v9, v3813; GFX10-NEXT: v_mov_b32_e32 v10, v2814; GFX10-NEXT: v_mov_b32_e32 v3, v1815; GFX10-NEXT: v_mov_b32_e32 v2, v0816; GFX10-NEXT: v_perm_b32 v5, v5, v4, 0x5040100817; GFX10-NEXT: v_perm_b32 v4, v9, v10, 0x5040100818; GFX10-NEXT: image_sample_c_d_o_g16 v0, v[2:8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY819; GFX10-NEXT: s_waitcnt vmcnt(0)820; GFX10-NEXT: ; return to shader part epilog821;822; GFX10GISEL-LABEL: sample_g16_noa16_c_d_o_2darray_V1:823; GFX10GISEL: ; %bb.0: ; %main_body824; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v2825; GFX10GISEL-NEXT: v_mov_b32_e32 v10, v3826; GFX10GISEL-NEXT: v_mov_b32_e32 v2, v0827; GFX10GISEL-NEXT: v_mov_b32_e32 v3, v1828; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v4829; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v9830; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v5, 16, v1831; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v10, 16, v0832; GFX10GISEL-NEXT: image_sample_c_d_o_g16 v0, v[2:8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY833; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)834; GFX10GISEL-NEXT: ; return to shader part epilog835main_body:836 %v = call float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f16.f32(i32 4, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)837 ret float %v838}839 840define amdgpu_ps <2 x float> @sample_g16_noa16_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, float %s, float %t, float %slice) {841; GFX10-LABEL: sample_g16_noa16_c_d_o_2darray_V2:842; GFX10: ; %bb.0: ; %main_body843; GFX10-NEXT: v_mov_b32_e32 v9, v3844; GFX10-NEXT: v_mov_b32_e32 v10, v2845; GFX10-NEXT: v_mov_b32_e32 v3, v1846; GFX10-NEXT: v_mov_b32_e32 v2, v0847; GFX10-NEXT: v_perm_b32 v5, v5, v4, 0x5040100848; GFX10-NEXT: v_perm_b32 v4, v9, v10, 0x5040100849; GFX10-NEXT: image_sample_c_d_o_g16 v[0:1], v[2:8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY850; GFX10-NEXT: s_waitcnt vmcnt(0)851; GFX10-NEXT: ; return to shader part epilog852;853; GFX10GISEL-LABEL: sample_g16_noa16_c_d_o_2darray_V2:854; GFX10GISEL: ; %bb.0: ; %main_body855; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v2856; GFX10GISEL-NEXT: v_mov_b32_e32 v10, v3857; GFX10GISEL-NEXT: v_mov_b32_e32 v2, v0858; GFX10GISEL-NEXT: v_mov_b32_e32 v3, v1859; GFX10GISEL-NEXT: v_and_b32_e32 v1, 0xffff, v4860; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v9861; GFX10GISEL-NEXT: v_lshl_or_b32 v5, v5, 16, v1862; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v10, 16, v0863; GFX10GISEL-NEXT: image_sample_c_d_o_g16 v[0:1], v[2:8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY864; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)865; GFX10GISEL-NEXT: ; return to shader part epilog866main_body:867 %v = call <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f16.f32(i32 6, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)868 ret <2 x float> %v869}870 871declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f16.f32(i32, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1872declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1873declare <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f32(i32, half, half, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1874declare <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f16.f32(i32, float, half, half, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1875declare <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1876declare <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f16.f32(i32, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1877declare <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f16.f32(i32, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1878declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f16.f32(i32, float, half, half, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1879declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f16.f32(i32, float, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1880 881declare <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) #1882declare <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) #1883declare <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) #1884declare <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) #1885declare <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) #1886declare <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) #1887declare <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) #1888declare <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) #1889 890declare float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f16.f32(i32, i32, float, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1891declare <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f16.f32(i32, i32, float, half, half, half, half, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1892 893define amdgpu_ps <4 x float> @sample_d_1d_g16_a16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s) {894; GFX10-LABEL: sample_d_1d_g16_a16:895; GFX10: ; %bb.0: ; %main_body896; GFX10-NEXT: image_sample_d_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16897; GFX10-NEXT: s_waitcnt vmcnt(0)898; GFX10-NEXT: ; return to shader part epilog899;900; GFX10GISEL-LABEL: sample_d_1d_g16_a16:901; GFX10GISEL: ; %bb.0: ; %main_body902; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16903; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)904; GFX10GISEL-NEXT: ; return to shader part epilog905main_body:906 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)907 ret <4 x float> %v908}909 910define amdgpu_ps <4 x float> @sample_d_2d_g16_a16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {911; GFX10-LABEL: sample_d_2d_g16_a16:912; GFX10: ; %bb.0: ; %main_body913; GFX10-NEXT: v_perm_b32 v4, v5, v4, 0x5040100914; GFX10-NEXT: v_perm_b32 v3, v3, v2, 0x5040100915; GFX10-NEXT: v_perm_b32 v2, v1, v0, 0x5040100916; GFX10-NEXT: image_sample_d_g16 v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16917; GFX10-NEXT: s_waitcnt vmcnt(0)918; GFX10-NEXT: ; return to shader part epilog919;920; GFX10GISEL-LABEL: sample_d_2d_g16_a16:921; GFX10GISEL: ; %bb.0: ; %main_body922; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0923; GFX10GISEL-NEXT: v_and_b32_e32 v2, 0xffff, v2924; GFX10GISEL-NEXT: v_and_b32_e32 v4, 0xffff, v4925; GFX10GISEL-NEXT: v_lshl_or_b32 v0, v1, 16, v0926; GFX10GISEL-NEXT: v_lshl_or_b32 v1, v3, 16, v2927; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v5, 16, v4928; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16929; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)930; GFX10GISEL-NEXT: ; return to shader part epilog931main_body:932 %v = call <4 x float> @llvm.amdgcn.image.sample.d.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)933 ret <4 x float> %v934}935 936define amdgpu_ps <4 x float> @sample_d_3d_g16_a16(<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) {937; GFX10-LABEL: sample_d_3d_g16_a16:938; GFX10: ; %bb.0: ; %main_body939; GFX10-NEXT: v_mov_b32_e32 v12, v8940; GFX10-NEXT: v_mov_b32_e32 v10, v5941; GFX10-NEXT: v_mov_b32_e32 v8, v2942; GFX10-NEXT: v_perm_b32 v11, v7, v6, 0x5040100943; GFX10-NEXT: v_perm_b32 v9, v4, v3, 0x5040100944; GFX10-NEXT: v_perm_b32 v7, v1, v0, 0x5040100945; GFX10-NEXT: image_sample_d_g16 v[0:3], v[7:12], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a16946; GFX10-NEXT: s_waitcnt vmcnt(0)947; GFX10-NEXT: ; return to shader part epilog948;949; GFX10GISEL-LABEL: sample_d_3d_g16_a16:950; GFX10GISEL: ; %bb.0: ; %main_body951; GFX10GISEL-NEXT: v_mov_b32_e32 v9, v3952; GFX10GISEL-NEXT: v_mov_b32_e32 v10, v7953; GFX10GISEL-NEXT: v_mov_b32_e32 v7, v8954; GFX10GISEL-NEXT: v_and_b32_e32 v0, 0xffff, v0955; GFX10GISEL-NEXT: v_and_b32_e32 v6, 0xffff, v6956; GFX10GISEL-NEXT: v_and_b32_e32 v8, 0xffff, v9957; GFX10GISEL-NEXT: v_mov_b32_e32 v3, v2958; GFX10GISEL-NEXT: v_lshl_or_b32 v2, v1, 16, v0959; GFX10GISEL-NEXT: v_lshl_or_b32 v6, v10, 16, v6960; GFX10GISEL-NEXT: v_lshl_or_b32 v4, v4, 16, v8961; GFX10GISEL-NEXT: image_sample_d_g16 v[0:3], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a16962; GFX10GISEL-NEXT: s_waitcnt vmcnt(0)963; GFX10GISEL-NEXT: ; return to shader part epilog964main_body:965 %v = call <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, half %s, half %t, half %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)966 ret <4 x float> %v967}968 969declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f16.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32)970declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32)971declare <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f16(i32, half, half, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32)972 973attributes #0 = { nounwind }974attributes #1 = { nounwind readonly }975attributes #2 = { nounwind readnone }976