Add gfx950 mfma instructions to ROCDL dialect (#123361)
[llvm-project.git] / llvm / lib / Target / VE / VESubtarget.cpp
blob197bffe2b55b7a0dfbfb61da57ae2e5ce2fac878
1 //===-- VESubtarget.cpp - VE Subtarget Information ------------------------===//
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 //
9 // This file implements the VE specific subclass of TargetSubtargetInfo.
11 //===----------------------------------------------------------------------===//
13 #include "VESubtarget.h"
14 #include "llvm/MC/TargetRegistry.h"
16 using namespace llvm;
18 #define DEBUG_TYPE "ve-subtarget"
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "VEGenSubtargetInfo.inc"
24 void VESubtarget::anchor() {}
26 VESubtarget &VESubtarget::initializeSubtargetDependencies(StringRef CPU,
27 StringRef FS) {
28 // Default feature settings
29 EnableVPU = false;
31 // Determine default and user specified characteristics
32 std::string CPUName = std::string(CPU);
33 if (CPUName.empty())
34 CPUName = "generic";
36 // Parse features string.
37 ParseSubtargetFeatures(CPUName, /*TuneCPU=*/CPU, FS);
39 return *this;
42 VESubtarget::VESubtarget(const Triple &TT, const std::string &CPU,
43 const std::string &FS, const TargetMachine &TM)
44 : VEGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),
45 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
46 FrameLowering(*this) {}
48 uint64_t VESubtarget::getAdjustedFrameSize(uint64_t FrameSize) const {
49 // Calculate adjusted frame size by adding the size of RSA frame,
50 // return address, and frame poitner as described in VEFrameLowering.cpp.
51 const VEFrameLowering *TFL = getFrameLowering();
53 FrameSize += getRsaSize();
54 FrameSize = alignTo(FrameSize, TFL->getStackAlign());
56 return FrameSize;
59 bool VESubtarget::enableMachineScheduler() const { return true; }