Daniel Sanders | 23e9877 | 2014-11-02 16:09:29 +0000 | [diff] [blame] | 1 | //===---- MipsABIInfo.cpp - Information about MIPS ABI's ------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "MipsABIInfo.h" |
| 11 | #include "MipsRegisterInfo.h" |
| 12 | |
| 13 | using namespace llvm; |
| 14 | |
| 15 | namespace { |
| 16 | static const MCPhysReg O32IntRegs[4] = {Mips::A0, Mips::A1, Mips::A2, Mips::A3}; |
| 17 | |
| 18 | static const MCPhysReg Mips64IntRegs[8] = { |
| 19 | Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64, |
| 20 | Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64}; |
| 21 | } |
| 22 | |
| 23 | const ArrayRef<MCPhysReg> MipsABIInfo::GetByValArgRegs() const { |
| 24 | if (IsO32()) |
| 25 | return makeArrayRef(O32IntRegs); |
| 26 | if (IsN32() || IsN64()) |
| 27 | return makeArrayRef(Mips64IntRegs); |
| 28 | llvm_unreachable("Unhandled ABI"); |
| 29 | } |
Daniel Sanders | d7eba31 | 2014-11-07 12:21:37 +0000 | [diff] [blame^] | 30 | |
| 31 | const ArrayRef<MCPhysReg> MipsABIInfo::GetVarArgRegs() const { |
| 32 | if (IsO32()) |
| 33 | return makeArrayRef(O32IntRegs); |
| 34 | if (IsN32() || IsN64()) |
| 35 | return makeArrayRef(Mips64IntRegs); |
| 36 | llvm_unreachable("Unhandled ABI"); |
| 37 | } |