blob: 04a8e3252ba3f94333773518e5f558ae5c21a978 [file] [log] [blame]
Daniel Sanders23e98772014-11-02 16:09:29 +00001//===---- 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
13using namespace llvm;
14
15namespace {
16static const MCPhysReg O32IntRegs[4] = {Mips::A0, Mips::A1, Mips::A2, Mips::A3};
17
18static 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
23const 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 Sandersd7eba312014-11-07 12:21:37 +000030
31const 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}