1 //===- SparcV8InstrFormats.td - SparcV8 Instr Formats ------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 class InstV8<dag ops, string asmstr, list<dag> pattern> : Instruction {
16 let Inst{31-30} = op; // Top two bits are the 'op' field
18 dag OperandList = ops;
19 let AsmString = asmstr;
20 let Pattern = pattern;
23 //===----------------------------------------------------------------------===//
24 // Format #2 instruction classes in the SparcV8
25 //===----------------------------------------------------------------------===//
27 // Format 2 instructions
28 class F2<dag ops, string asmstr, list<dag> pattern>
29 : InstV8<ops, asmstr, pattern> {
33 let Inst{24-22} = op2;
34 let Inst{21-0} = imm22;
37 // Specific F2 classes: SparcV8 manual, page 44
39 class F2_1<bits<3> op2Val, dag ops, string asmstr, list<dag> pattern>
40 : F2<ops, asmstr, pattern> {
48 class F2_2<bits<4> condVal, bits<3> op2Val, dag ops, string asmstr,
49 list<dag> pattern> : F2<ops, asmstr, pattern> {
51 bit annul = 0; // currently unused
57 let Inst{28-25} = cond;
60 //===----------------------------------------------------------------------===//
61 // Format #3 instruction classes in the SparcV8
62 //===----------------------------------------------------------------------===//
64 class F3<dag ops, string asmstr, list<dag> pattern>
65 : InstV8<ops, asmstr, pattern> {
69 let op{1} = 1; // Op = 2 or 3
71 let Inst{24-19} = op3;
72 let Inst{18-14} = rs1;
75 // Specific F3 classes: SparcV8 manual, page 44
77 class F3_1<bits<2> opVal, bits<6> op3val, dag ops,
78 string asmstr, list<dag> pattern> : F3<ops, asmstr, pattern> {
79 bits<8> asi = 0; // asi not currently used in SparcV8
85 let Inst{13} = 0; // i field = 0
86 let Inst{12-5} = asi; // address space identifier
90 class F3_2<bits<2> opVal, bits<6> op3val, dag ops,
91 string asmstr, list<dag> pattern> : F3<ops, asmstr, pattern> {
97 let Inst{13} = 1; // i field = 1
98 let Inst{12-0} = simm13;
102 class F3_3<bits<2> opVal, bits<6> op3val, bits<9> opfval, dag ops,
103 string asmstr, list<dag> pattern> : F3<ops, asmstr, pattern> {
109 let Inst{13-5} = opfval; // fp opcode