blob: 0d3e3b7efa2586cf96c2041e6d14afb6aefa19b3 [file] [log] [blame]
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +00001; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs -show-mc-encoding | FileCheck -enable-var-scope -check-prefixes=GCN,UNPACKED,PREGFX10,PREGFX10-UNPACKED %s
2; RUN: llc < %s -march=amdgcn -mcpu=gfx810 -verify-machineinstrs | FileCheck -enable-var-scope -check-prefixes=GCN,PACKED,PREGFX10,PREGFX10-PACKED %s
3; RUN: llc < %s -march=amdgcn -mcpu=gfx900 -verify-machineinstrs | FileCheck -enable-var-scope -check-prefixes=GCN,PACKED,PREGFX10,PREGFX10-PACKED %s
4; RUN: llc < %s -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs | FileCheck -enable-var-scope -check-prefixes=GCN,PACKED,GFX10,GFX10-PACKED %s
Tim Renouf35484c92018-08-21 11:06:05 +00005
6; GCN-LABEL: {{^}}tbuffer_load_d16_x:
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +00007; PREGFX10: tbuffer_load_format_d16_x v{{[0-9]+}}, off, s[{{[0-9]+:[0-9]+}}], dfmt:6, nfmt:1, 0
8; GFX10: tbuffer_load_format_d16_x v{{[0-9]+}}, off, s[{{[0-9]+:[0-9]+}}], format:22, 0
Tim Renouf35484c92018-08-21 11:06:05 +00009define amdgpu_ps half @tbuffer_load_d16_x(<4 x i32> inreg %rsrc) {
10main_body:
11 %data = call half @llvm.amdgcn.raw.tbuffer.load.f16(<4 x i32> %rsrc, i32 0, i32 0, i32 22, i32 0)
12 ret half %data
13}
14
15; GCN-LABEL: {{^}}tbuffer_load_d16_xy:
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +000016; PREGFX10-UNPACKED: tbuffer_load_format_d16_xy v{{\[}}{{[0-9]+}}:[[HI:[0-9]+]]{{\]}}, off, s[{{[0-9]+:[0-9]+}}], dfmt:6, nfmt:1, 0
Tim Renouf35484c92018-08-21 11:06:05 +000017; UNPACKED: v_mov_b32_e32 v{{[0-9]+}}, v[[HI]]
18
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +000019; PREGFX10-PACKED: tbuffer_load_format_d16_xy v[[FULL:[0-9]+]], off, s[{{[0-9]+:[0-9]+}}], dfmt:6, nfmt:1, 0
20; GFX10-PACKED: tbuffer_load_format_d16_xy v[[FULL:[0-9]+]], off, s[{{[0-9]+:[0-9]+}}], format:22, 0
Tim Renouf35484c92018-08-21 11:06:05 +000021; PACKED: v_lshrrev_b32_e32 v{{[0-9]+}}, 16, v[[FULL]]
22define amdgpu_ps half @tbuffer_load_d16_xy(<4 x i32> inreg %rsrc) {
23main_body:
24 %data = call <2 x half> @llvm.amdgcn.raw.tbuffer.load.v2f16(<4 x i32> %rsrc, i32 0, i32 0, i32 22, i32 0)
25 %elt = extractelement <2 x half> %data, i32 1
26 ret half %elt
27}
28
29; GCN-LABEL: {{^}}tbuffer_load_d16_xyzw:
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +000030; PREGFX10-UNPACKED: tbuffer_load_format_d16_xyzw v{{\[}}{{[0-9]+}}:[[HI:[0-9]+]]{{\]}}, off, s[{{[0-9]+:[0-9]+}}], dfmt:6, nfmt:1, 0
31; GFX10-UNPACKED: tbuffer_load_format_d16_xyzw v{{\[}}{{[0-9]+}}:[[HI:[0-9]+]]{{\]}}, off, s[{{[0-9]+:[0-9]+}}], format:22, 0
Tim Renouf35484c92018-08-21 11:06:05 +000032; UNPACKED: v_mov_b32_e32 v{{[0-9]+}}, v[[HI]]
33
Stanislav Mekhanoshin692560d2019-05-01 16:32:58 +000034; PREGFX10-PACKED: tbuffer_load_format_d16_xyzw v{{\[}}{{[0-9]+}}:[[HI:[0-9]+]]{{\]}}, off, s[{{[0-9]+:[0-9]+}}], dfmt:6, nfmt:1, 0
35; GFX10-PACKED: tbuffer_load_format_d16_xyzw v{{\[}}{{[0-9]+}}:[[HI:[0-9]+]]{{\]}}, off, s[{{[0-9]+:[0-9]+}}], format:22, 0
Tim Renouf35484c92018-08-21 11:06:05 +000036; PACKED: v_lshrrev_b32_e32 v{{[0-9]+}}, 16, v[[HI]]
37define amdgpu_ps half @tbuffer_load_d16_xyzw(<4 x i32> inreg %rsrc) {
38main_body:
39 %data = call <4 x half> @llvm.amdgcn.raw.tbuffer.load.v4f16(<4 x i32> %rsrc, i32 0, i32 0, i32 22, i32 0)
40 %elt = extractelement <4 x half> %data, i32 3
41 ret half %elt
42}
43
44declare half @llvm.amdgcn.raw.tbuffer.load.f16(<4 x i32>, i32, i32, i32, i32)
45declare <2 x half> @llvm.amdgcn.raw.tbuffer.load.v2f16(<4 x i32>, i32, i32, i32, i32)
46declare <4 x half> @llvm.amdgcn.raw.tbuffer.load.v4f16(<4 x i32>, i32, i32, i32, i32)
47