349 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s3; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10 %s4; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 < %s | FileCheck -check-prefixes=GFX11 %s5; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 < %s | FileCheck -check-prefixes=GFX12 %s6 7define amdgpu_ps void @store_f16_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {8; GFX9-LABEL: store_f16_1d:9; GFX9: ; %bb.0: ; %main_body10; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 unorm a16 d1611; GFX9-NEXT: s_endpgm12;13; GFX10-LABEL: store_f16_1d:14; GFX10: ; %bb.0: ; %main_body15; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm a16 d1616; GFX10-NEXT: s_endpgm17;18; GFX11-LABEL: store_f16_1d:19; GFX11: ; %bb.0: ; %main_body20; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm a16 d1621; GFX11-NEXT: s_endpgm22;23; GFX12-LABEL: store_f16_1d:24; GFX12: ; %bb.0: ; %main_body25; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D a16 d1626; GFX12-NEXT: s_endpgm27main_body:28 %x = extractelement <2 x i16> %coords, i32 029 %bitcast = bitcast <2 x i32> %val to <4 x half>30 call void @llvm.amdgcn.image.store.1d.v4f16.i16(<4 x half> %bitcast, i32 1, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)31 ret void32}33 34define amdgpu_ps void @store_v2f16_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {35; GFX9-LABEL: store_v2f16_1d:36; GFX9: ; %bb.0: ; %main_body37; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 unorm a16 d1638; GFX9-NEXT: s_endpgm39;40; GFX10-LABEL: store_v2f16_1d:41; GFX10: ; %bb.0: ; %main_body42; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm a16 d1643; GFX10-NEXT: s_endpgm44;45; GFX11-LABEL: store_v2f16_1d:46; GFX11: ; %bb.0: ; %main_body47; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm a16 d1648; GFX11-NEXT: s_endpgm49;50; GFX12-LABEL: store_v2f16_1d:51; GFX12: ; %bb.0: ; %main_body52; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D a16 d1653; GFX12-NEXT: s_endpgm54main_body:55 %x = extractelement <2 x i16> %coords, i32 056 %bitcast = bitcast <2 x i32> %val to <4 x half>57 call void @llvm.amdgcn.image.store.1d.v4f16.i16(<4 x half> %bitcast, i32 3, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)58 ret void59}60 61define amdgpu_ps void @store_v3f16_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {62; GFX9-LABEL: store_v3f16_1d:63; GFX9: ; %bb.0: ; %main_body64; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 unorm a16 d1665; GFX9-NEXT: s_endpgm66;67; GFX10-LABEL: store_v3f16_1d:68; GFX10: ; %bb.0: ; %main_body69; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm a16 d1670; GFX10-NEXT: s_endpgm71;72; GFX11-LABEL: store_v3f16_1d:73; GFX11: ; %bb.0: ; %main_body74; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm a16 d1675; GFX11-NEXT: s_endpgm76;77; GFX12-LABEL: store_v3f16_1d:78; GFX12: ; %bb.0: ; %main_body79; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D a16 d1680; GFX12-NEXT: s_endpgm81main_body:82 %x = extractelement <2 x i16> %coords, i32 083 %bitcast = bitcast <2 x i32> %val to <4 x half>84 call void @llvm.amdgcn.image.store.1d.v4f16.i16(<4 x half> %bitcast, i32 7, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)85 ret void86}87 88define amdgpu_ps void @store_v4f16_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {89; GFX9-LABEL: store_v4f16_1d:90; GFX9: ; %bb.0: ; %main_body91; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf unorm a16 d1692; GFX9-NEXT: s_endpgm93;94; GFX10-LABEL: store_v4f16_1d:95; GFX10: ; %bb.0: ; %main_body96; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 d1697; GFX10-NEXT: s_endpgm98;99; GFX11-LABEL: store_v4f16_1d:100; GFX11: ; %bb.0: ; %main_body101; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 d16102; GFX11-NEXT: s_endpgm103;104; GFX12-LABEL: store_v4f16_1d:105; GFX12: ; %bb.0: ; %main_body106; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D a16 d16107; GFX12-NEXT: s_endpgm108main_body:109 %x = extractelement <2 x i16> %coords, i32 0110 %bitcast = bitcast <2 x i32> %val to <4 x half>111 call void @llvm.amdgcn.image.store.1d.v4f16.i16(<4 x half> %bitcast, i32 15, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)112 ret void113}114 115define amdgpu_ps void @store_f16_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {116; GFX9-LABEL: store_f16_2d:117; GFX9: ; %bb.0: ; %main_body118; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 unorm a16 d16119; GFX9-NEXT: s_endpgm120;121; GFX10-LABEL: store_f16_2d:122; GFX10: ; %bb.0: ; %main_body123; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm a16 d16124; GFX10-NEXT: s_endpgm125;126; GFX11-LABEL: store_f16_2d:127; GFX11: ; %bb.0: ; %main_body128; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm a16 d16129; GFX11-NEXT: s_endpgm130;131; GFX12-LABEL: store_f16_2d:132; GFX12: ; %bb.0: ; %main_body133; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D a16 d16134; GFX12-NEXT: s_endpgm135main_body:136 %x = extractelement <2 x i16> %coords, i32 0137 %y = extractelement <2 x i16> %coords, i32 1138 %bitcast = bitcast <2 x i32> %val to <4 x half>139 call void @llvm.amdgcn.image.store.2d.v4f16.i16(<4 x half> %bitcast, i32 1, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)140 ret void141}142 143define amdgpu_ps void @store_v2f16_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {144; GFX9-LABEL: store_v2f16_2d:145; GFX9: ; %bb.0: ; %main_body146; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 unorm a16 d16147; GFX9-NEXT: s_endpgm148;149; GFX10-LABEL: store_v2f16_2d:150; GFX10: ; %bb.0: ; %main_body151; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D unorm a16 d16152; GFX10-NEXT: s_endpgm153;154; GFX11-LABEL: store_v2f16_2d:155; GFX11: ; %bb.0: ; %main_body156; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D unorm a16 d16157; GFX11-NEXT: s_endpgm158;159; GFX12-LABEL: store_v2f16_2d:160; GFX12: ; %bb.0: ; %main_body161; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D a16 d16162; GFX12-NEXT: s_endpgm163main_body:164 %x = extractelement <2 x i16> %coords, i32 0165 %y = extractelement <2 x i16> %coords, i32 1166 %bitcast = bitcast <2 x i32> %val to <4 x half>167 call void @llvm.amdgcn.image.store.2d.v4f16.i16(<4 x half> %bitcast, i32 3, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)168 ret void169}170 171define amdgpu_ps void @store_v3f16_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {172; GFX9-LABEL: store_v3f16_2d:173; GFX9: ; %bb.0: ; %main_body174; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 unorm a16 d16175; GFX9-NEXT: s_endpgm176;177; GFX10-LABEL: store_v3f16_2d:178; GFX10: ; %bb.0: ; %main_body179; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D unorm a16 d16180; GFX10-NEXT: s_endpgm181;182; GFX11-LABEL: store_v3f16_2d:183; GFX11: ; %bb.0: ; %main_body184; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D unorm a16 d16185; GFX11-NEXT: s_endpgm186;187; GFX12-LABEL: store_v3f16_2d:188; GFX12: ; %bb.0: ; %main_body189; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D a16 d16190; GFX12-NEXT: s_endpgm191main_body:192 %x = extractelement <2 x i16> %coords, i32 0193 %y = extractelement <2 x i16> %coords, i32 1194 %bitcast = bitcast <2 x i32> %val to <4 x half>195 call void @llvm.amdgcn.image.store.2d.v4f16.i16(<4 x half> %bitcast, i32 7, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)196 ret void197}198 199define amdgpu_ps void @store_v4f16_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <2 x i32> %val) {200; GFX9-LABEL: store_v4f16_2d:201; GFX9: ; %bb.0: ; %main_body202; GFX9-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf unorm a16 d16203; GFX9-NEXT: s_endpgm204;205; GFX10-LABEL: store_v4f16_2d:206; GFX10: ; %bb.0: ; %main_body207; GFX10-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 d16208; GFX10-NEXT: s_endpgm209;210; GFX11-LABEL: store_v4f16_2d:211; GFX11: ; %bb.0: ; %main_body212; GFX11-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 d16213; GFX11-NEXT: s_endpgm214;215; GFX12-LABEL: store_v4f16_2d:216; GFX12: ; %bb.0: ; %main_body217; GFX12-NEXT: image_store v[1:2], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D a16 d16218; GFX12-NEXT: s_endpgm219main_body:220 %x = extractelement <2 x i16> %coords, i32 0221 %y = extractelement <2 x i16> %coords, i32 1222 %bitcast = bitcast <2 x i32> %val to <4 x half>223 call void @llvm.amdgcn.image.store.2d.v4f16.i16(<4 x half> %bitcast, i32 15, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)224 ret void225}226 227define amdgpu_ps void @store_f16_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <2 x i32> %val) {228; GFX9-LABEL: store_f16_3d:229; GFX9: ; %bb.0: ; %main_body230; GFX9-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x1 unorm a16 d16231; GFX9-NEXT: s_endpgm232;233; GFX10-LABEL: store_f16_3d:234; GFX10: ; %bb.0: ; %main_body235; GFX10-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D unorm a16 d16236; GFX10-NEXT: s_endpgm237;238; GFX11-LABEL: store_f16_3d:239; GFX11: ; %bb.0: ; %main_body240; GFX11-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D unorm a16 d16241; GFX11-NEXT: s_endpgm242;243; GFX12-LABEL: store_f16_3d:244; GFX12: ; %bb.0: ; %main_body245; GFX12-NEXT: image_store v[2:3], [v0, v1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D a16 d16246; GFX12-NEXT: s_endpgm247main_body:248 %x = extractelement <2 x i16> %coords_lo, i32 0249 %y = extractelement <2 x i16> %coords_lo, i32 1250 %z = extractelement <2 x i16> %coords_hi, i32 0251 %bitcast = bitcast <2 x i32> %val to <4 x half>252 call void @llvm.amdgcn.image.store.3d.v4f16.i16(<4 x half> %bitcast, i32 1, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)253 ret void254}255 256define amdgpu_ps void @store_v2f16_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <2 x i32> %val) {257; GFX9-LABEL: store_v2f16_3d:258; GFX9: ; %bb.0: ; %main_body259; GFX9-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x3 unorm a16 d16260; GFX9-NEXT: s_endpgm261;262; GFX10-LABEL: store_v2f16_3d:263; GFX10: ; %bb.0: ; %main_body264; GFX10-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D unorm a16 d16265; GFX10-NEXT: s_endpgm266;267; GFX11-LABEL: store_v2f16_3d:268; GFX11: ; %bb.0: ; %main_body269; GFX11-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D unorm a16 d16270; GFX11-NEXT: s_endpgm271;272; GFX12-LABEL: store_v2f16_3d:273; GFX12: ; %bb.0: ; %main_body274; GFX12-NEXT: image_store v[2:3], [v0, v1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D a16 d16275; GFX12-NEXT: s_endpgm276main_body:277 %x = extractelement <2 x i16> %coords_lo, i32 0278 %y = extractelement <2 x i16> %coords_lo, i32 1279 %z = extractelement <2 x i16> %coords_hi, i32 0280 %bitcast = bitcast <2 x i32> %val to <4 x half>281 call void @llvm.amdgcn.image.store.3d.v4f16.i16(<4 x half> %bitcast, i32 3, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)282 ret void283}284 285define amdgpu_ps void @store_v3f16_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <2 x i32> %val) {286; GFX9-LABEL: store_v3f16_3d:287; GFX9: ; %bb.0: ; %main_body288; GFX9-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x7 unorm a16 d16289; GFX9-NEXT: s_endpgm290;291; GFX10-LABEL: store_v3f16_3d:292; GFX10: ; %bb.0: ; %main_body293; GFX10-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D unorm a16 d16294; GFX10-NEXT: s_endpgm295;296; GFX11-LABEL: store_v3f16_3d:297; GFX11: ; %bb.0: ; %main_body298; GFX11-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D unorm a16 d16299; GFX11-NEXT: s_endpgm300;301; GFX12-LABEL: store_v3f16_3d:302; GFX12: ; %bb.0: ; %main_body303; GFX12-NEXT: image_store v[2:3], [v0, v1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D a16 d16304; GFX12-NEXT: s_endpgm305main_body:306 %x = extractelement <2 x i16> %coords_lo, i32 0307 %y = extractelement <2 x i16> %coords_lo, i32 1308 %z = extractelement <2 x i16> %coords_hi, i32 0309 %bitcast = bitcast <2 x i32> %val to <4 x half>310 call void @llvm.amdgcn.image.store.3d.v4f16.i16(<4 x half> %bitcast, i32 7, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)311 ret void312}313 314define amdgpu_ps void @store_v4f16_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <2 x i32> %val) {315; GFX9-LABEL: store_v4f16_3d:316; GFX9: ; %bb.0: ; %main_body317; GFX9-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0xf unorm a16 d16318; GFX9-NEXT: s_endpgm319;320; GFX10-LABEL: store_v4f16_3d:321; GFX10: ; %bb.0: ; %main_body322; GFX10-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 d16323; GFX10-NEXT: s_endpgm324;325; GFX11-LABEL: store_v4f16_3d:326; GFX11: ; %bb.0: ; %main_body327; GFX11-NEXT: image_store v[2:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 d16328; GFX11-NEXT: s_endpgm329;330; GFX12-LABEL: store_v4f16_3d:331; GFX12: ; %bb.0: ; %main_body332; GFX12-NEXT: image_store v[2:3], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D a16 d16333; GFX12-NEXT: s_endpgm334main_body:335 %x = extractelement <2 x i16> %coords_lo, i32 0336 %y = extractelement <2 x i16> %coords_lo, i32 1337 %z = extractelement <2 x i16> %coords_hi, i32 0338 %bitcast = bitcast <2 x i32> %val to <4 x half>339 call void @llvm.amdgcn.image.store.3d.v4f16.i16(<4 x half> %bitcast, i32 15, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)340 ret void341}342 343declare void @llvm.amdgcn.image.store.1d.v4f16.i16(<4 x half>, i32, i16, <8 x i32>, i32, i32) #2344declare void @llvm.amdgcn.image.store.2d.v4f16.i16(<4 x half>, i32, i16, i16, <8 x i32>, i32, i32) #2345declare void @llvm.amdgcn.image.store.3d.v4f16.i16(<4 x half>, i32, i16, i16, i16, <8 x i32>, i32, i32) #2346 347attributes #0 = { nounwind }348attributes #1 = { nounwind readonly }349