1 //===- AMDGPUGenRegisterBankInfo.def -----------------------------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// This file defines all the static objects used by AMDGPURegisterBankInfo.
11 /// \todo This should be generated by TableGen.
12 //===----------------------------------------------------------------------===//
17 enum PartialMappingIdx {
25 const RegisterBankInfo::PartialMapping PartMappings[] {
26 // StartIdx, Length, RegBank
33 const RegisterBankInfo::ValueMapping ValMappings[] {
35 {&PartMappings[0], 1},
37 {&PartMappings[1], 1},
39 {&PartMappings[2], 1},
44 enum ValueMappingIdx {
49 const RegisterBankInfo::ValueMapping *getValueMapping(unsigned BankID,
51 assert(Size % 32 == 0);
52 unsigned Idx = BankID == AMDGPU::SGPRRegBankID ? SGPRStartIdx : VGPRStartIdx;
53 Idx += (Size / 32) - 1;
54 return &ValMappings[Idx];
57 } // End AMDGPU namespace.
58 } // End llvm namespace.