1 //===-- ARMWinEH.cpp - Windows on ARM EH Support Functions ------*- 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 #include "llvm/Support/ARMWinEH.h"
11 #include "llvm/Support/raw_ostream.h"
16 std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF) {
17 uint8_t NumRegisters = RF.Reg();
18 uint8_t RegistersVFP = RF.R();
19 uint8_t LinkRegister = RF.L();
20 uint8_t ChainedFrame = RF.C();
22 uint16_t GPRMask = (ChainedFrame << 11) | (LinkRegister << 14);
26 VFPMask |= (((1 << ((NumRegisters + 1) % 8)) - 1) << 8);
28 GPRMask |= (((1 << (NumRegisters + 1)) - 1) << 4);
30 if (PrologueFolding(RF))
31 GPRMask |= (((1 << (NumRegisters + 1)) - 1) << (~RF.StackAdjust() & 0x3));
33 return std::make_pair(GPRMask, VFPMask);