1 //===-- XCoreMCTargetDesc.cpp - XCore Target Descriptions -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides XCore specific target descriptions.
12 //===----------------------------------------------------------------------===//
14 #include "XCoreMCTargetDesc.h"
15 #include "XCoreMCAsmInfo.h"
16 #include "llvm/MC/MCInstrInfo.h"
17 #include "llvm/MC/MCRegisterInfo.h"
18 #include "llvm/MC/MCSubtargetInfo.h"
19 #include "llvm/Target/TargetRegistry.h"
21 #define GET_INSTRINFO_MC_DESC
22 #include "XCoreGenInstrInfo.inc"
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "XCoreGenSubtargetInfo.inc"
27 #define GET_REGINFO_MC_DESC
28 #include "XCoreGenRegisterInfo.inc"
32 static MCInstrInfo *createXCoreMCInstrInfo() {
33 MCInstrInfo *X = new MCInstrInfo();
34 InitXCoreMCInstrInfo(X);
38 extern "C" void LLVMInitializeXCoreMCInstrInfo() {
39 TargetRegistry::RegisterMCInstrInfo(TheXCoreTarget, createXCoreMCInstrInfo);
42 static MCRegisterInfo *createXCoreMCRegisterInfo(StringRef TT) {
43 MCRegisterInfo *X = new MCRegisterInfo();
44 InitXCoreMCRegisterInfo(X, XCore::LR);
48 extern "C" void LLVMInitializeXCoreMCRegisterInfo() {
49 TargetRegistry::RegisterMCRegInfo(TheXCoreTarget, createXCoreMCRegisterInfo);
52 static MCSubtargetInfo *createXCoreMCSubtargetInfo(StringRef TT, StringRef CPU,
54 MCSubtargetInfo *X = new MCSubtargetInfo();
55 InitXCoreMCSubtargetInfo(X, TT, CPU, FS);
59 extern "C" void LLVMInitializeXCoreMCSubtargetInfo() {
60 TargetRegistry::RegisterMCSubtargetInfo(TheXCoreTarget,
61 createXCoreMCSubtargetInfo);
64 static MCAsmInfo *createXCoreMCAsmInfo(const Target &T, StringRef TT) {
65 MCAsmInfo *MAI = new XCoreMCAsmInfo(T, TT);
67 // Initial state of the frame pointer is SP.
68 MachineLocation Dst(MachineLocation::VirtualFP);
69 MachineLocation Src(XCore::SP, 0);
70 MAI->addInitialFrameState(0, Dst, Src);
75 extern "C" void LLVMInitializeXCoreMCAsmInfo() {
76 RegisterMCAsmInfoFn X(TheXCoreTarget, createXCoreMCAsmInfo);