LLVM  8.0.1
MSP430Subtarget.cpp
Go to the documentation of this file.
1 //===-- MSP430Subtarget.cpp - MSP430 Subtarget Information ----------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the MSP430 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "MSP430Subtarget.h"
15 #include "MSP430.h"
17 
18 using namespace llvm;
19 
20 #define DEBUG_TYPE "msp430-subtarget"
21 
23 HWMultModeOption("mhwmult", cl::Hidden,
24  cl::desc("Hardware multiplier use mode for MSP430"),
26  cl::values(
28  "Do not use hardware multiplier"),
30  "Use 16-bit hardware multiplier"),
32  "Use 32-bit hardware multiplier"),
34  "Use F5 series hardware multiplier")));
35 
36 #define GET_SUBTARGETINFO_TARGET_DESC
37 #define GET_SUBTARGETINFO_CTOR
38 #include "MSP430GenSubtargetInfo.inc"
39 
40 void MSP430Subtarget::anchor() { }
41 
44  ExtendedInsts = false;
45  HWMultMode = NoHWMult;
46 
47  std::string CPUName = CPU;
48  if (CPUName.empty())
49  CPUName = "msp430";
50 
51  ParseSubtargetFeatures(CPUName, FS);
52 
54  HWMultMode = HWMultModeOption;
55 
56  return *this;
57 }
58 
59 MSP430Subtarget::MSP430Subtarget(const Triple &TT, const std::string &CPU,
60  const std::string &FS, const TargetMachine &TM)
61  : MSP430GenSubtargetInfo(TT, CPU, FS), FrameLowering(),
62  InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this) {}
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MSP430Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:423
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
Definition: CommandLine.h:643
static cl::opt< MSP430Subtarget::HWMultEnum > HWMultModeOption("mhwmult", cl::Hidden, cl::desc("Hardware multiplier use mode for MSP430"), cl::init(MSP430Subtarget::NoHWMult), cl::values(clEnumValN(MSP430Subtarget::NoHWMult, "none", "Do not use hardware multiplier"), clEnumValN(MSP430Subtarget::HWMult16, "16bit", "Use 16-bit hardware multiplier"), clEnumValN(MSP430Subtarget::HWMult32, "32bit", "Use 32-bit hardware multiplier"), clEnumValN(MSP430Subtarget::HWMultF5, "f5series", "Use F5 series hardware multiplier")))
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
Definition: CommandLine.h:618
MSP430Subtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.