llvm.org GIT mirror llvm / 4f13399
AMDGPU/GlobalISel: InstrMapping for G_TRUNC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326588 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 2 years ago
2 changed file(s) with 41 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
311311 unsigned Size = MRI.getType(MI.getOperand(0).getReg()).getSizeInBits();
312312 unsigned BankID = getRegBankID(MI.getOperand(1).getReg(), MRI, *TRI);
313313 OpdsMapping[0] = OpdsMapping[1] = AMDGPU::getValueMapping(BankID, Size);
314 break;
315 }
316 case AMDGPU::G_TRUNC: {
317 unsigned Dst = MI.getOperand(0).getReg();
318 unsigned Src = MI.getOperand(1).getReg();
319 unsigned Bank = getRegBankID(Src, MRI, *TRI);
320 unsigned DstSize = getSizeInBits(Dst, MRI, *TRI);
321 unsigned SrcSize = getSizeInBits(Src, MRI, *TRI);
322 OpdsMapping[0] = AMDGPU::getValueMapping(Bank, DstSize);
323 OpdsMapping[1] = AMDGPU::getValueMapping(Bank, SrcSize);
314324 break;
315325 }
316326 case AMDGPU::G_FCMP: {
0 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
1 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect -global-isel %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
3
4 ---
5 name: trunc_i64_to_i32_s
6 legalized: true
7
8 body: |
9 bb.0:
10 liveins: $sgpr0_sgpr1
11 ; CHECK-LABEL: name: trunc_i64_to_i32_s
12 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
13 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s32) = G_TRUNC [[COPY]](s32)
14 %0:_(s32) = COPY $sgpr0
15 %1:_(s32) = G_TRUNC %0
16 ...
17
18 ---
19 name: trunc_i64_to_i32_v
20 legalized: true
21
22 body: |
23 bb.0:
24 liveins: $vgpr0_vgpr1
25 ; CHECK-LABEL: name: trunc_i64_to_i32_v
26 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
27 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s32) = G_TRUNC [[COPY]](s32)
28 %0:_(s32) = COPY $vgpr0
29 %1:_(s32) = G_TRUNC %0
30 ...