mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
a1d10f171e
This patch includes all missing functionality needed to provide first compilation of a simple program that just returns from a function. I've added a test case that checks for "ret" instruction printed in assembly output. Patch by Andrei Grischenko (andrei.l.grischenko@intel.com) Differential revision: https://reviews.llvm.org/D39688 llvm-svn: 320035
60 lines
2.2 KiB
TableGen
60 lines
2.2 KiB
TableGen
//===-- 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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Calling Conv, Instruction Descriptions
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
include "llvm/Target/Target.td"
|
|
include "Nios2RegisterInfo.td"
|
|
include "Nios2Schedule.td"
|
|
include "Nios2InstrInfo.td"
|
|
include "Nios2CallingConv.td"
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Nios2 Subtarget features
|
|
//===----------------------------------------------------------------------===//
|
|
def FeatureNios2r1 : SubtargetFeature<"nios2r1", "Nios2ArchVersion",
|
|
"Nios2r1", "Nios2 R1 ISA Support">;
|
|
def FeatureNios2r2 : SubtargetFeature<"nios2r2", "Nios2ArchVersion",
|
|
"Nios2r2", "Nios2 R2 ISA Support">;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Nios2 processors supported.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
class Proc<string Name, list<SubtargetFeature> Features>
|
|
: Processor<Name, Nios2GenericItineraries, Features>;
|
|
|
|
def : Proc<"nios2r1", [FeatureNios2r1]>;
|
|
def : Proc<"nios2r2", [FeatureNios2r2]>;
|
|
|
|
def Nios2InstrInfo : InstrInfo;
|
|
|
|
def Nios2AsmParser : AsmParser {
|
|
let ShouldEmitMatchRegisterName = 0;
|
|
}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Declare the target which we are implementing
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def Nios2AsmWriter : AsmWriter {
|
|
string AsmWriterClassName = "InstPrinter";
|
|
int PassSubtarget = 1;
|
|
int Variant = 0;
|
|
}
|
|
|
|
def Nios2 : Target {
|
|
// def Nios2InstrInfo : InstrInfo as before.
|
|
let InstructionSet = Nios2InstrInfo;
|
|
let AssemblyParsers = [Nios2AsmParser];
|
|
let AssemblyWriters = [Nios2AsmWriter];
|
|
}
|