llvm.org GIT mirror llvm / 1b020b3
AMDGPU: Change exp with compr bit printing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295873 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 3 years ago
2 changed file(s) with 55 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
671671 void AMDGPUInstPrinter::printExpSrcN(const MCInst *MI, unsigned OpNo,
672672 const MCSubtargetInfo &STI,
673673 raw_ostream &O) {
674 int EnIdx = AMDGPU::getNamedOperandIdx(MI->getOpcode(), AMDGPU::OpName::en);
674 unsigned Opc = MI->getOpcode();
675 int EnIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::en);
675676 unsigned En = MI->getOperand(EnIdx).getImm();
676677
677 // FIXME: What do we do with compr? The meaning of en changes depending on if
678 // compr is set.
678 int ComprIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::compr);
679
680 // If compr is set, print as src0, src0, src1, src1
681 if (MI->getOperand(ComprIdx).getImm()) {
682 if (N == 1 || N == 2)
683 --OpNo;
684 else if (N == 3)
685 OpNo -= 2;
686 }
679687
680688 if (En & (1 << N))
681689 printRegOperand(MI->getOperand(OpNo).getReg(), O, MRI);
1515 ; GCN-LABEL: {{^}}test_export_compr_en_src0_v2f16:
1616 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
1717 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
18 ; GCN: exp mrt0 [[SRC0]], off, off, off done compr{{$}}
18 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], off, off done compr{{$}}
1919 define void @test_export_compr_en_src0_v2f16() #0 {
20 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 1, <2 x half> , <2 x half> , i1 true, i1 false)
20 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> , <2 x half> , i1 true, i1 false)
2121 ret void
2222 }
2323
2424 ; GCN-LABEL: {{^}}test_export_compr_en_src1_v2f16:
2525 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
2626 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
27 ; GCN: exp mrt0 off, [[SRC1]], off, off done compr{{$}}
27 ; GCN: exp mrt0 off, off, [[SRC1]], [[SRC1]] done compr{{$}}
2828 define void @test_export_compr_en_src1_v2f16() #0 {
29 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> , <2 x half> , i1 true, i1 false)
29 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 12, <2 x half> , <2 x half> , i1 true, i1 false)
3030 ret void
3131 }
3232
3333 ; GCN-LABEL: {{^}}test_export_compr_en_src0_src1_v2f16:
3434 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
3535 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
36 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off done compr{{$}}
36 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr{{$}}
3737 define void @test_export_compr_en_src0_src1_v2f16() #0 {
38 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> , <2 x half> , i1 true, i1 false)
38 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 15, <2 x half> , <2 x half> , i1 true, i1 false)
39 ret void
40 }
41
42 ; GCN-LABEL: {{^}}test_export_compr_en_invalid2_v2f16:
43 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
44 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
45 ; GCN: exp mrt0 off, [[SRC0]], off, off done compr{{$}}
46 define void @test_export_compr_en_invalid2_v2f16() #0 {
47 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> , <2 x half> , i1 true, i1 false)
48 ret void
49 }
50
51 ; GCN-LABEL: {{^}}test_export_compr_en_invalid10_v2f16:
52 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
53 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
54 ; GCN: exp mrt0 off, [[SRC0]], off, [[SRC1]] done compr{{$}}
55 define void @test_export_compr_en_invalid10_v2f16() #0 {
56 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 10, <2 x half> , <2 x half> , i1 true, i1 false)
3957 ret void
4058 }
4159
5270 ; GCN-LABEL: {{^}}test_export_compr_z_v2f16:
5371 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
5472 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
55 ; GCN: exp mrtz [[SRC0]], [[SRC1]], off, off compr{{$}}
56 ; GCN: exp mrtz [[SRC0]], [[SRC1]], off, off done compr{{$}}
73 ; GCN: exp mrtz [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] compr{{$}}
74 ; GCN: exp mrtz [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr{{$}}
5775 define void @test_export_compr_z_v2f16() #0 {
58 call void @llvm.amdgcn.exp.compr.v2f16(i32 8, i32 3, <2 x half> , <2 x half> , i1 false, i1 false)
59 call void @llvm.amdgcn.exp.compr.v2f16(i32 8, i32 3, <2 x half> , <2 x half> , i1 true, i1 false)
76 call void @llvm.amdgcn.exp.compr.v2f16(i32 8, i32 15, <2 x half> , <2 x half> , i1 false, i1 false)
77 call void @llvm.amdgcn.exp.compr.v2f16(i32 8, i32 15, <2 x half> , <2 x half> , i1 true, i1 false)
6078 ret void
6179 }
6280
6381 ; GCN-LABEL: {{^}}test_export_compr_vm_v2f16:
6482 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x40003c00
6583 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x44003800
66 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off compr vm{{$}}
67 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off done compr vm{{$}}
84 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] compr vm{{$}}
85 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr vm{{$}}
6886 define void @test_export_compr_vm_v2f16() #0 {
69 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> , <2 x half> , i1 false, i1 true)
70 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> , <2 x half> , i1 true, i1 true)
87 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 15, <2 x half> , <2 x half> , i1 false, i1 true)
88 call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 15, <2 x half> , <2 x half> , i1 true, i1 true)
7189 ret void
7290 }
7391
92110 ; GCN-LABEL: {{^}}test_export_compr_en_src1_v2i16:
93111 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x20001
94112 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x40005
95 ; GCN: exp mrt0 off, [[SRC1]], off, off done compr{{$}}
113 ; GCN: exp mrt0 off, off, [[SRC1]], [[SRC1]] done compr{{$}}
96114 define void @test_export_compr_en_src1_v2i16() #0 {
97 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 2, <2 x i16> , <2 x i16> , i1 true, i1 false)
115 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 12, <2 x i16> , <2 x i16> , i1 true, i1 false)
98116 ret void
99117 }
100118
101119 ; GCN-LABEL: {{^}}test_export_compr_en_src0_src1_v2i16:
102120 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x20001
103121 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x40005
104 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off done compr{{$}}
122 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr{{$}}
105123 define void @test_export_compr_en_src0_src1_v2i16() #0 {
106 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 3, <2 x i16> , <2 x i16> , i1 true, i1 false)
124 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 15, <2 x i16> , <2 x i16> , i1 true, i1 false)
107125 ret void
108126 }
109127
120138 ; GCN-LABEL: {{^}}test_export_compr_z_v2i16:
121139 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x20001
122140 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x40005
123 ; GCN: exp mrtz [[SRC0]], [[SRC1]], off, off compr{{$}}
124 ; GCN: exp mrtz [[SRC0]], [[SRC1]], off, off done compr{{$}}
141 ; GCN: exp mrtz [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] compr{{$}}
142 ; GCN: exp mrtz [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr{{$}}
125143 define void @test_export_compr_z_v2i16() #0 {
126 call void @llvm.amdgcn.exp.compr.v2i16(i32 8, i32 3, <2 x i16> , <2 x i16> , i1 false, i1 false)
127 call void @llvm.amdgcn.exp.compr.v2i16(i32 8, i32 3, <2 x i16> , <2 x i16> , i1 true, i1 false)
144 call void @llvm.amdgcn.exp.compr.v2i16(i32 8, i32 15, <2 x i16> , <2 x i16> , i1 false, i1 false)
145 call void @llvm.amdgcn.exp.compr.v2i16(i32 8, i32 15, <2 x i16> , <2 x i16> , i1 true, i1 false)
128146 ret void
129147 }
130148
131149 ; GCN-LABEL: {{^}}test_export_compr_vm_v2i16:
132150 ; GCN-DAG: v_mov_b32_e32 [[SRC0:v[0-9]+]], 0x20001
133151 ; GCN-DAG: v_mov_b32_e32 [[SRC1:v[0-9]+]], 0x40005
134 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off compr vm{{$}}
135 ; GCN: exp mrt0 [[SRC0]], [[SRC1]], off, off done compr vm{{$}}
152 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] compr vm{{$}}
153 ; GCN: exp mrt0 [[SRC0]], [[SRC0]], [[SRC1]], [[SRC1]] done compr vm{{$}}
136154 define void @test_export_compr_vm_v2i16() #0 {
137 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 3, <2 x i16> , <2 x i16> , i1 false, i1 true)
138 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 3, <2 x i16> , <2 x i16> , i1 true, i1 true)
155 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 15, <2 x i16> , <2 x i16> , i1 false, i1 true)
156 call void @llvm.amdgcn.exp.compr.v2i16(i32 0, i32 15, <2 x i16> , <2 x i16> , i1 true, i1 true)
139157 ret void
140158 }
141159