brintos

brintos / llvm-project-archived public Read only

0
0
Text · 29.5 KiB · 5a35c69 Raw
628 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=amdgcn -mcpu=tonga | FileCheck -check-prefixes=TONGA %s3; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx810 | FileCheck -check-prefixes=GFX81 %s4; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx900 | FileCheck -check-prefixes=GFX9 %s5; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1010 | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s6; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -amdgpu-enable-delay-alu=0 | FileCheck -check-prefixes=GFX10PLUS,GFX11,GFX11-TRUE16 %s7; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 -amdgpu-enable-delay-alu=0 | FileCheck -check-prefixes=GFX10PLUS,GFX11,GFX11-FAKE16 %s8; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 -amdgpu-enable-delay-alu=0 | FileCheck -check-prefixes=GFX12,GFX12-TRUE16 %s9; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 -amdgpu-enable-delay-alu=0 | FileCheck -check-prefixes=GFX12,GFX12-FAKE16 %s10 11define amdgpu_ps half @image_sample_2d_f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) {12; TONGA-LABEL: image_sample_2d_f16:13; TONGA:       ; %bb.0: ; %main_body14; TONGA-NEXT:    s_mov_b64 s[12:13], exec15; TONGA-NEXT:    s_wqm_b64 exec, exec16; TONGA-NEXT:    s_and_b64 exec, exec, s[12:13]17; TONGA-NEXT:    image_sample v0, v[0:1], s[0:7], s[8:11] dmask:0x1 d1618; TONGA-NEXT:    s_waitcnt vmcnt(0)19; TONGA-NEXT:    ; return to shader part epilog20;21; GFX81-LABEL: image_sample_2d_f16:22; GFX81:       ; %bb.0: ; %main_body23; GFX81-NEXT:    s_mov_b64 s[12:13], exec24; GFX81-NEXT:    s_wqm_b64 exec, exec25; GFX81-NEXT:    s_and_b64 exec, exec, s[12:13]26; GFX81-NEXT:    image_sample v0, v[0:1], s[0:7], s[8:11] dmask:0x1 d1627; GFX81-NEXT:    s_waitcnt vmcnt(0)28; GFX81-NEXT:    ; return to shader part epilog29;30; GFX9-LABEL: image_sample_2d_f16:31; GFX9:       ; %bb.0: ; %main_body32; GFX9-NEXT:    s_mov_b64 s[12:13], exec33; GFX9-NEXT:    s_wqm_b64 exec, exec34; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]35; GFX9-NEXT:    image_sample v0, v[0:1], s[0:7], s[8:11] dmask:0x1 d1636; GFX9-NEXT:    s_waitcnt vmcnt(0)37; GFX9-NEXT:    ; return to shader part epilog38;39; GFX10PLUS-LABEL: image_sample_2d_f16:40; GFX10PLUS:       ; %bb.0: ; %main_body41; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo42; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo43; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s1244; GFX10PLUS-NEXT:    image_sample v0, v[0:1], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D d1645; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)46; GFX10PLUS-NEXT:    ; return to shader part epilog47;48; GFX12-LABEL: image_sample_2d_f16:49; GFX12:       ; %bb.0: ; %main_body50; GFX12-NEXT:    s_mov_b32 s12, exec_lo51; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo52; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s1253; GFX12-NEXT:    image_sample v0, [v0, v1], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D d1654; GFX12-NEXT:    s_wait_samplecnt 0x055; GFX12-NEXT:    ; return to shader part epilog56main_body:57  %tex = call half @llvm.amdgcn.image.sample.2d.f16.f32(i32 1, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0)58  ret half %tex59}60 61define amdgpu_ps half @image_sample_2d_f16_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, ptr addrspace(1) inreg %out) {62; TONGA-LABEL: image_sample_2d_f16_tfe:63; TONGA:       ; %bb.0: ; %main_body64; TONGA-NEXT:    s_mov_b64 s[14:15], exec65; TONGA-NEXT:    s_wqm_b64 exec, exec66; TONGA-NEXT:    v_mov_b32_e32 v2, 067; TONGA-NEXT:    v_mov_b32_e32 v3, v268; TONGA-NEXT:    s_and_b64 exec, exec, s[14:15]69; TONGA-NEXT:    image_sample v[2:3], v[0:1], s[0:7], s[8:11] dmask:0x1 tfe d1670; TONGA-NEXT:    v_mov_b32_e32 v0, s1271; TONGA-NEXT:    v_mov_b32_e32 v1, s1372; TONGA-NEXT:    s_waitcnt vmcnt(0)73; TONGA-NEXT:    flat_store_dword v[0:1], v374; TONGA-NEXT:    v_mov_b32_e32 v0, v275; TONGA-NEXT:    s_waitcnt vmcnt(0)76; TONGA-NEXT:    ; return to shader part epilog77;78; GFX81-LABEL: image_sample_2d_f16_tfe:79; GFX81:       ; %bb.0: ; %main_body80; GFX81-NEXT:    s_mov_b64 s[14:15], exec81; GFX81-NEXT:    s_wqm_b64 exec, exec82; GFX81-NEXT:    v_mov_b32_e32 v2, 083; GFX81-NEXT:    v_mov_b32_e32 v3, v284; GFX81-NEXT:    s_and_b64 exec, exec, s[14:15]85; GFX81-NEXT:    image_sample v[2:3], v[0:1], s[0:7], s[8:11] dmask:0x1 tfe d1686; GFX81-NEXT:    v_mov_b32_e32 v0, s1287; GFX81-NEXT:    v_mov_b32_e32 v1, s1388; GFX81-NEXT:    s_waitcnt vmcnt(0)89; GFX81-NEXT:    flat_store_dword v[0:1], v390; GFX81-NEXT:    v_mov_b32_e32 v0, v291; GFX81-NEXT:    s_waitcnt vmcnt(0)92; GFX81-NEXT:    ; return to shader part epilog93;94; GFX9-LABEL: image_sample_2d_f16_tfe:95; GFX9:       ; %bb.0: ; %main_body96; GFX9-NEXT:    s_mov_b64 s[14:15], exec97; GFX9-NEXT:    s_wqm_b64 exec, exec98; GFX9-NEXT:    v_mov_b32_e32 v4, 099; GFX9-NEXT:    v_mov_b32_e32 v5, v4100; GFX9-NEXT:    v_mov_b32_e32 v2, v4101; GFX9-NEXT:    v_mov_b32_e32 v3, v5102; GFX9-NEXT:    s_and_b64 exec, exec, s[14:15]103; GFX9-NEXT:    image_sample v[2:3], v[0:1], s[0:7], s[8:11] dmask:0x1 tfe d16104; GFX9-NEXT:    s_waitcnt vmcnt(0)105; GFX9-NEXT:    v_mov_b32_e32 v0, v2106; GFX9-NEXT:    global_store_dword v4, v3, s[12:13]107; GFX9-NEXT:    s_waitcnt vmcnt(0)108; GFX9-NEXT:    ; return to shader part epilog109;110; GFX10-LABEL: image_sample_2d_f16_tfe:111; GFX10:       ; %bb.0: ; %main_body112; GFX10-NEXT:    s_mov_b32 s14, exec_lo113; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo114; GFX10-NEXT:    v_mov_b32_e32 v4, 0115; GFX10-NEXT:    v_mov_b32_e32 v3, v1116; GFX10-NEXT:    v_mov_b32_e32 v2, v0117; GFX10-NEXT:    v_mov_b32_e32 v5, v4118; GFX10-NEXT:    v_mov_b32_e32 v0, v4119; GFX10-NEXT:    v_mov_b32_e32 v1, v5120; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s14121; GFX10-NEXT:    image_sample v[0:1], v[2:3], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe d16122; GFX10-NEXT:    s_waitcnt vmcnt(0)123; GFX10-NEXT:    global_store_dword v4, v1, s[12:13]124; GFX10-NEXT:    ; return to shader part epilog125;126; GFX11-TRUE16-LABEL: image_sample_2d_f16_tfe:127; GFX11-TRUE16:       ; %bb.0: ; %main_body128; GFX11-TRUE16-NEXT:    s_mov_b32 s14, exec_lo129; GFX11-TRUE16-NEXT:    s_wqm_b32 exec_lo, exec_lo130; GFX11-TRUE16-NEXT:    v_mov_b32_e32 v2, 0131; GFX11-TRUE16-NEXT:    v_mov_b32_e32 v3, v2132; GFX11-TRUE16-NEXT:    v_mov_b32_e32 v4, v3133; GFX11-TRUE16-NEXT:    v_mov_b32_e32 v3, v2134; GFX11-TRUE16-NEXT:    s_and_b32 exec_lo, exec_lo, s14135; GFX11-TRUE16-NEXT:    image_sample v[3:4], v[0:1], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe d16136; GFX11-TRUE16-NEXT:    s_waitcnt vmcnt(0)137; GFX11-TRUE16-NEXT:    v_mov_b16_e32 v0.l, v3.l138; GFX11-TRUE16-NEXT:    global_store_b32 v2, v4, s[12:13]139; GFX11-TRUE16-NEXT:    ; return to shader part epilog140;141; GFX11-FAKE16-LABEL: image_sample_2d_f16_tfe:142; GFX11-FAKE16:       ; %bb.0: ; %main_body143; GFX11-FAKE16-NEXT:    s_mov_b32 s14, exec_lo144; GFX11-FAKE16-NEXT:    s_wqm_b32 exec_lo, exec_lo145; GFX11-FAKE16-NEXT:    v_dual_mov_b32 v4, 0 :: v_dual_mov_b32 v3, v1146; GFX11-FAKE16-NEXT:    v_mov_b32_e32 v2, v0147; GFX11-FAKE16-NEXT:    v_mov_b32_e32 v5, v4148; GFX11-FAKE16-NEXT:    v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5149; GFX11-FAKE16-NEXT:    s_and_b32 exec_lo, exec_lo, s14150; GFX11-FAKE16-NEXT:    image_sample v[0:1], v[2:3], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe d16151; GFX11-FAKE16-NEXT:    s_waitcnt vmcnt(0)152; GFX11-FAKE16-NEXT:    global_store_b32 v4, v1, s[12:13]153; GFX11-FAKE16-NEXT:    ; return to shader part epilog154;155; GFX12-TRUE16-LABEL: image_sample_2d_f16_tfe:156; GFX12-TRUE16:       ; %bb.0: ; %main_body157; GFX12-TRUE16-NEXT:    s_mov_b32 s14, exec_lo158; GFX12-TRUE16-NEXT:    s_wqm_b32 exec_lo, exec_lo159; GFX12-TRUE16-NEXT:    v_mov_b32_e32 v2, 0160; GFX12-TRUE16-NEXT:    v_mov_b32_e32 v3, v2161; GFX12-TRUE16-NEXT:    v_mov_b32_e32 v4, v3162; GFX12-TRUE16-NEXT:    v_mov_b32_e32 v3, v2163; GFX12-TRUE16-NEXT:    s_and_b32 exec_lo, exec_lo, s14164; GFX12-TRUE16-NEXT:    image_sample v[3:4], [v0, v1], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe d16165; GFX12-TRUE16-NEXT:    s_wait_samplecnt 0x0166; GFX12-TRUE16-NEXT:    v_mov_b16_e32 v0.l, v3.l167; GFX12-TRUE16-NEXT:    global_store_b32 v2, v4, s[12:13]168; GFX12-TRUE16-NEXT:    ; return to shader part epilog169;170; GFX12-FAKE16-LABEL: image_sample_2d_f16_tfe:171; GFX12-FAKE16:       ; %bb.0: ; %main_body172; GFX12-FAKE16-NEXT:    s_mov_b32 s14, exec_lo173; GFX12-FAKE16-NEXT:    s_wqm_b32 exec_lo, exec_lo174; GFX12-FAKE16-NEXT:    v_mov_b32_e32 v4, 0175; GFX12-FAKE16-NEXT:    v_dual_mov_b32 v2, v1 :: v_dual_mov_b32 v3, v0176; GFX12-FAKE16-NEXT:    v_mov_b32_e32 v5, v4177; GFX12-FAKE16-NEXT:    v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5178; GFX12-FAKE16-NEXT:    s_and_b32 exec_lo, exec_lo, s14179; GFX12-FAKE16-NEXT:    image_sample v[0:1], [v3, v2], s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe d16180; GFX12-FAKE16-NEXT:    s_wait_samplecnt 0x0181; GFX12-FAKE16-NEXT:    global_store_b32 v4, v1, s[12:13]182; GFX12-FAKE16-NEXT:    ; return to shader part epilog183main_body:184  %tex = call {half,i32} @llvm.amdgcn.image.sample.2d.f16i32.f32(i32 1, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 1, i32 0)185  %tex.vec = extractvalue {half, i32} %tex, 0186  %tex.err = extractvalue {half, i32} %tex, 1187  store i32 %tex.err, ptr addrspace(1) %out, align 4188  ret half %tex.vec189}190 191define amdgpu_ps float @image_sample_c_d_1d_v2f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {192; TONGA-LABEL: image_sample_c_d_1d_v2f16:193; TONGA:       ; %bb.0: ; %main_body194; TONGA-NEXT:    image_sample_c_d v[0:1], v[0:3], s[0:7], s[8:11] dmask:0x3 d16195; TONGA-NEXT:    s_waitcnt vmcnt(0)196; TONGA-NEXT:    v_lshlrev_b32_e32 v1, 16, v1197; TONGA-NEXT:    v_or_b32_sdwa v0, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD198; TONGA-NEXT:    ; return to shader part epilog199;200; GFX81-LABEL: image_sample_c_d_1d_v2f16:201; GFX81:       ; %bb.0: ; %main_body202; GFX81-NEXT:    image_sample_c_d v0, v[0:3], s[0:7], s[8:11] dmask:0x3 d16203; GFX81-NEXT:    s_waitcnt vmcnt(0)204; GFX81-NEXT:    ; return to shader part epilog205;206; GFX9-LABEL: image_sample_c_d_1d_v2f16:207; GFX9:       ; %bb.0: ; %main_body208; GFX9-NEXT:    image_sample_c_d v0, v[0:3], s[0:7], s[8:11] dmask:0x3 d16209; GFX9-NEXT:    s_waitcnt vmcnt(0)210; GFX9-NEXT:    ; return to shader part epilog211;212; GFX10PLUS-LABEL: image_sample_c_d_1d_v2f16:213; GFX10PLUS:       ; %bb.0: ; %main_body214; GFX10PLUS-NEXT:    image_sample_c_d v0, v[0:3], s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D d16215; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)216; GFX10PLUS-NEXT:    ; return to shader part epilog217;218; GFX12-LABEL: image_sample_c_d_1d_v2f16:219; GFX12:       ; %bb.0: ; %main_body220; GFX12-NEXT:    image_sample_c_d v0, [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D d16221; GFX12-NEXT:    s_wait_samplecnt 0x0222; GFX12-NEXT:    ; return to shader part epilog223main_body:224  %tex = call <2 x half> @llvm.amdgcn.image.sample.c.d.1d.v2f16.f32.f32(i32 3, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0)225  %r = bitcast <2 x half> %tex to float226  ret float %r227}228 229define amdgpu_ps <2 x float> @image_sample_c_d_1d_v2f16_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {230; TONGA-LABEL: image_sample_c_d_1d_v2f16_tfe:231; TONGA:       ; %bb.0: ; %main_body232; TONGA-NEXT:    v_mov_b32_e32 v4, 0233; TONGA-NEXT:    v_mov_b32_e32 v5, v4234; TONGA-NEXT:    v_mov_b32_e32 v6, v4235; TONGA-NEXT:    image_sample_c_d v[4:6], v[0:3], s[0:7], s[8:11] dmask:0x3 tfe d16236; TONGA-NEXT:    s_waitcnt vmcnt(0)237; TONGA-NEXT:    v_lshlrev_b32_e32 v0, 16, v5238; TONGA-NEXT:    v_or_b32_sdwa v0, v4, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD239; TONGA-NEXT:    v_mov_b32_e32 v1, v6240; TONGA-NEXT:    ; return to shader part epilog241;242; GFX81-LABEL: image_sample_c_d_1d_v2f16_tfe:243; GFX81:       ; %bb.0: ; %main_body244; GFX81-NEXT:    v_mov_b32_e32 v4, 0245; GFX81-NEXT:    v_mov_b32_e32 v5, v4246; GFX81-NEXT:    image_sample_c_d v[4:5], v[0:3], s[0:7], s[8:11] dmask:0x3 tfe d16247; GFX81-NEXT:    s_waitcnt vmcnt(0)248; GFX81-NEXT:    v_mov_b32_e32 v0, v4249; GFX81-NEXT:    v_mov_b32_e32 v1, v5250; GFX81-NEXT:    ; return to shader part epilog251;252; GFX9-LABEL: image_sample_c_d_1d_v2f16_tfe:253; GFX9:       ; %bb.0: ; %main_body254; GFX9-NEXT:    v_mov_b32_e32 v4, 0255; GFX9-NEXT:    v_mov_b32_e32 v5, v4256; GFX9-NEXT:    image_sample_c_d v[4:5], v[0:3], s[0:7], s[8:11] dmask:0x3 tfe d16257; GFX9-NEXT:    s_waitcnt vmcnt(0)258; GFX9-NEXT:    v_mov_b32_e32 v0, v4259; GFX9-NEXT:    v_mov_b32_e32 v1, v5260; GFX9-NEXT:    ; return to shader part epilog261;262; GFX10-LABEL: image_sample_c_d_1d_v2f16_tfe:263; GFX10:       ; %bb.0: ; %main_body264; GFX10-NEXT:    v_mov_b32_e32 v5, v0265; GFX10-NEXT:    v_mov_b32_e32 v0, 0266; GFX10-NEXT:    v_mov_b32_e32 v4, v1267; GFX10-NEXT:    v_mov_b32_e32 v1, v0268; GFX10-NEXT:    image_sample_c_d v[0:1], [v5, v4, v2, v3], s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe d16269; GFX10-NEXT:    s_waitcnt vmcnt(0)270; GFX10-NEXT:    ; return to shader part epilog271;272; GFX11-LABEL: image_sample_c_d_1d_v2f16_tfe:273; GFX11:       ; %bb.0: ; %main_body274; GFX11-NEXT:    v_dual_mov_b32 v4, v1 :: v_dual_mov_b32 v5, v0275; GFX11-NEXT:    v_mov_b32_e32 v0, 0276; GFX11-NEXT:    v_mov_b32_e32 v1, v0277; GFX11-NEXT:    image_sample_c_d v[0:1], [v5, v4, v2, v3], s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe d16278; GFX11-NEXT:    s_waitcnt vmcnt(0)279; GFX11-NEXT:    ; return to shader part epilog280;281; GFX12-LABEL: image_sample_c_d_1d_v2f16_tfe:282; GFX12:       ; %bb.0: ; %main_body283; GFX12-NEXT:    v_dual_mov_b32 v4, v1 :: v_dual_mov_b32 v5, v0284; GFX12-NEXT:    v_mov_b32_e32 v0, 0285; GFX12-NEXT:    v_mov_b32_e32 v1, v0286; GFX12-NEXT:    image_sample_c_d v[0:1], [v5, v4, v2, v3], s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe d16287; GFX12-NEXT:    s_wait_samplecnt 0x0288; GFX12-NEXT:    ; return to shader part epilog289main_body:290  %tex = call {<2 x half>,i32} @llvm.amdgcn.image.sample.c.d.1d.v2f16i32.f32.f32(i32 3, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 1, i32 0)291  %tex.vec = extractvalue {<2 x half>, i32} %tex, 0292  %tex.err = extractvalue {<2 x half>, i32} %tex, 1293  %tex.vecf = bitcast <2 x half> %tex.vec to float294  %r.0 = insertelement <2 x float> poison, float %tex.vecf, i32 0295  %tex.errf = bitcast i32 %tex.err to float296  %r = insertelement <2 x float> %r.0, float %tex.errf, i32 1297  ret <2 x float> %r298}299 300define amdgpu_ps <2 x float> @image_sample_b_2d_v3f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {301; TONGA-LABEL: image_sample_b_2d_v3f16:302; TONGA:       ; %bb.0: ; %main_body303; TONGA-NEXT:    s_mov_b64 s[12:13], exec304; TONGA-NEXT:    s_wqm_b64 exec, exec305; TONGA-NEXT:    s_and_b64 exec, exec, s[12:13]306; TONGA-NEXT:    image_sample_b v[0:2], v[0:2], s[0:7], s[8:11] dmask:0x7 d16307; TONGA-NEXT:    s_mov_b32 s0, 0x1000504308; TONGA-NEXT:    s_waitcnt vmcnt(0)309; TONGA-NEXT:    v_perm_b32 v0, v0, v1, s0310; TONGA-NEXT:    v_mov_b32_e32 v1, v2311; TONGA-NEXT:    ; return to shader part epilog312;313; GFX81-LABEL: image_sample_b_2d_v3f16:314; GFX81:       ; %bb.0: ; %main_body315; GFX81-NEXT:    s_mov_b64 s[12:13], exec316; GFX81-NEXT:    s_wqm_b64 exec, exec317; GFX81-NEXT:    s_and_b64 exec, exec, s[12:13]318; GFX81-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0x7 d16319; GFX81-NEXT:    s_waitcnt vmcnt(0)320; GFX81-NEXT:    ; return to shader part epilog321;322; GFX9-LABEL: image_sample_b_2d_v3f16:323; GFX9:       ; %bb.0: ; %main_body324; GFX9-NEXT:    s_mov_b64 s[12:13], exec325; GFX9-NEXT:    s_wqm_b64 exec, exec326; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]327; GFX9-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0x7 d16328; GFX9-NEXT:    s_waitcnt vmcnt(0)329; GFX9-NEXT:    ; return to shader part epilog330;331; GFX10PLUS-LABEL: image_sample_b_2d_v3f16:332; GFX10PLUS:       ; %bb.0: ; %main_body333; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo334; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo335; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12336; GFX10PLUS-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_2D d16337; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)338; GFX10PLUS-NEXT:    ; return to shader part epilog339;340; GFX12-LABEL: image_sample_b_2d_v3f16:341; GFX12:       ; %bb.0: ; %main_body342; GFX12-NEXT:    s_mov_b32 s12, exec_lo343; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo344; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12345; GFX12-NEXT:    image_sample_b v[0:1], [v0, v1, v2], s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_2D d16346; GFX12-NEXT:    s_wait_samplecnt 0x0347; GFX12-NEXT:    ; return to shader part epilog348main_body:349  %tex = call <3 x half> @llvm.amdgcn.image.sample.b.2d.v3f16.f32.f32(i32 7, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0)350  %tex_wide = shufflevector <3 x half> %tex, <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>351  %r = bitcast <4 x half> %tex_wide to <2 x float>352  ret <2 x float> %r353}354 355define amdgpu_ps <4 x float> @image_sample_b_2d_v3f16_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {356; TONGA-LABEL: image_sample_b_2d_v3f16_tfe:357; TONGA:       ; %bb.0: ; %main_body358; TONGA-NEXT:    s_mov_b64 s[12:13], exec359; TONGA-NEXT:    s_wqm_b64 exec, exec360; TONGA-NEXT:    v_mov_b32_e32 v3, 0361; TONGA-NEXT:    v_mov_b32_e32 v4, v3362; TONGA-NEXT:    v_mov_b32_e32 v5, v3363; TONGA-NEXT:    v_mov_b32_e32 v6, v3364; TONGA-NEXT:    s_and_b64 exec, exec, s[12:13]365; TONGA-NEXT:    image_sample_b v[3:6], v[0:2], s[0:7], s[8:11] dmask:0x7 tfe d16366; TONGA-NEXT:    s_mov_b32 s0, 0x1000504367; TONGA-NEXT:    s_waitcnt vmcnt(0)368; TONGA-NEXT:    v_perm_b32 v0, v3, v4, s0369; TONGA-NEXT:    v_mov_b32_e32 v1, v5370; TONGA-NEXT:    v_mov_b32_e32 v2, v6371; TONGA-NEXT:    ; return to shader part epilog372;373; GFX81-LABEL: image_sample_b_2d_v3f16_tfe:374; GFX81:       ; %bb.0: ; %main_body375; GFX81-NEXT:    s_mov_b64 s[12:13], exec376; GFX81-NEXT:    s_wqm_b64 exec, exec377; GFX81-NEXT:    v_mov_b32_e32 v3, 0378; GFX81-NEXT:    v_mov_b32_e32 v4, v3379; GFX81-NEXT:    v_mov_b32_e32 v5, v3380; GFX81-NEXT:    s_and_b64 exec, exec, s[12:13]381; GFX81-NEXT:    image_sample_b v[3:5], v[0:2], s[0:7], s[8:11] dmask:0x7 tfe d16382; GFX81-NEXT:    s_waitcnt vmcnt(0)383; GFX81-NEXT:    v_mov_b32_e32 v0, v3384; GFX81-NEXT:    v_mov_b32_e32 v1, v4385; GFX81-NEXT:    v_mov_b32_e32 v2, v5386; GFX81-NEXT:    ; return to shader part epilog387;388; GFX9-LABEL: image_sample_b_2d_v3f16_tfe:389; GFX9:       ; %bb.0: ; %main_body390; GFX9-NEXT:    s_mov_b64 s[12:13], exec391; GFX9-NEXT:    s_wqm_b64 exec, exec392; GFX9-NEXT:    v_mov_b32_e32 v3, 0393; GFX9-NEXT:    v_mov_b32_e32 v4, v3394; GFX9-NEXT:    v_mov_b32_e32 v5, v3395; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]396; GFX9-NEXT:    image_sample_b v[3:5], v[0:2], s[0:7], s[8:11] dmask:0x7 tfe d16397; GFX9-NEXT:    s_waitcnt vmcnt(0)398; GFX9-NEXT:    v_mov_b32_e32 v0, v3399; GFX9-NEXT:    v_mov_b32_e32 v1, v4400; GFX9-NEXT:    v_mov_b32_e32 v2, v5401; GFX9-NEXT:    ; return to shader part epilog402;403; GFX10-LABEL: image_sample_b_2d_v3f16_tfe:404; GFX10:       ; %bb.0: ; %main_body405; GFX10-NEXT:    s_mov_b32 s12, exec_lo406; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo407; GFX10-NEXT:    v_mov_b32_e32 v3, v0408; GFX10-NEXT:    v_mov_b32_e32 v0, 0409; GFX10-NEXT:    v_mov_b32_e32 v5, v2410; GFX10-NEXT:    v_mov_b32_e32 v4, v1411; GFX10-NEXT:    v_mov_b32_e32 v1, v0412; GFX10-NEXT:    v_mov_b32_e32 v2, v0413; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12414; GFX10-NEXT:    image_sample_b v[0:2], v[3:5], s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_2D tfe d16415; GFX10-NEXT:    s_waitcnt vmcnt(0)416; GFX10-NEXT:    ; return to shader part epilog417;418; GFX11-LABEL: image_sample_b_2d_v3f16_tfe:419; GFX11:       ; %bb.0: ; %main_body420; GFX11-NEXT:    s_mov_b32 s12, exec_lo421; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo422; GFX11-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0423; GFX11-NEXT:    v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1424; GFX11-NEXT:    v_mov_b32_e32 v1, v0425; GFX11-NEXT:    v_mov_b32_e32 v2, v0426; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s12427; GFX11-NEXT:    image_sample_b v[0:2], v[3:5], s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_2D tfe d16428; GFX11-NEXT:    s_waitcnt vmcnt(0)429; GFX11-NEXT:    ; return to shader part epilog430;431; GFX12-LABEL: image_sample_b_2d_v3f16_tfe:432; GFX12:       ; %bb.0: ; %main_body433; GFX12-NEXT:    s_mov_b32 s12, exec_lo434; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo435; GFX12-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v0, 0436; GFX12-NEXT:    v_dual_mov_b32 v3, v2 :: v_dual_mov_b32 v4, v1437; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v0438; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12439; GFX12-NEXT:    image_sample_b v[0:2], [v5, v4, v3], s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_2D tfe d16440; GFX12-NEXT:    s_wait_samplecnt 0x0441; GFX12-NEXT:    ; return to shader part epilog442main_body:443  %tex = call {<3 x half>,i32} @llvm.amdgcn.image.sample.b.2d.v3f16i32.f32.f32(i32 7, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 1, i32 0)444  %tex.vec = extractvalue {<3 x half>, i32} %tex, 0445  %tex.vec_wide = shufflevector <3 x half> %tex.vec, <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>446  %tex.err = extractvalue {<3 x half>, i32} %tex, 1447  %tex.vecf = bitcast <4 x half> %tex.vec_wide to <2 x float>448  %tex.vecf.0 = extractelement <2 x float> %tex.vecf, i32 0449  %tex.vecf.1 = extractelement <2 x float> %tex.vecf, i32 1450  %r.0 = insertelement <4 x float> poison, float %tex.vecf.0, i32 0451  %r.1 = insertelement <4 x float> %r.0, float %tex.vecf.1, i32 1452  %tex.errf = bitcast i32 %tex.err to float453  %r = insertelement <4 x float> %r.1, float %tex.errf, i32 2454  ret <4 x float> %r455}456 457define amdgpu_ps <2 x float> @image_sample_b_2d_v4f16(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {458; TONGA-LABEL: image_sample_b_2d_v4f16:459; TONGA:       ; %bb.0: ; %main_body460; TONGA-NEXT:    s_mov_b64 s[12:13], exec461; TONGA-NEXT:    s_wqm_b64 exec, exec462; TONGA-NEXT:    s_and_b64 exec, exec, s[12:13]463; TONGA-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf d16464; TONGA-NEXT:    s_mov_b32 s0, 0x1000504465; TONGA-NEXT:    s_waitcnt vmcnt(0)466; TONGA-NEXT:    v_perm_b32 v0, v0, v1, s0467; TONGA-NEXT:    v_perm_b32 v1, v2, v3, s0468; TONGA-NEXT:    ; return to shader part epilog469;470; GFX81-LABEL: image_sample_b_2d_v4f16:471; GFX81:       ; %bb.0: ; %main_body472; GFX81-NEXT:    s_mov_b64 s[12:13], exec473; GFX81-NEXT:    s_wqm_b64 exec, exec474; GFX81-NEXT:    s_and_b64 exec, exec, s[12:13]475; GFX81-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0xf d16476; GFX81-NEXT:    s_waitcnt vmcnt(0)477; GFX81-NEXT:    ; return to shader part epilog478;479; GFX9-LABEL: image_sample_b_2d_v4f16:480; GFX9:       ; %bb.0: ; %main_body481; GFX9-NEXT:    s_mov_b64 s[12:13], exec482; GFX9-NEXT:    s_wqm_b64 exec, exec483; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]484; GFX9-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0xf d16485; GFX9-NEXT:    s_waitcnt vmcnt(0)486; GFX9-NEXT:    ; return to shader part epilog487;488; GFX10PLUS-LABEL: image_sample_b_2d_v4f16:489; GFX10PLUS:       ; %bb.0: ; %main_body490; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo491; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo492; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12493; GFX10PLUS-NEXT:    image_sample_b v[0:1], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D d16494; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)495; GFX10PLUS-NEXT:    ; return to shader part epilog496;497; GFX12-LABEL: image_sample_b_2d_v4f16:498; GFX12:       ; %bb.0: ; %main_body499; GFX12-NEXT:    s_mov_b32 s12, exec_lo500; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo501; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12502; GFX12-NEXT:    image_sample_b v[0:1], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D d16503; GFX12-NEXT:    s_wait_samplecnt 0x0504; GFX12-NEXT:    ; return to shader part epilog505main_body:506  %tex = call <4 x half> @llvm.amdgcn.image.sample.b.2d.v4f16.f32.f32(i32 15, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 0, i32 0)507  %r = bitcast <4 x half> %tex to <2 x float>508  ret <2 x float> %r509}510 511define amdgpu_ps <4 x float> @image_sample_b_2d_v4f16_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {512; TONGA-LABEL: image_sample_b_2d_v4f16_tfe:513; TONGA:       ; %bb.0: ; %main_body514; TONGA-NEXT:    s_mov_b64 s[12:13], exec515; TONGA-NEXT:    s_wqm_b64 exec, exec516; TONGA-NEXT:    v_mov_b32_e32 v3, 0517; TONGA-NEXT:    v_mov_b32_e32 v4, v3518; TONGA-NEXT:    v_mov_b32_e32 v5, v3519; TONGA-NEXT:    v_mov_b32_e32 v6, v3520; TONGA-NEXT:    v_mov_b32_e32 v7, v3521; TONGA-NEXT:    s_and_b64 exec, exec, s[12:13]522; TONGA-NEXT:    image_sample_b v[3:7], v[0:2], s[0:7], s[8:11] dmask:0xf tfe d16523; TONGA-NEXT:    s_mov_b32 s0, 0x1000504524; TONGA-NEXT:    s_waitcnt vmcnt(0)525; TONGA-NEXT:    v_perm_b32 v0, v3, v4, s0526; TONGA-NEXT:    v_perm_b32 v1, v5, v6, s0527; TONGA-NEXT:    v_mov_b32_e32 v2, v7528; TONGA-NEXT:    ; return to shader part epilog529;530; GFX81-LABEL: image_sample_b_2d_v4f16_tfe:531; GFX81:       ; %bb.0: ; %main_body532; GFX81-NEXT:    s_mov_b64 s[12:13], exec533; GFX81-NEXT:    s_wqm_b64 exec, exec534; GFX81-NEXT:    v_mov_b32_e32 v3, 0535; GFX81-NEXT:    v_mov_b32_e32 v4, v3536; GFX81-NEXT:    v_mov_b32_e32 v5, v3537; GFX81-NEXT:    s_and_b64 exec, exec, s[12:13]538; GFX81-NEXT:    image_sample_b v[3:5], v[0:2], s[0:7], s[8:11] dmask:0xf tfe d16539; GFX81-NEXT:    s_waitcnt vmcnt(0)540; GFX81-NEXT:    v_mov_b32_e32 v0, v3541; GFX81-NEXT:    v_mov_b32_e32 v1, v4542; GFX81-NEXT:    v_mov_b32_e32 v2, v5543; GFX81-NEXT:    ; return to shader part epilog544;545; GFX9-LABEL: image_sample_b_2d_v4f16_tfe:546; GFX9:       ; %bb.0: ; %main_body547; GFX9-NEXT:    s_mov_b64 s[12:13], exec548; GFX9-NEXT:    s_wqm_b64 exec, exec549; GFX9-NEXT:    v_mov_b32_e32 v3, 0550; GFX9-NEXT:    v_mov_b32_e32 v4, v3551; GFX9-NEXT:    v_mov_b32_e32 v5, v3552; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]553; GFX9-NEXT:    image_sample_b v[3:5], v[0:2], s[0:7], s[8:11] dmask:0xf tfe d16554; GFX9-NEXT:    s_waitcnt vmcnt(0)555; GFX9-NEXT:    v_mov_b32_e32 v0, v3556; GFX9-NEXT:    v_mov_b32_e32 v1, v4557; GFX9-NEXT:    v_mov_b32_e32 v2, v5558; GFX9-NEXT:    ; return to shader part epilog559;560; GFX10-LABEL: image_sample_b_2d_v4f16_tfe:561; GFX10:       ; %bb.0: ; %main_body562; GFX10-NEXT:    s_mov_b32 s12, exec_lo563; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo564; GFX10-NEXT:    v_mov_b32_e32 v3, v0565; GFX10-NEXT:    v_mov_b32_e32 v0, 0566; GFX10-NEXT:    v_mov_b32_e32 v5, v2567; GFX10-NEXT:    v_mov_b32_e32 v4, v1568; GFX10-NEXT:    v_mov_b32_e32 v1, v0569; GFX10-NEXT:    v_mov_b32_e32 v2, v0570; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12571; GFX10-NEXT:    image_sample_b v[0:2], v[3:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D tfe d16572; GFX10-NEXT:    s_waitcnt vmcnt(0)573; GFX10-NEXT:    ; return to shader part epilog574;575; GFX11-LABEL: image_sample_b_2d_v4f16_tfe:576; GFX11:       ; %bb.0: ; %main_body577; GFX11-NEXT:    s_mov_b32 s12, exec_lo578; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo579; GFX11-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0580; GFX11-NEXT:    v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1581; GFX11-NEXT:    v_mov_b32_e32 v1, v0582; GFX11-NEXT:    v_mov_b32_e32 v2, v0583; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s12584; GFX11-NEXT:    image_sample_b v[0:2], v[3:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D tfe d16585; GFX11-NEXT:    s_waitcnt vmcnt(0)586; GFX11-NEXT:    ; return to shader part epilog587;588; GFX12-LABEL: image_sample_b_2d_v4f16_tfe:589; GFX12:       ; %bb.0: ; %main_body590; GFX12-NEXT:    s_mov_b32 s12, exec_lo591; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo592; GFX12-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v0, 0593; GFX12-NEXT:    v_dual_mov_b32 v3, v2 :: v_dual_mov_b32 v4, v1594; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v0595; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12596; GFX12-NEXT:    image_sample_b v[0:2], [v5, v4, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D tfe d16597; GFX12-NEXT:    s_wait_samplecnt 0x0598; GFX12-NEXT:    ; return to shader part epilog599main_body:600  %tex = call {<4 x half>,i32} @llvm.amdgcn.image.sample.b.2d.v4f16i32.f32.f32(i32 15, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 1, i32 0)601  %tex.vec = extractvalue {<4 x half>, i32} %tex, 0602  %tex.err = extractvalue {<4 x half>, i32} %tex, 1603  %tex.vecf = bitcast <4 x half> %tex.vec to <2 x float>604  %tex.vecf.0 = extractelement <2 x float> %tex.vecf, i32 0605  %tex.vecf.1 = extractelement <2 x float> %tex.vecf, i32 1606  %r.0 = insertelement <4 x float> poison, float %tex.vecf.0, i32 0607  %r.1 = insertelement <4 x float> %r.0, float %tex.vecf.1, i32 1608  %tex.errf = bitcast i32 %tex.err to float609  %r = insertelement <4 x float> %r.1, float %tex.errf, i32 2610  ret <4 x float> %r611}612 613declare half @llvm.amdgcn.image.sample.2d.f16.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1614declare {half,i32} @llvm.amdgcn.image.sample.2d.f16i32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1615declare <3 x half> @llvm.amdgcn.image.sample.2d.v3f16.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1616declare <4 x half> @llvm.amdgcn.image.sample.2d.v4f16.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1617declare {<2 x half>,i32} @llvm.amdgcn.image.sample.2d.v2f16i32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1618declare <2 x half> @llvm.amdgcn.image.sample.c.d.1d.v2f16.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1619declare {<2 x half>,i32} @llvm.amdgcn.image.sample.c.d.1d.v2f16i32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1620declare <3 x half> @llvm.amdgcn.image.sample.b.2d.v3f16.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1621declare {<3 x half>,i32} @llvm.amdgcn.image.sample.b.2d.v3f16i32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1622declare <4 x half> @llvm.amdgcn.image.sample.b.2d.v4f16.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1623declare {<4 x half>,i32} @llvm.amdgcn.image.sample.b.2d.v4f16i32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1624 625attributes #0 = { nounwind }626attributes #1 = { nounwind readonly }627attributes #2 = { nounwind readnone }628