LLVM: lib/Target/MSP430/MSP430Subtarget.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

16

17using namespace llvm;

18

19#define DEBUG_TYPE "msp430-subtarget"

20

23 cl::desc("Hardware multiplier use mode for MSP430"),

27 "Do not use hardware multiplier"),

29 "Use 16-bit hardware multiplier"),

31 "Use 32-bit hardware multiplier"),

33 "Use F5 series hardware multiplier")));

34

35#define GET_SUBTARGETINFO_TARGET_DESC

36#define GET_SUBTARGETINFO_CTOR

37#include "MSP430GenSubtargetInfo.inc"

38

39void MSP430Subtarget::anchor() { }

40

43 ExtendedInsts = false;

45

47 if (CPUName.empty())

48 CPUName = "msp430";

49

51

54

55 return *this;

56}

57

62 FrameLowering(*this) {

63 TSInfo = std::make_unique();

64}

65

67

69 return TSInfo.get();

70}

71

74 const struct {

75 const RTLIB::Libcall Op;

76 const RTLIB::LibcallImpl Impl;

77 } LibraryCalls[] = {

78

79 {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_hw},

80 {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_hw},

81 {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_hw},

82

83

84 };

85 for (const auto &LC : LibraryCalls) {

86 Info.setLibcallImpl(LC.Op, LC.Impl);

87 }

89 const struct {

90 const RTLIB::Libcall Op;

91 const RTLIB::LibcallImpl Impl;

92 } LibraryCalls[] = {

93

94 {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_hw},

95 {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_hw32},

96 {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_hw32},

97

98

99 };

100 for (const auto &LC : LibraryCalls) {

101 Info.setLibcallImpl(LC.Op, LC.Impl);

102 }

104 const struct {

105 const RTLIB::Libcall Op;

106 const RTLIB::LibcallImpl Impl;

107 } LibraryCalls[] = {

108

109 {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi_f5hw},

110 {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl_f5hw},

111 {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll_f5hw},

112

113

114 };

115 for (const auto &LC : LibraryCalls) {

116 Info.setLibcallImpl(LC.Op, LC.Impl);

117 }

118 } else {

119 const struct {

120 const RTLIB::Libcall Op;

121 const RTLIB::LibcallImpl Impl;

122 } LibraryCalls[] = {

123

124 {RTLIB::MUL_I16, RTLIB::impl___mspabi_mpyi},

125 {RTLIB::MUL_I32, RTLIB::impl___mspabi_mpyl},

126 {RTLIB::MUL_I64, RTLIB::impl___mspabi_mpyll},

127

128

129 };

130 for (const auto &LC : LibraryCalls) {

131 Info.setLibcallImpl(LC.Op, LC.Impl);

132 }

133 }

134}

#define clEnumValN(ENUMVAL, FLAGNAME, DESC)

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")))

Tracks which library functions to use for a particular subtarget.

const SelectionDAGTargetInfo * getSelectionDAGInfo() const override

Definition MSP430Subtarget.cpp:68

~MSP430Subtarget() override

MSP430Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)

Definition MSP430Subtarget.cpp:42

void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)

ParseSubtargetFeatures - Parses features string setting specified subtarget options.

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.

Definition MSP430Subtarget.cpp:58

void initLibcallLoweringInfo(LibcallLoweringInfo &Info) const override

Definition MSP430Subtarget.cpp:72

Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...

StringRef - Represent a constant reference to a string, i.e.

constexpr bool empty() const

empty - Check if the string is empty.

Primary interface to the complete machine description for the target machine.

Triple - Helper class for working with autoconf configuration names.

ValuesClass values(OptsTy... Options)

Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...

initializer< Ty > init(const Ty &Val)

This is an optimization pass for GlobalISel generic memory operations.

DWARFExpression::Operation Op