File: MSP430InstrFormats.td

package info (click to toggle)
llvm 2.6-9.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 57,604 kB
  • ctags: 44,336
  • sloc: cpp: 344,766; sh: 12,407; ansic: 10,617; ada: 3,070; ml: 2,505; perl: 2,496; makefile: 1,426; pascal: 1,163; exp: 389; asm: 307; python: 298; objc: 260; lisp: 182; csh: 117; xml: 38; f90: 36; tcl: 20
file content (67 lines) | stat: -rw-r--r-- 1,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//===- MSP430InstrFormats.td - MSP430 Instruction Formats-----*- tblgen -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source 
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
//  Describe MSP430 instructions format here
//

// Generic MSP430 Format
class MSP430Inst<dag outs, dag ins, string asmstr> : Instruction {
  field bits<16> Inst;

  let Namespace = "MSP430";

  dag OutOperandList = outs;
  dag InOperandList  = ins;

  let AsmString   = asmstr;
}

// FIXME: Create different classes for different addressing modes.

// MSP430 Double Operand (Format I) Instructions
class IForm<bits<4> opcode, bit ad, bit bw, bits<2> as,
            dag outs, dag ins, string asmstr, list<dag> pattern>
  : MSP430Inst<outs, ins, asmstr> {
  let Pattern = pattern;
  
  let Inst{12-15} = opcode;
  let Inst{7}     = ad;
  let Inst{6}     = bw;
  let Inst{4-5}   = as;
}

// MSP430 Single Operand (Format II) Instructions
class IIForm<bits<9> opcode, bit bw, bits<2> ad,
             dag outs, dag ins, string asmstr, list<dag> pattern>
  : MSP430Inst<outs, ins, asmstr> {
  let Pattern = pattern;
  
  let Inst{7-15} = opcode;
  let Inst{6}    = bw;
  let Inst{4-5}  = ad;
}

// MSP430 Conditional Jumps Instructions
class CJForm<bits<3> opcode, bits<3> cond, bit s,
             dag outs, dag ins, string asmstr, list<dag> pattern>
  : MSP430Inst<outs, ins, asmstr> {
  let Pattern = pattern;
  
  let Inst{13-15} = opcode;
  let Inst{10-12} = cond;
  let Inst{9}     = s;
}

// Pseudo instructions
class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern>
  : MSP430Inst<outs, ins, asmstr> {
  let Pattern = pattern;
  let Inst{15-0} = 0;
}