1 //===-- VESubtarget.cpp - VE Subtarget Information ------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the VE specific subclass of TargetSubtargetInfo.
11 //===----------------------------------------------------------------------===//
13 #include "VESubtarget.h"
15 #include "llvm/Support/MathExtras.h"
16 #include "llvm/Support/TargetRegistry.h"
20 #define DEBUG_TYPE "ve-subtarget"
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "VEGenSubtargetInfo.inc"
26 void VESubtarget::anchor() {}
28 VESubtarget &VESubtarget::initializeSubtargetDependencies(StringRef CPU,
30 // Determine default and user specified characteristics
31 std::string CPUName = std::string(CPU);
35 // Parse features string.
36 ParseSubtargetFeatures(CPUName, FS);
41 VESubtarget::VESubtarget(const Triple &TT, const std::string &CPU,
42 const std::string &FS, const TargetMachine &TM)
43 : VEGenSubtargetInfo(TT, CPU, FS), TargetTriple(TT),
44 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
45 FrameLowering(*this) {}
47 int VESubtarget::getAdjustedFrameSize(int frameSize) const {
51 // +----------------------------------------+
52 // | Locals and temporaries |
53 // +----------------------------------------+
54 // | Parameter area for callee |
56 // +----------------------------------------+
57 // | Register save area (RSA) for callee |
59 // 16(fp) | 20 * 8 bytes |
60 // +----------------------------------------+
61 // 8(fp) | Return address |
62 // +----------------------------------------+
63 // 0(fp) | Frame pointer of caller |
64 // --------+----------------------------------------+--------
65 // | Locals and temporaries for callee |
66 // +----------------------------------------+
67 // | Parameter area for callee of callee |
68 // +----------------------------------------+
69 // 16(sp) | RSA for callee of callee |
70 // +----------------------------------------+
71 // 8(sp) | Return address |
72 // +----------------------------------------+
73 // 0(sp) | Frame pointer of callee |
74 // +----------------------------------------+
77 // +----------------------------------------------+
79 // +----------------------------------------------+
81 // +----------------------------------------------+
83 // +----------------------------------------------+
84 // 40(fp) | Linkage area register (%s17) |
85 // +----------------------------------------------+
86 // 32(fp) | Procedure linkage table register (%plt=%s16) |
87 // +----------------------------------------------+
88 // 24(fp) | Global offset table register (%got=%s15) |
89 // +----------------------------------------------+
90 // 16(fp) | Thread pointer register (%tp=%s14) |
91 // +----------------------------------------------+
93 frameSize += 176; // for RSA, RA, and FP
94 frameSize = alignTo(frameSize, 16); // requires 16 bytes alignment
99 bool VESubtarget::enableMachineScheduler() const { return true; }