[llvm-commits] [llvm] r146692 - in /llvm/trunk/lib/Target/Hexagon: CMakeLists.txt Hexagon.h HexagonInstrInfo.cpp HexagonMCAsmInfo.cpp HexagonMCAsmInfo.h HexagonRegisterInfo.cpp HexagonSubtarget.cpp HexagonTargetMachine.cpp LLVMBuild.txt MCTargetDesc/ MCTargetDesc/CMakeLists.txt MCTargetDesc/HexagonMCAsmInfo.cpp MCTargetDesc/HexagonMCAsmInfo.h MCTargetDesc/HexagonMCTargetDesc.cpp MCTargetDesc/HexagonMCTargetDesc.h MCTargetDesc/LLVMBuild.txt MCTargetDesc/Makefile Makefile
Tony Linthicum
tlinth at codeaurora.org
Thu Dec 15 14:29:08 PST 2011
Author: tlinth
Date: Thu Dec 15 16:29:08 2011
New Revision: 146692
URL: http://llvm.org/viewvc/llvm-project?rev=146692&view=rev
Log:
Add MCTargetDesc library to Hexagon target
Added:
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp
- copied unchanged from r146412, llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.h
- copied unchanged from r146412, llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/Makefile
Removed:
llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp
llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h
Modified:
llvm/trunk/lib/Target/Hexagon/CMakeLists.txt
llvm/trunk/lib/Target/Hexagon/Hexagon.h
llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/trunk/lib/Target/Hexagon/HexagonRegisterInfo.cpp
llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp
llvm/trunk/lib/Target/Hexagon/HexagonTargetMachine.cpp
llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt
llvm/trunk/lib/Target/Hexagon/Makefile
Modified: llvm/trunk/lib/Target/Hexagon/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/CMakeLists.txt?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/Hexagon/CMakeLists.txt Thu Dec 15 16:29:08 2011
@@ -31,3 +31,5 @@
)
add_subdirectory(TargetInfo)
+add_subdirectory(MCTargetDesc)
+
Modified: llvm/trunk/lib/Target/Hexagon/Hexagon.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/Hexagon.h?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/Hexagon.h (original)
+++ llvm/trunk/lib/Target/Hexagon/Hexagon.h Thu Dec 15 16:29:08 2011
@@ -16,6 +16,7 @@
#define TARGET_Hexagon_H
#include <cassert>
+#include "MCTargetDesc/HexagonMCTargetDesc.h"
#include "llvm/Target/TargetLowering.h"
namespace llvm {
@@ -37,23 +38,8 @@
FunctionPass *createHexagonOptimizeSZExtends();
FunctionPass *createHexagonFixupHwLoops();
- extern Target TheHexagonTarget;
-
} // end namespace llvm;
-// Defines symbolic names for Hexagon instructions and registers.
-// This defines a mapping from register name to register number.
-//
-
-#define GET_REGINFO_ENUM
-#include "HexagonGenRegisterInfo.inc"
-
-#define GET_INSTRINFO_ENUM
-#include "HexagonGenInstrInfo.inc"
-
-#define GET_SUBTARGETINFO_ENUM
-#include "HexagonGenSubtargetInfo.inc"
-
#define Hexagon_POINTER_SIZE 4
#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Thu Dec 15 16:29:08 2011
@@ -23,7 +23,6 @@
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
-#define GET_INSTRINFO_MC_DESC
#define GET_INSTRINFO_CTOR
#include "HexagonGenInstrInfo.inc"
Removed: llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp?rev=146691&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.cpp (removed)
@@ -1,36 +0,0 @@
-//===-- HexagonMCAsmInfo.cpp - Hexagon asm properties -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declarations of the HexagonMCAsmInfo properties.
-//
-//===----------------------------------------------------------------------===//
-
-#include "HexagonMCAsmInfo.h"
-
-using namespace llvm;
-
-HexagonMCAsmInfo::HexagonMCAsmInfo(const Target &T, StringRef TT) {
- Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
- Data64bitsDirective = 0; // .xword is only supported by V9.
- ZeroDirective = "\t.skip\t";
- CommentString = "//";
- HasLEB128 = true;
-
- PrivateGlobalPrefix = ".L";
- LCOMMDirectiveType = LCOMM::ByteAlignment;
- InlineAsmStart = "# InlineAsm Start";
- InlineAsmEnd = "# InlineAsm End";
- ZeroDirective = "\t.space\t";
- AscizDirective = "\t.string\t";
- WeakRefDirective = "\t.weak\t";
-
- UsesELFSectionDirectiveForBSS = true;
- ExceptionsType = ExceptionHandling::DwarfCFI;
-}
Removed: llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h?rev=146691&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonMCAsmInfo.h (removed)
@@ -1,30 +0,0 @@
-//===-- HexagonTargetAsmInfo.h - Hexagon asm properties ---------*- C++ -*--==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the HexagonMCAsmInfo class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef HexagonMCASMINFO_H
-#define HexagonMCASMINFO_H
-
-#include "llvm/ADT/StringRef.h"
-#include "llvm/MC/MCAsmInfo.h"
-
-namespace llvm {
- class Target;
-
- class HexagonMCAsmInfo : public MCAsmInfo {
- public:
- explicit HexagonMCAsmInfo(const Target &T, StringRef TT);
- };
-
-} // namespace llvm
-
-#endif
Modified: llvm/trunk/lib/Target/Hexagon/HexagonRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonRegisterInfo.cpp?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonRegisterInfo.cpp Thu Dec 15 16:29:08 2011
@@ -319,4 +319,5 @@
return 0;
}
+#define GET_REGINFO_TARGET_DESC
#include "HexagonGenRegisterInfo.inc"
Modified: llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonSubtarget.cpp Thu Dec 15 16:29:08 2011
@@ -17,7 +17,6 @@
#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
-#define GET_SUBTARGETINFO_MC_DESC
#define GET_SUBTARGETINFO_CTOR
#define GET_SUBTARGETINFO_TARGET_DESC
#include "HexagonGenSubtargetInfo.inc"
Modified: llvm/trunk/lib/Target/Hexagon/HexagonTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonTargetMachine.cpp?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonTargetMachine.cpp Thu Dec 15 16:29:08 2011
@@ -10,7 +10,6 @@
//
//===----------------------------------------------------------------------===//
-#include "HexagonMCAsmInfo.h"
#include "HexagonTargetMachine.h"
#include "Hexagon.h"
#include "HexagonISelLowering.h"
@@ -23,12 +22,6 @@
#include "llvm/Support/TargetRegistry.h"
#include <iostream>
-#define GET_REGINFO_MC_DESC
-#define GET_REGINFO_TARGET_DESC
-#include "HexagonGenRegisterInfo.inc"
-
-extern "C" void LLVMInitializeHexagonTargetMC() {}
-
using namespace llvm;
static cl::
@@ -47,9 +40,6 @@
extern "C" void LLVMInitializeHexagonTarget() {
// Register the target.
RegisterTargetMachine<HexagonTargetMachine> X(TheHexagonTarget);
-
- // Register the target asm info.
- RegisterMCAsmInfo<HexagonMCAsmInfo> A(TheHexagonTarget);
}
Modified: llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt Thu Dec 15 16:29:08 2011
@@ -16,7 +16,7 @@
;===------------------------------------------------------------------------===;
[common]
-subdirectories = TargetInfo
+subdirectories = TargetInfo MCTargetDesc
[component_0]
type = TargetGroup
@@ -28,5 +28,5 @@
type = Library
name = HexagonCodeGen
parent = Hexagon
-required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC
+required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC HexagonDesc
add_to_library_groups = Hexagon
Added: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt?rev=146692&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt (added)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt Thu Dec 15 16:29:08 2011
@@ -0,0 +1,6 @@
+add_llvm_library(LLVMHexagonDesc
+ HexagonMCTargetDesc.cpp
+ HexagonMCAsmInfo.cpp
+ )
+
+add_dependencies(LLVMHexagonDesc HexagonCommonTableGen)
Added: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp?rev=146692&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp (added)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp Thu Dec 15 16:29:08 2011
@@ -0,0 +1,94 @@
+//===-- HexagonMCTargetDesc.cpp - Cell Hexagon Target Descriptions -----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides Cell Hexagon specific target descriptions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "HexagonMCTargetDesc.h"
+#include "HexagonMCAsmInfo.h"
+#include "llvm/MC/MachineLocation.h"
+#include "llvm/MC/MCCodeGenInfo.h"
+#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/TargetRegistry.h"
+
+#define GET_INSTRINFO_MC_DESC
+#include "HexagonGenInstrInfo.inc"
+
+#define GET_SUBTARGETINFO_MC_DESC
+#include "HexagonGenSubtargetInfo.inc"
+
+#define GET_REGINFO_MC_DESC
+#include "HexagonGenRegisterInfo.inc"
+
+using namespace llvm;
+
+static MCInstrInfo *createHexagonMCInstrInfo() {
+ MCInstrInfo *X = new MCInstrInfo();
+ InitHexagonMCInstrInfo(X);
+ return X;
+}
+
+static MCRegisterInfo *createHexagonMCRegisterInfo(StringRef TT) {
+ MCRegisterInfo *X = new MCRegisterInfo();
+ InitHexagonMCRegisterInfo(X, Hexagon::R0);
+ return X;
+}
+
+static MCSubtargetInfo *createHexagonMCSubtargetInfo(StringRef TT,
+ StringRef CPU,
+ StringRef FS) {
+ MCSubtargetInfo *X = new MCSubtargetInfo();
+ InitHexagonMCSubtargetInfo(X, TT, CPU, FS);
+ return X;
+}
+
+static MCAsmInfo *createHexagonMCAsmInfo(const Target &T, StringRef TT) {
+ MCAsmInfo *MAI = new HexagonMCAsmInfo(T, TT);
+
+ // VirtualFP = (R30 + #0).
+ MachineLocation Dst(MachineLocation::VirtualFP);
+ MachineLocation Src(Hexagon::R30, 0);
+ MAI->addInitialFrameState(0, Dst, Src);
+
+ return MAI;
+}
+
+static MCCodeGenInfo *createHexagonMCCodeGenInfo(StringRef TT, Reloc::Model RM,
+ CodeModel::Model CM,
+ CodeGenOpt::Level OL) {
+ MCCodeGenInfo *X = new MCCodeGenInfo();
+ // For the time being, use static relocations, since there's really no
+ // support for PIC yet.
+ X->InitMCCodeGenInfo(Reloc::Static, CM, OL);
+ return X;
+}
+
+// Force static initialization.
+extern "C" void LLVMInitializeHexagonTargetMC() {
+ // Register the MC asm info.
+ RegisterMCAsmInfoFn X(TheHexagonTarget, createHexagonMCAsmInfo);
+
+ // Register the MC codegen info.
+ TargetRegistry::RegisterMCCodeGenInfo(TheHexagonTarget,
+ createHexagonMCCodeGenInfo);
+
+ // Register the MC instruction info.
+ TargetRegistry::RegisterMCInstrInfo(TheHexagonTarget, createHexagonMCInstrInfo);
+
+ // Register the MC register info.
+ TargetRegistry::RegisterMCRegInfo(TheHexagonTarget,
+ createHexagonMCRegisterInfo);
+
+ // Register the MC subtarget info.
+ TargetRegistry::RegisterMCSubtargetInfo(TheHexagonTarget,
+ createHexagonMCSubtargetInfo);
+}
Added: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h?rev=146692&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h (added)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h Thu Dec 15 16:29:08 2011
@@ -0,0 +1,40 @@
+//===-- SPUMCTargetDesc.h - Hexagon Target Descriptions ---------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides Hexagon specific target descriptions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SPUMCTARGETDESC_H
+#define SPUMCTARGETDESC_H
+
+namespace llvm {
+class MCSubtargetInfo;
+class Target;
+class StringRef;
+
+extern Target TheHexagonTarget;
+
+} // End llvm namespace
+
+// Define symbolic names for Hexagon registers. This defines a mapping from
+// register name to register number.
+//
+#define GET_REGINFO_ENUM
+#include "HexagonGenRegisterInfo.inc"
+
+// Defines symbolic names for the Hexagon instructions.
+//
+#define GET_INSTRINFO_ENUM
+#include "HexagonGenInstrInfo.inc"
+
+#define GET_SUBTARGETINFO_ENUM
+#include "HexagonGenSubtargetInfo.inc"
+
+#endif
Added: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt?rev=146692&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt (added)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt Thu Dec 15 16:29:08 2011
@@ -0,0 +1,23 @@
+;===- ./lib/Target/CellSPU/MCTargetDesc/LLVMBuild.txt ----------*- Conf -*--===;
+;
+; The LLVM Compiler Infrastructure
+;
+; This file is distributed under the University of Illinois Open Source
+; License. See LICENSE.TXT for details.
+;
+;===------------------------------------------------------------------------===;
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;
+; http://llvm.org/docs/LLVMBuild.html
+;
+;===------------------------------------------------------------------------===;
+
+[component_0]
+type = Library
+name = HexagonDesc
+parent = Hexagon
+required_libraries = HexagonInfo MC
+add_to_library_groups = Hexagon
Added: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/Makefile?rev=146692&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/Makefile (added)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/Makefile Thu Dec 15 16:29:08 2011
@@ -0,0 +1,16 @@
+##===- lib/Target/CellSPU/TargetDesc/Makefile --------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../../..
+LIBRARYNAME = LLVMHexagonDesc
+
+# Hack: we need to include 'main' target directory to grab private headers
+CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
+
+include $(LEVEL)/Makefile.common
Modified: llvm/trunk/lib/Target/Hexagon/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/Makefile?rev=146692&r1=146691&r2=146692&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/Makefile (original)
+++ llvm/trunk/lib/Target/Hexagon/Makefile Thu Dec 15 16:29:08 2011
@@ -18,6 +18,6 @@
HexagonGenCallingConv.inc \
HexagonAsmPrinter.cpp
-DIRS = TargetInfo
+DIRS = TargetInfo MCTargetDesc
include $(LEVEL)/Makefile.common
More information about the llvm-commits
mailing list