summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/VE/VESubtarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/VE/VESubtarget.cpp')
-rw-r--r--llvm/lib/Target/VE/VESubtarget.cpp64
1 files changed, 13 insertions, 51 deletions
diff --git a/llvm/lib/Target/VE/VESubtarget.cpp b/llvm/lib/Target/VE/VESubtarget.cpp
index a0b78d95e3cf..daa6cfb8aa84 100644
--- a/llvm/lib/Target/VE/VESubtarget.cpp
+++ b/llvm/lib/Target/VE/VESubtarget.cpp
@@ -27,73 +27,35 @@ void VESubtarget::anchor() {}
VESubtarget &VESubtarget::initializeSubtargetDependencies(StringRef CPU,
StringRef FS) {
+ // Default feature settings
+ EnableVPU = false;
+
// Determine default and user specified characteristics
std::string CPUName = std::string(CPU);
if (CPUName.empty())
- CPUName = "ve";
+ CPUName = "generic";
// Parse features string.
- ParseSubtargetFeatures(CPUName, FS);
+ ParseSubtargetFeatures(CPUName, /*TuneCPU=*/CPU, FS);
return *this;
}
VESubtarget::VESubtarget(const Triple &TT, const std::string &CPU,
const std::string &FS, const TargetMachine &TM)
- : VEGenSubtargetInfo(TT, CPU, FS), TargetTriple(TT),
+ : VEGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
FrameLowering(*this) {}
-int VESubtarget::getAdjustedFrameSize(int frameSize) const {
-
- // VE stack frame:
- //
- // +----------------------------------------+
- // | Locals and temporaries |
- // +----------------------------------------+
- // | Parameter area for callee |
- // 176(fp) | |
- // +----------------------------------------+
- // | Register save area (RSA) for callee |
- // | |
- // 16(fp) | 20 * 8 bytes |
- // +----------------------------------------+
- // 8(fp) | Return address |
- // +----------------------------------------+
- // 0(fp) | Frame pointer of caller |
- // --------+----------------------------------------+--------
- // | Locals and temporaries for callee |
- // +----------------------------------------+
- // | Parameter area for callee of callee |
- // +----------------------------------------+
- // 16(sp) | RSA for callee of callee |
- // +----------------------------------------+
- // 8(sp) | Return address |
- // +----------------------------------------+
- // 0(sp) | Frame pointer of callee |
- // +----------------------------------------+
-
- // RSA frame:
- // +----------------------------------------------+
- // 168(fp) | %s33 |
- // +----------------------------------------------+
- // | %s19...%s32 |
- // +----------------------------------------------+
- // 48(fp) | %s18 |
- // +----------------------------------------------+
- // 40(fp) | Linkage area register (%s17) |
- // +----------------------------------------------+
- // 32(fp) | Procedure linkage table register (%plt=%s16) |
- // +----------------------------------------------+
- // 24(fp) | Global offset table register (%got=%s15) |
- // +----------------------------------------------+
- // 16(fp) | Thread pointer register (%tp=%s14) |
- // +----------------------------------------------+
+uint64_t VESubtarget::getAdjustedFrameSize(uint64_t FrameSize) const {
+ // Calculate adjusted frame size by adding the size of RSA frame,
+ // return address, and frame poitner as described in VEFrameLowering.cpp.
+ const VEFrameLowering *TFL = getFrameLowering();
- frameSize += 176; // for RSA, RA, and FP
- frameSize = alignTo(frameSize, 16); // requires 16 bytes alignment
+ FrameSize += getRsaSize();
+ FrameSize = alignTo(FrameSize, TFL->getStackAlign());
- return frameSize;
+ return FrameSize;
}
bool VESubtarget::enableMachineScheduler() const { return true; }