1 //===- PIC16InstrFormats.td - PIC16 Instruction Formats-------*- tblgen -*-===//
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 //===----------------------------------------------------------------------===//
11 // Describe PIC16 instructions format
13 // All the possible PIC16 fields are:
15 // opcode - operation code.
16 // f - 7-bit register file address.
17 // d - 1-bit direction specifier
18 // k - 8/11 bit literals
19 // b - 3 bits bit num specifier
21 //===----------------------------------------------------------------------===//
23 // Generic PIC16 Format
24 // PIC16 Instructions are 14-bit wide.
26 // FIXME: Add Cooper Specific Formats if any.
28 class PIC16Inst<dag outs, dag ins, string asmstr, list<dag> pattern>
32 let Namespace = "PIC16";
33 dag OutOperandList = outs;
34 dag InOperandList = ins;
35 let AsmString = asmstr;
36 let Pattern = pattern;
40 //===----------------------------------------------------------------------===//
41 // Byte Oriented instruction class in PIC16 : <|opcode|d|f|>
43 // d = direction = 1 bit.
44 // f = file register address = 7 bits.
45 //===----------------------------------------------------------------------===//
47 class ByteFormat<bits<6> opcode, dag outs, dag ins, string asmstr,
49 :PIC16Inst<outs, ins, asmstr, pattern> {
53 let Inst{13-8} = opcode;
59 //===----------------------------------------------------------------------===//
60 // Bit Oriented instruction class in PIC16 : <|opcode|b|f|>
62 // b = bit specifier = 3 bits.
63 // f = file register address = 7 bits.
64 //===----------------------------------------------------------------------===//
66 class BitFormat<bits<4> opcode, dag outs, dag ins, string asmstr,
68 : PIC16Inst<outs, ins, asmstr, pattern> {
72 let Inst{13-10} = opcode;
78 //===----------------------------------------------------------------------===//
79 // Literal Format instruction class in PIC16 : <|opcode|k|>
81 // k = literal = 8 bits
82 //===----------------------------------------------------------------------===//
84 class LiteralFormat<bits<6> opcode, dag outs, dag ins, string asmstr,
86 : PIC16Inst<outs, ins, asmstr, pattern> {
89 let Inst{13-8} = opcode;
94 //===----------------------------------------------------------------------===//
95 // Control Format instruction class in PIC16 : <|opcode|k|>
97 // k = jump address = 11 bits.
98 //===----------------------------------------------------------------------===//
100 class ControlFormat<bits<3> opcode, dag outs, dag ins, string asmstr,
102 : PIC16Inst<outs, ins, asmstr, pattern> {
105 let Inst{13-11} = opcode;
110 //===----------------------------------------------------------------------===//
111 // Pseudo instruction class in PIC16
112 //===----------------------------------------------------------------------===//
114 class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern>
115 : PIC16Inst<outs, ins, asmstr, pattern> {