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 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_BUILD_GLOBAL_ISEL
15 #error "You shouldn't build this"
21 enum PartialMappingIdx {
29 const RegisterBankInfo::PartialMapping PartMappings[] {
30 // StartIdx, Length, RegBank
37 const RegisterBankInfo::ValueMapping ValMappings[] {
39 {&PartMappings[0], 1},
41 {&PartMappings[1], 1},
43 {&PartMappings[2], 1},
48 enum ValueMappingIdx {
53 const RegisterBankInfo::ValueMapping *getValueMapping(unsigned BankID,
55 assert(Size % 32 == 0);
56 unsigned Idx = BankID == AMDGPU::SGPRRegBankID ? SGPRStartIdx : VGPRStartIdx;
57 Idx += (Size / 32) - 1;
58 return &ValMappings[Idx];
61 } // End AMDGPU namespace.
62 } // End llvm namespace.