Added LLVM copyright header.
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9_F2.td
1 //===- SparcV9_F2.td - Format 2 instructions: Sparc V9 Target -------------===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Format #2 classes
12 //
13 class F2 : InstV9 {                   // Format 2 instructions
14   bits<3> op2;
15   let op          = 0;    // Op = 0
16   let Inst{24-22} = op2;
17 }
18
19 // Format 2.1 instructions
20 class F2_1<string name> : F2 {
21   bits<22> imm;
22   bits<5>  rd;
23
24   let Name        = name;
25   let Inst{29-25} = rd;
26   let Inst{21-0}  = imm;
27 }
28
29 class F2_br : F2 {                    // Format 2 Branch instruction
30   let isBranch    = 1;      // All instances are branch instructions
31 }
32
33 class F2_2<bits<4> cond, string name> : F2_br { // Format 2.2 instructions
34   bits<22> disp;
35   bit      annul = 0; // currently unused by Sparc backend
36
37   let Name        = name;
38   let Inst{29}    = annul;
39   let Inst{28-25} = cond;
40   let Inst{21-0}  = disp;
41 }
42
43 class F2_3<bits<4> cond, string name> : F2_br { // Format 2.3 instructions
44   bits<2>  cc;
45   bits<19> disp;
46   bit      predict = 1;
47   bit      annul = 0; // currently unused by Sparc backend
48
49   let Name        = name;
50   let Inst{29}    = annul;
51   let Inst{28-25} = cond;
52   let Inst{21-20} = cc;
53   let Inst{19}    = predict;
54   let Inst{18-0}  = disp;
55 }
56
57 class F2_4<bits<3> rcond, string name> : F2_br { // Format 2.4 instructions
58   bits<5>  rs1;
59   bits<16> disp;
60   bit      predict = 1;
61   bit      annul = 0; // currently unused by Sparc backend
62
63   let Name        = name;
64   let Inst{29}    = annul;
65   let Inst{28}    = 0;
66   let Inst{27-25} = rcond;
67   let Inst{21-20} = disp{15-14};
68   let Inst{19}    = predict;
69   let Inst{18-14} = rs1;
70   let Inst{13-0 } = disp{13-0};
71 }