blob: 4581f4113043779ae9b25992e3be249fb525d4c0 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- ARMMCTargetDesc.cpp - ARM Target Descriptions ---------------------===//
Evan Cheng928ce722011-07-06 22:02:34 +00002//
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 provides ARM specific target descriptions.
11//
12//===----------------------------------------------------------------------===//
13
Chandler Carruthbe810232013-01-02 10:22:59 +000014#include "ARMBaseInfo.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000015#include "ARMMCAsmInfo.h"
Eli Bendersky2e2ce492013-01-30 16:30:19 +000016#include "ARMMCTargetDesc.h"
Evan Cheng61faa552011-07-25 21:20:24 +000017#include "InstPrinter/ARMInstPrinter.h"
Eli Bendersky2e2ce492013-01-30 16:30:19 +000018#include "llvm/ADT/Triple.h"
Evan Cheng4d6c9d72011-08-23 20:15:21 +000019#include "llvm/MC/MCCodeGenInfo.h"
Rafael Espindolaac4ad252013-10-05 16:42:21 +000020#include "llvm/MC/MCELFStreamer.h"
Evan Cheng4d6c9d72011-08-23 20:15:21 +000021#include "llvm/MC/MCInstrAnalysis.h"
Evan Cheng928ce722011-07-06 22:02:34 +000022#include "llvm/MC/MCInstrInfo.h"
23#include "llvm/MC/MCRegisterInfo.h"
24#include "llvm/MC/MCSubtargetInfo.h"
Evan Chengad5f4852011-07-23 00:00:19 +000025#include "llvm/Support/ErrorHandling.h"
Evan Cheng2bb40352011-08-24 18:08:43 +000026#include "llvm/Support/TargetRegistry.h"
Evan Cheng928ce722011-07-06 22:02:34 +000027
Joey Gouly0e76fa72013-09-12 10:28:05 +000028using namespace llvm;
29
Evan Cheng928ce722011-07-06 22:02:34 +000030#define GET_REGINFO_MC_DESC
31#include "ARMGenRegisterInfo.inc"
32
Joey Gouly0e76fa72013-09-12 10:28:05 +000033static bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
34 std::string &Info) {
Joey Gouly830c27a2013-09-17 09:54:57 +000035 if (STI.getFeatureBits() & llvm::ARM::HasV7Ops &&
36 (MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 15) &&
Joey Gouly0e76fa72013-09-12 10:28:05 +000037 (MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 0) &&
Joey Gouly830c27a2013-09-17 09:54:57 +000038 // Checks for the deprecated CP15ISB encoding:
39 // mcr p15, #0, rX, c7, c5, #4
40 (MI.getOperand(3).isImm() && MI.getOperand(3).getImm() == 7)) {
41 if ((MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 4)) {
42 if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 5) {
43 Info = "deprecated since v7, use 'isb'";
44 return true;
45 }
46
47 // Checks for the deprecated CP15DSB encoding:
48 // mcr p15, #0, rX, c7, c10, #4
49 if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 10) {
50 Info = "deprecated since v7, use 'dsb'";
51 return true;
52 }
53 }
54 // Checks for the deprecated CP15DMB encoding:
55 // mcr p15, #0, rX, c7, c10, #5
56 if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 10 &&
57 (MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 5)) {
58 Info = "deprecated since v7, use 'dmb'";
59 return true;
60 }
Joey Gouly0e76fa72013-09-12 10:28:05 +000061 }
62 return false;
63}
64
Amara Emerson52cfb6a2013-10-03 09:31:51 +000065static bool getITDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
66 std::string &Info) {
67 if (STI.getFeatureBits() & llvm::ARM::HasV8Ops &&
68 MI.getOperand(1).isImm() && MI.getOperand(1).getImm() != 8) {
69 Info = "applying IT instruction to more than one subsequent instruction is deprecated";
70 return true;
71 }
72
73 return false;
74}
75
Evan Cheng928ce722011-07-06 22:02:34 +000076#define GET_INSTRINFO_MC_DESC
77#include "ARMGenInstrInfo.inc"
78
79#define GET_SUBTARGETINFO_MC_DESC
80#include "ARMGenSubtargetInfo.inc"
81
Evan Cheng928ce722011-07-06 22:02:34 +000082
Evan Cheng9f7ad312012-04-26 01:13:36 +000083std::string ARM_MC::ParseARMTriple(StringRef TT, StringRef CPU) {
Eli Bendersky2e2ce492013-01-30 16:30:19 +000084 Triple triple(TT);
85
Evan Cheng2bd65362011-07-07 00:08:19 +000086 // Set the boolean corresponding to the current target triple, or the default
87 // if one cannot be determined, to true.
88 unsigned Len = TT.size();
89 unsigned Idx = 0;
90
Nick Lewyckyf1a5f572011-09-05 18:35:03 +000091 // FIXME: Enhance Triple helper class to extract ARM version.
Rafael Espindola84a87262013-12-18 21:29:44 +000092 bool isThumb = triple.getArch() == Triple::thumb;
Evan Cheng2bd65362011-07-07 00:08:19 +000093 if (Len >= 5 && TT.substr(0, 4) == "armv")
94 Idx = 4;
Rafael Espindola84a87262013-12-18 21:29:44 +000095 else if (Len >= 7 && TT.substr(0, 6) == "thumbv")
96 Idx = 6;
Evan Cheng2bd65362011-07-07 00:08:19 +000097
Evan Chengf52003d2012-04-27 01:27:19 +000098 bool NoCPU = CPU == "generic" || CPU.empty();
Evan Cheng2bd65362011-07-07 00:08:19 +000099 std::string ARMArchFeature;
100 if (Idx) {
101 unsigned SubVer = TT[Idx];
Joey Goulyb3f550e2013-06-26 16:58:26 +0000102 if (SubVer == '8') {
Bernard Ogden4400cde2013-10-14 13:16:57 +0000103 if (NoCPU)
104 // v8a: FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSPThumb2, FeatureMP,
Bernard Ogdenee87e852013-10-29 09:47:35 +0000105 // FeatureHWDiv, FeatureHWDivARM, FeatureTrustZone, FeatureT2XtPk, FeatureCrypto, FeatureCRC
106 ARMArchFeature = "+v8,+db,+fp-armv8,+neon,+t2dsp,+mp,+hwdiv,+hwdiv-arm,+trustzone,+t2xtpk,+crypto,+crc";
Bernard Ogden4400cde2013-10-14 13:16:57 +0000107 else
108 // Use CPU to figure out the exact features
109 ARMArchFeature = "+v8";
Joey Goulyb3f550e2013-06-26 16:58:26 +0000110 } else if (SubVer == '7') {
Evan Cheng2bd65362011-07-07 00:08:19 +0000111 if (Len >= Idx+2 && TT[Idx+1] == 'm') {
Tim Northovera2292d02013-06-10 23:20:58 +0000112 isThumb = true;
Evan Chengf52003d2012-04-27 01:27:19 +0000113 if (NoCPU)
114 // v7m: FeatureNoARM, FeatureDB, FeatureHWDiv, FeatureMClass
115 ARMArchFeature = "+v7,+noarm,+db,+hwdiv,+mclass";
116 else
117 // Use CPU to figure out the exact features.
118 ARMArchFeature = "+v7";
Evan Cheng2bd65362011-07-07 00:08:19 +0000119 } else if (Len >= Idx+3 && TT[Idx+1] == 'e'&& TT[Idx+2] == 'm') {
Evan Chengf52003d2012-04-27 01:27:19 +0000120 if (NoCPU)
121 // v7em: FeatureNoARM, FeatureDB, FeatureHWDiv, FeatureDSPThumb2,
122 // FeatureT2XtPk, FeatureMClass
123 ARMArchFeature = "+v7,+noarm,+db,+hwdiv,+t2dsp,t2xtpk,+mclass";
124 else
125 // Use CPU to figure out the exact features.
126 ARMArchFeature = "+v7";
Bob Wilsone8a549c2012-09-29 21:43:49 +0000127 } else if (Len >= Idx+2 && TT[Idx+1] == 's') {
128 if (NoCPU)
Evan Chengaa37d352014-01-09 20:24:00 +0000129 // v7s: FeatureNEON, FeatureDB, FeatureDSPThumb2, FeatureHasRAS
Bob Wilsone8a549c2012-09-29 21:43:49 +0000130 // Swift
Evan Chengaa37d352014-01-09 20:24:00 +0000131 ARMArchFeature = "+v7,+swift,+neon,+db,+t2dsp,+ras";
Bob Wilsone8a549c2012-09-29 21:43:49 +0000132 else
133 // Use CPU to figure out the exact features.
134 ARMArchFeature = "+v7";
Evan Cheng9f7ad312012-04-26 01:13:36 +0000135 } else {
136 // v7 CPUs have lots of different feature sets. If no CPU is specified,
137 // then assume v7a (e.g. cortex-a8) feature set. Otherwise, return
138 // the "minimum" feature set and use CPU string to figure out the exact
139 // features.
Evan Chengf52003d2012-04-27 01:27:19 +0000140 if (NoCPU)
Evan Cheng9f7ad312012-04-26 01:13:36 +0000141 // v7a: FeatureNEON, FeatureDB, FeatureDSPThumb2, FeatureT2XtPk
142 ARMArchFeature = "+v7,+neon,+db,+t2dsp,+t2xtpk";
143 else
144 // Use CPU to figure out the exact features.
145 ARMArchFeature = "+v7";
146 }
Evan Cheng2bd65362011-07-07 00:08:19 +0000147 } else if (SubVer == '6') {
Jim Grosbach1c9dd292012-02-10 20:38:46 +0000148 if (Len >= Idx+3 && TT[Idx+1] == 't' && TT[Idx+2] == '2')
Evan Cheng2bd65362011-07-07 00:08:19 +0000149 ARMArchFeature = "+v6t2";
Evan Chengf52003d2012-04-27 01:27:19 +0000150 else if (Len >= Idx+2 && TT[Idx+1] == 'm') {
Tim Northovera2292d02013-06-10 23:20:58 +0000151 isThumb = true;
Evan Chengf52003d2012-04-27 01:27:19 +0000152 if (NoCPU)
153 // v6m: FeatureNoARM, FeatureMClass
Amara Emerson5035ee02013-10-07 16:55:23 +0000154 ARMArchFeature = "+v6m,+noarm,+mclass";
Evan Chengf52003d2012-04-27 01:27:19 +0000155 else
156 ARMArchFeature = "+v6";
157 } else
Evan Cheng8b2bda02011-07-07 03:55:05 +0000158 ARMArchFeature = "+v6";
Evan Cheng2bd65362011-07-07 00:08:19 +0000159 } else if (SubVer == '5') {
Evan Cheng8b2bda02011-07-07 03:55:05 +0000160 if (Len >= Idx+3 && TT[Idx+1] == 't' && TT[Idx+2] == 'e')
Evan Cheng2bd65362011-07-07 00:08:19 +0000161 ARMArchFeature = "+v5te";
Evan Cheng8b2bda02011-07-07 03:55:05 +0000162 else
163 ARMArchFeature = "+v5t";
164 } else if (SubVer == '4' && Len >= Idx+2 && TT[Idx+1] == 't')
165 ARMArchFeature = "+v4t";
Evan Cheng2bd65362011-07-07 00:08:19 +0000166 }
167
Evan Chengf2c26162011-07-07 08:26:46 +0000168 if (isThumb) {
169 if (ARMArchFeature.empty())
Evan Cheng1834f5d2011-07-07 19:05:12 +0000170 ARMArchFeature = "+thumb-mode";
Evan Chengf2c26162011-07-07 08:26:46 +0000171 else
Evan Cheng1834f5d2011-07-07 19:05:12 +0000172 ARMArchFeature += ",+thumb-mode";
Evan Chengf2c26162011-07-07 08:26:46 +0000173 }
174
Eli Bendersky2e2ce492013-01-30 16:30:19 +0000175 if (triple.isOSNaCl()) {
176 if (ARMArchFeature.empty())
177 ARMArchFeature = "+nacl-trap";
178 else
179 ARMArchFeature += ",+nacl-trap";
180 }
181
Evan Cheng2bd65362011-07-07 00:08:19 +0000182 return ARMArchFeature;
183}
Evan Cheng4d1ca962011-07-08 01:53:10 +0000184
185MCSubtargetInfo *ARM_MC::createARMMCSubtargetInfo(StringRef TT, StringRef CPU,
186 StringRef FS) {
Evan Cheng9f7ad312012-04-26 01:13:36 +0000187 std::string ArchFS = ARM_MC::ParseARMTriple(TT, CPU);
Evan Cheng4d1ca962011-07-08 01:53:10 +0000188 if (!FS.empty()) {
189 if (!ArchFS.empty())
190 ArchFS = ArchFS + "," + FS.str();
191 else
192 ArchFS = FS;
193 }
194
195 MCSubtargetInfo *X = new MCSubtargetInfo();
Evan Chengc5e6d2f2011-07-11 03:57:24 +0000196 InitARMMCSubtargetInfo(X, TT, CPU, ArchFS);
Evan Cheng4d1ca962011-07-08 01:53:10 +0000197 return X;
198}
199
Evan Cheng1705ab02011-07-14 23:50:31 +0000200static MCInstrInfo *createARMMCInstrInfo() {
Evan Cheng4d1ca962011-07-08 01:53:10 +0000201 MCInstrInfo *X = new MCInstrInfo();
202 InitARMMCInstrInfo(X);
203 return X;
204}
205
Evan Chengd60fa58b2011-07-18 20:57:22 +0000206static MCRegisterInfo *createARMMCRegisterInfo(StringRef Triple) {
Evan Cheng1705ab02011-07-14 23:50:31 +0000207 MCRegisterInfo *X = new MCRegisterInfo();
Jim Grosbach6df94842012-12-19 23:38:53 +0000208 InitARMMCRegisterInfo(X, ARM::LR, 0, 0, ARM::PC);
Evan Cheng1705ab02011-07-14 23:50:31 +0000209 return X;
210}
211
Rafael Espindola227144c2013-05-13 01:16:13 +0000212static MCAsmInfo *createARMMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) {
Evan Cheng1705ab02011-07-14 23:50:31 +0000213 Triple TheTriple(TT);
214
Mark Seabornba86cf52014-01-27 22:38:14 +0000215 MCAsmInfo *MAI;
Tim Northoverd6a729b2014-01-06 14:28:05 +0000216 if (TheTriple.isOSBinFormatMachO())
Mark Seabornba86cf52014-01-27 22:38:14 +0000217 MAI = new ARMMCAsmInfoDarwin();
218 else
219 MAI = new ARMELFMCAsmInfo();
Evan Cheng1705ab02011-07-14 23:50:31 +0000220
Mark Seabornba86cf52014-01-27 22:38:14 +0000221 unsigned Reg = MRI.getDwarfRegNum(ARM::SP, true);
222 MAI->addInitialFrameState(MCCFIInstruction::createDefCfa(0, Reg, 0));
223
224 return MAI;
Evan Cheng1705ab02011-07-14 23:50:31 +0000225}
226
Evan Chengad5f4852011-07-23 00:00:19 +0000227static MCCodeGenInfo *createARMMCCodeGenInfo(StringRef TT, Reloc::Model RM,
Evan Chengecb29082011-11-16 08:38:26 +0000228 CodeModel::Model CM,
229 CodeGenOpt::Level OL) {
Evan Cheng2129f592011-07-19 06:37:02 +0000230 MCCodeGenInfo *X = new MCCodeGenInfo();
Jim Grosbach4e0dbee2011-09-30 17:41:35 +0000231 if (RM == Reloc::Default) {
232 Triple TheTriple(TT);
233 // Default relocation model on Darwin is PIC, not DynamicNoPIC.
234 RM = TheTriple.isOSDarwin() ? Reloc::PIC_ : Reloc::DynamicNoPIC;
235 }
Evan Chengecb29082011-11-16 08:38:26 +0000236 X->InitMCCodeGenInfo(RM, CM, OL);
Evan Cheng2129f592011-07-19 06:37:02 +0000237 return X;
238}
239
Evan Chengad5f4852011-07-23 00:00:19 +0000240// This is duplicated code. Refactor this.
Evan Cheng3a792252011-07-26 00:42:34 +0000241static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
Evan Cheng5928e692011-07-25 23:24:55 +0000242 MCContext &Ctx, MCAsmBackend &MAB,
Evan Chengad5f4852011-07-23 00:00:19 +0000243 raw_ostream &OS,
244 MCCodeEmitter *Emitter,
Rafael Espindolae41383f2014-01-26 06:38:58 +0000245 const MCSubtargetInfo &STI,
Evan Chengad5f4852011-07-23 00:00:19 +0000246 bool RelaxAll,
247 bool NoExecStack) {
248 Triple TheTriple(TT);
249
Tim Northoverd6a729b2014-01-06 14:28:05 +0000250 if (TheTriple.isOSBinFormatMachO())
Jim Grosbach11e8c0d2012-03-08 00:07:52 +0000251 return createMachOStreamer(Ctx, MAB, OS, Emitter, false);
Evan Chengad5f4852011-07-23 00:00:19 +0000252
253 if (TheTriple.isOSWindows()) {
254 llvm_unreachable("ARM does not support Windows COFF format");
Evan Chengad5f4852011-07-23 00:00:19 +0000255 }
256
Tim Northover5cc3dc82012-12-07 16:50:23 +0000257 return createARMELFStreamer(Ctx, MAB, OS, Emitter, false, NoExecStack,
258 TheTriple.getArch() == Triple::thumb);
Evan Chengad5f4852011-07-23 00:00:19 +0000259}
260
Evan Cheng61faa552011-07-25 21:20:24 +0000261static MCInstPrinter *createARMMCInstPrinter(const Target &T,
262 unsigned SyntaxVariant,
James Molloy4c493e82011-09-07 17:24:38 +0000263 const MCAsmInfo &MAI,
Craig Topper54bfde72012-04-02 06:09:36 +0000264 const MCInstrInfo &MII,
Jim Grosbachfd93a592012-03-05 19:33:20 +0000265 const MCRegisterInfo &MRI,
James Molloy4c493e82011-09-07 17:24:38 +0000266 const MCSubtargetInfo &STI) {
Evan Cheng61faa552011-07-25 21:20:24 +0000267 if (SyntaxVariant == 0)
Craig Topper54bfde72012-04-02 06:09:36 +0000268 return new ARMInstPrinter(MAI, MII, MRI, STI);
Evan Cheng61faa552011-07-25 21:20:24 +0000269 return 0;
270}
271
Quentin Colombetf4828052013-05-24 22:51:52 +0000272static MCRelocationInfo *createARMMCRelocationInfo(StringRef TT,
273 MCContext &Ctx) {
Ahmed Bougachaad1084d2013-05-24 00:39:57 +0000274 Triple TheTriple(TT);
Tim Northover9653eb52013-12-10 16:57:43 +0000275 if (TheTriple.isOSBinFormatMachO())
Ahmed Bougachaad1084d2013-05-24 00:39:57 +0000276 return createARMMachORelocationInfo(Ctx);
277 // Default to the stock relocation info.
Quentin Colombetf4828052013-05-24 22:51:52 +0000278 return llvm::createMCRelocationInfo(TT, Ctx);
Ahmed Bougachaad1084d2013-05-24 00:39:57 +0000279}
280
Benjamin Kramerc22d50e2011-08-08 18:56:44 +0000281namespace {
282
283class ARMMCInstrAnalysis : public MCInstrAnalysis {
284public:
285 ARMMCInstrAnalysis(const MCInstrInfo *Info) : MCInstrAnalysis(Info) {}
Benjamin Kramerc22d50e2011-08-08 18:56:44 +0000286
287 virtual bool isUnconditionalBranch(const MCInst &Inst) const {
288 // BCCs with the "always" predicate are unconditional branches.
289 if (Inst.getOpcode() == ARM::Bcc && Inst.getOperand(1).getImm()==ARMCC::AL)
290 return true;
291 return MCInstrAnalysis::isUnconditionalBranch(Inst);
292 }
293
294 virtual bool isConditionalBranch(const MCInst &Inst) const {
295 // BCCs with the "always" predicate are unconditional branches.
296 if (Inst.getOpcode() == ARM::Bcc && Inst.getOperand(1).getImm()==ARMCC::AL)
297 return false;
298 return MCInstrAnalysis::isConditionalBranch(Inst);
299 }
300
Ahmed Bougachaaa790682013-05-24 01:07:04 +0000301 bool evaluateBranch(const MCInst &Inst, uint64_t Addr,
302 uint64_t Size, uint64_t &Target) const {
Benjamin Kramerc22d50e2011-08-08 18:56:44 +0000303 // We only handle PCRel branches for now.
304 if (Info->get(Inst.getOpcode()).OpInfo[0].OperandType!=MCOI::OPERAND_PCREL)
Ahmed Bougachaaa790682013-05-24 01:07:04 +0000305 return false;
Benjamin Kramerc22d50e2011-08-08 18:56:44 +0000306
307 int64_t Imm = Inst.getOperand(0).getImm();
308 // FIXME: This is not right for thumb.
Ahmed Bougachaaa790682013-05-24 01:07:04 +0000309 Target = Addr+Imm+8; // In ARM mode the PC is always off by 8 bytes.
310 return true;
Benjamin Kramerc22d50e2011-08-08 18:56:44 +0000311 }
312};
313
314}
315
316static MCInstrAnalysis *createARMMCInstrAnalysis(const MCInstrInfo *Info) {
317 return new ARMMCInstrAnalysis(Info);
318}
Evan Chengad5f4852011-07-23 00:00:19 +0000319
Evan Cheng8c886a42011-07-22 21:58:54 +0000320// Force static initialization.
321extern "C" void LLVMInitializeARMTargetMC() {
322 // Register the MC asm info.
323 RegisterMCAsmInfoFn A(TheARMTarget, createARMMCAsmInfo);
324 RegisterMCAsmInfoFn B(TheThumbTarget, createARMMCAsmInfo);
325
326 // Register the MC codegen info.
Evan Cheng2129f592011-07-19 06:37:02 +0000327 TargetRegistry::RegisterMCCodeGenInfo(TheARMTarget, createARMMCCodeGenInfo);
328 TargetRegistry::RegisterMCCodeGenInfo(TheThumbTarget, createARMMCCodeGenInfo);
Evan Cheng8c886a42011-07-22 21:58:54 +0000329
330 // Register the MC instruction info.
331 TargetRegistry::RegisterMCInstrInfo(TheARMTarget, createARMMCInstrInfo);
332 TargetRegistry::RegisterMCInstrInfo(TheThumbTarget, createARMMCInstrInfo);
333
334 // Register the MC register info.
335 TargetRegistry::RegisterMCRegInfo(TheARMTarget, createARMMCRegisterInfo);
336 TargetRegistry::RegisterMCRegInfo(TheThumbTarget, createARMMCRegisterInfo);
337
338 // Register the MC subtarget info.
339 TargetRegistry::RegisterMCSubtargetInfo(TheARMTarget,
340 ARM_MC::createARMMCSubtargetInfo);
341 TargetRegistry::RegisterMCSubtargetInfo(TheThumbTarget,
342 ARM_MC::createARMMCSubtargetInfo);
Evan Chengad5f4852011-07-23 00:00:19 +0000343
Evan Cheng4d6c9d72011-08-23 20:15:21 +0000344 // Register the MC instruction analyzer.
345 TargetRegistry::RegisterMCInstrAnalysis(TheARMTarget,
346 createARMMCInstrAnalysis);
347 TargetRegistry::RegisterMCInstrAnalysis(TheThumbTarget,
348 createARMMCInstrAnalysis);
349
Evan Chengad5f4852011-07-23 00:00:19 +0000350 // Register the MC Code Emitter
Evan Cheng3a792252011-07-26 00:42:34 +0000351 TargetRegistry::RegisterMCCodeEmitter(TheARMTarget, createARMMCCodeEmitter);
352 TargetRegistry::RegisterMCCodeEmitter(TheThumbTarget, createARMMCCodeEmitter);
Evan Chengad5f4852011-07-23 00:00:19 +0000353
354 // Register the asm backend.
Evan Cheng5928e692011-07-25 23:24:55 +0000355 TargetRegistry::RegisterMCAsmBackend(TheARMTarget, createARMAsmBackend);
356 TargetRegistry::RegisterMCAsmBackend(TheThumbTarget, createARMAsmBackend);
Evan Chengad5f4852011-07-23 00:00:19 +0000357
358 // Register the object streamer.
Evan Cheng3a792252011-07-26 00:42:34 +0000359 TargetRegistry::RegisterMCObjectStreamer(TheARMTarget, createMCStreamer);
360 TargetRegistry::RegisterMCObjectStreamer(TheThumbTarget, createMCStreamer);
Evan Cheng61faa552011-07-25 21:20:24 +0000361
Rafael Espindolaa17151a2013-10-08 13:08:17 +0000362 // Register the asm streamer.
363 TargetRegistry::RegisterAsmStreamer(TheARMTarget, createMCAsmStreamer);
364 TargetRegistry::RegisterAsmStreamer(TheThumbTarget, createMCAsmStreamer);
365
Evan Cheng61faa552011-07-25 21:20:24 +0000366 // Register the MCInstPrinter.
367 TargetRegistry::RegisterMCInstPrinter(TheARMTarget, createARMMCInstPrinter);
368 TargetRegistry::RegisterMCInstPrinter(TheThumbTarget, createARMMCInstPrinter);
Ahmed Bougachaad1084d2013-05-24 00:39:57 +0000369
370 // Register the MC relocation info.
371 TargetRegistry::RegisterMCRelocationInfo(TheARMTarget,
Quentin Colombetf4828052013-05-24 22:51:52 +0000372 createARMMCRelocationInfo);
Ahmed Bougachaad1084d2013-05-24 00:39:57 +0000373 TargetRegistry::RegisterMCRelocationInfo(TheThumbTarget,
Quentin Colombetf4828052013-05-24 22:51:52 +0000374 createARMMCRelocationInfo);
Evan Cheng2129f592011-07-19 06:37:02 +0000375}