//===- PPCRegisterInfo.cpp - PowerPC Register Information -------*- C++ -*-===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file contains the PowerPC implementation of the MRegisterInfo class.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "reginfo"#include"PPC.h"#include"PPCInstrBuilder.h"#include"PPCMachineFunctionInfo.h"#include"PPCRegisterInfo.h"#include"PPCFrameInfo.h"#include"PPCSubtarget.h"#include"llvm/Constants.h"#include"llvm/Type.h"#include"llvm/CodeGen/ValueTypes.h"#include"llvm/CodeGen/MachineInstrBuilder.h"#include"llvm/CodeGen/MachineModuleInfo.h"#include"llvm/CodeGen/MachineFunction.h"#include"llvm/CodeGen/MachineFrameInfo.h"#include"llvm/CodeGen/MachineLocation.h"#include"llvm/CodeGen/SelectionDAGNodes.h"#include"llvm/Target/TargetFrameInfo.h"#include"llvm/Target/TargetInstrInfo.h"#include"llvm/Target/TargetMachine.h"#include"llvm/Target/TargetOptions.h"#include"llvm/Support/CommandLine.h"#include"llvm/Support/Debug.h"#include"llvm/Support/MathExtras.h"#include"llvm/ADT/BitVector.h"#include"llvm/ADT/STLExtras.h"#include<cstdlib>usingnamespacellvm;/// getRegisterNumbering - Given the enum value for some register, e.g./// PPC::F14, return the number that it corresponds to (e.g. 14).unsignedPPCRegisterInfo::getRegisterNumbering(unsignedRegEnum){usingnamespacePPC;switch(RegEnum){caseR0:caseX0:caseF0:caseV0:caseCR0:return0;caseR1:caseX1:caseF1:caseV1:caseCR1:return1;caseR2:caseX2:caseF2:caseV2:caseCR2:return2;caseR3:caseX3:caseF3:caseV3:caseCR3:return3;caseR4:caseX4:caseF4:caseV4:caseCR4:return4;caseR5:caseX5:caseF5:caseV5