Difference between revisions of "NaplesPU.td"

From NaplesPU Documentation
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Tablegen Files]]
 
[[Category:Tablegen Files]]
The NuPlus.td file contains the definition of the Target class '''NuPlus''' (defined in "compiler/include/llvm/Target/Target.td"). The file also contains the definition of the '''NuPlusInstrInfo''', '''NuPlusAsmParser''' and '''NuPlusAsmWriter''' required by the '''Target''' class.
+
The NuPlus.td file contains the definition of the Target class '''NuPlus''' (defined in "compiler/include/llvm/Target/Target.td"). The file also contains the definition of the '''NuPlusInstrInfo''', '''NuPlusAsmParser''' and '''NuPlusAsmWriter''' required by the '''Target''' class. In addition, we avoid using instruction itineraries for scheduling. Itineraries are details reservation tables for each instruction class.  
  
 
<syntaxhighlight lang="c" line='line'>
 
<syntaxhighlight lang="c" line='line'>
Line 7: Line 7:
  
 
def NuPlusAsmParser : AsmParser {
 
def NuPlusAsmParser : AsmParser {
 +
  // the target do not have multiple names for registers and, 
 +
  // hence, do not need a hand written register name matcher.
 
   bit ShouldEmitMatchRegisterName = 1;
 
   bit ShouldEmitMatchRegisterName = 1;
 
}
 
}
Line 12: Line 14:
 
def NuPlusAsmWriter : AsmWriter {
 
def NuPlusAsmWriter : AsmWriter {
 
   string AsmWriterClassName  = "InstPrinter";
 
   string AsmWriterClassName  = "InstPrinter";
 +
  // this assembly writer if for an MC emitter (MCInst).
 
   bit isMCAsmWriter = 1;
 
   bit isMCAsmWriter = 1;
 
}
 
}

Revision as of 14:54, 1 June 2018

The NuPlus.td file contains the definition of the Target class NuPlus (defined in "compiler/include/llvm/Target/Target.td"). The file also contains the definition of the NuPlusInstrInfo, NuPlusAsmParser and NuPlusAsmWriter required by the Target class. In addition, we avoid using instruction itineraries for scheduling. Itineraries are details reservation tables for each instruction class.

def NuPlusInstrInfo : InstrInfo;

def NuPlusAsmParser : AsmParser {
  // the target do not have multiple names for registers and,  
  // hence, do not need a hand written register name matcher.
  bit ShouldEmitMatchRegisterName = 1;
}

def NuPlusAsmWriter : AsmWriter {
  string AsmWriterClassName  = "InstPrinter";
  // this assembly writer if for an MC emitter (MCInst).
  bit isMCAsmWriter = 1;
}

def : Processor<"nuplus", NoItineraries, []>;

def NuPlus : Target {
  // Pull in Instruction Info:
  let InstructionSet = NuPlusInstrInfo;
  let AssemblyParsers  = [NuPlusAsmParser];
  let AssemblyWriters = [NuPlusAsmWriter];
}