LLVM  15.0.0git
ARMWinEH.cpp
Go to the documentation of this file.
1 //===-- ARMWinEH.cpp - Windows on ARM EH Support Functions ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 namespace llvm {
12 namespace ARM {
13 namespace WinEH {
14 std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF) {
15  uint8_t NumRegisters = RF.Reg();
16  uint8_t RegistersVFP = RF.R();
17  uint8_t LinkRegister = RF.L();
18  uint8_t ChainedFrame = RF.C();
19 
20  uint16_t GPRMask = (ChainedFrame << 11) | (LinkRegister << 14);
21  uint32_t VFPMask = 0;
22 
23  if (RegistersVFP)
24  VFPMask |= (((1 << ((NumRegisters + 1) % 8)) - 1) << 8);
25  else
26  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << 4);
27 
28  if (PrologueFolding(RF))
29  GPRMask |= (((1 << (NumRegisters + 1)) - 1) << (~RF.StackAdjust() & 0x3));
30 
31  return std::make_pair(GPRMask, VFPMask);
32 }
33 } // namespace WinEH
34 } // namespace ARM
35 } // namespace llvm
36 
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
ARMWinEH.h
llvm::WinEH::EncodingType::ARM
@ ARM
Windows AXP64.
llvm::ARM::WinEH::PrologueFolding
bool PrologueFolding(const RuntimeFunction &RF)
PrologueFolding - pseudo-flag derived from Stack Adjust indicating that the prologue has stack adjust...
Definition: ARMWinEH.h:188
llvm::ARM::WinEH::RuntimeFunction::Reg
uint8_t Reg() const
Definition: ARMWinEH.h:150
llvm::ARM::WinEH::RuntimeFunction::C
bool C() const
Definition: ARMWinEH.h:168
llvm::ARM::WinEH::RuntimeFunction::L
bool L() const
Definition: ARMWinEH.h:162
llvm::ARM::WinEH::RuntimeFunction
RuntimeFunction - An entry in the table of procedure data (.pdata)
Definition: ARMWinEH.h:103
uint32_t
llvm::ARM::WinEH::RuntimeFunction::R
bool R() const
Definition: ARMWinEH.h:156
uint16_t
llvm::ExceptionHandling::WinEH
@ WinEH
Windows Exception Handling.
llvm::ARM::WinEH::RuntimeFunction::StackAdjust
uint16_t StackAdjust() const
Definition: ARMWinEH.h:178
llvm::ARM::WinEH::SavedRegisterMask
std::pair< uint16_t, uint32_t > SavedRegisterMask(const RuntimeFunction &RF)
SavedRegisterMask - Utility function to calculate the set of saved general purpose (r0-r15) and VFP (...
Definition: ARMWinEH.cpp:14