This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewers: craig.topper, hfinkel, joerg, lattner, zvi Reviewed By: craig.topper Subscribers: oren_ben_simhon, igorb, belickim, tvvikram, mgorny, llvm-commits, pavel.v.chupin, DavidKreitzer Differential Revision: https://reviews.llvm.org/D32669 Patch by AndreiGrischenko <andrei.l.grischenko@intel.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304144 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Nikolai Bozhenov
committed
May 29, 2017
1 parent
a67ba2c
commit 404324e
Showing
21 changed files
with
597 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ subdirectories = | |
MSP430 | ||
NVPTX | ||
Mips | ||
Nios2 | ||
PowerPC | ||
RISCV | ||
Sparc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
set(LLVM_TARGET_DEFINITIONS Nios2.td) | ||
|
||
#Generate Nios2GenRegisterInfo.inc and Nios2GenInstrInfo.inc which included by | ||
#your hand code C++ files. | ||
#Nios2GenRegisterInfo.inc came from Nios2RegisterInfo.td, Nios2GenInstrInfo.inc | ||
#came from Nios2InstrInfo.td. | ||
tablegen(LLVM Nios2GenRegisterInfo.inc -gen-register-info) | ||
tablegen(LLVM Nios2GenInstrInfo.inc -gen-instr-info) | ||
|
||
#Nios2CommonTableGen must be defined | ||
add_public_tablegen_target(Nios2CommonTableGen) | ||
|
||
#Nios2CodeGen should match with LLVMBuild.txt Nios2CodeGen | ||
add_llvm_target(Nios2CodeGen Nios2TargetMachine.cpp) | ||
|
||
#Should match with "subdirectories = MCTargetDesc TargetInfo" in LLVMBuild.txt | ||
add_subdirectory(TargetInfo) | ||
add_subdirectory(MCTargetDesc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
;===- ./lib/Target/Nios2/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 | ||
; | ||
;===------------------------------------------------------------------------===; | ||
|
||
#Following comments extracted from http: // llvm.org/docs/LLVMBuild.html | ||
|
||
[common] | ||
subdirectories = | ||
MCTargetDesc | ||
TargetInfo | ||
|
||
[component_0] | ||
#TargetGroup components are an extension of LibraryGroups, specifically for | ||
#defining LLVM targets(which are handled specially in a few places). | ||
type = TargetGroup | ||
#The name of the component should always be the name of the target.(should | ||
#match "def Nios2 : Target" in Nios2.td) | ||
name = Nios2 | ||
#Nios2 component is located in directory Target / | ||
parent = Target | ||
#Whether this target defines an assembly parser, assembly printer, disassembler | ||
#, and supports JIT compilation.They are optional. | ||
|
||
[component_1] | ||
#component_1 is a Library type and name is Nios2CodeGen.After build it will | ||
#in lib / libLLVMNios2CodeGen.a of your build command directory. | ||
type = Library | ||
name = Nios2CodeGen | ||
#Nios2CodeGen component(Library) is located in directory Nios2 / | ||
parent = Nios2 | ||
#If given, a list of the names of Library or LibraryGroup components which | ||
#must also be linked in whenever this library is used.That is, the link time | ||
#dependencies for this component.When tools are built, the build system will | ||
#include the transitive closure of all required_libraries for the components | ||
#the tool needs. | ||
required_libraries = CodeGen | ||
Core | ||
GlobalISel | ||
MC | ||
Nios2Desc | ||
Nios2Info | ||
Support | ||
Target | ||
#end of required_libraries | ||
|
||
#All LLVMBuild.txt in Target / Nios2 and subdirectory use 'add_to_library_groups | ||
#= Nios2' | ||
add_to_library_groups = Nios2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#MCTargetDesc / CMakeLists.txt | ||
add_llvm_library(LLVMNios2Desc Nios2MCTargetDesc.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
;===- ./lib/Target/Nios2/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 = Nios2Desc | ||
parent = Nios2 | ||
required_libraries = MC | ||
Nios2Info | ||
Support | ||
add_to_library_groups = Nios2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//===-- Nios2MCTargetDesc.cpp - Nios2 Target Descriptions -----------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file provides Nios2 specific target descriptions. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "Nios2MCTargetDesc.h" | ||
#include "llvm/MC/MCInstrInfo.h" | ||
|
||
using namespace llvm; | ||
|
||
#define GET_INSTRINFO_MC_DESC | ||
#include "Nios2GenInstrInfo.inc" | ||
|
||
#define GET_REGINFO_MC_DESC | ||
#include "Nios2GenRegisterInfo.inc" | ||
|
||
extern "C" void LLVMInitializeNios2TargetMC() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===-- Nios2MCTargetDesc.h - Nios2 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 Nios2 specific target descriptions. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2MCTARGETDESC_H | ||
#define LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2MCTARGETDESC_H | ||
|
||
namespace llvm { | ||
class Target; | ||
class Triple; | ||
|
||
Target &getTheNios2Target(); | ||
|
||
} // namespace llvm | ||
|
||
// Defines symbolic names for Nios2 registers. This defines a mapping from | ||
// register name to register number. | ||
#define GET_REGINFO_ENUM | ||
#include "Nios2GenRegisterInfo.inc" | ||
|
||
// Defines symbolic names for the Nios2 instructions. | ||
#define GET_INSTRINFO_ENUM | ||
#include "Nios2GenInstrInfo.inc" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//===-- Nios2.h - Top-level interface for Nios2 representation --*- 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 entry points for global functions defined in | ||
// the LLVM Nios2 back-end. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_LIB_TARGET_NIOS2_NIOS2_H | ||
#define LLVM_LIB_TARGET_NIOS2_NIOS2_H | ||
|
||
#include "MCTargetDesc/Nios2MCTargetDesc.h" | ||
#include "llvm/Target/TargetMachine.h" | ||
|
||
namespace llvm { | ||
class Nios2TargetMachine; | ||
} // namespace llvm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===-- Nios2.td - Describe the Nios2 Target Machine -------*- tablegen -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Target-independent interfaces | ||
//===----------------------------------------------------------------------===// | ||
|
||
include "llvm/Target/Target.td" | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Target-dependent interfaces | ||
//===----------------------------------------------------------------------===// | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Calling Conv, Instruction Descriptions | ||
//===----------------------------------------------------------------------===// | ||
|
||
include "Nios2RegisterInfo.td" | ||
include "Nios2InstrInfo.td" | ||
|
||
def Nios2InstrInfo : InstrInfo; | ||
|
||
def Nios2 : Target { let InstructionSet = Nios2InstrInfo; } |
Oops, something went wrong.