Misha Brukman | e07c2aa | 2004-02-25 21:02:21 +0000 | [diff] [blame] | 1 | //===- SparcV8Instrs.td - Target Description for SparcV8 Target -----------===// |
Brian Gaeke | e785e53 | 2004-02-25 19:28:19 +0000 | [diff] [blame] | 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 | // |
Misha Brukman | e07c2aa | 2004-02-25 21:02:21 +0000 | [diff] [blame] | 10 | // This file describes the SparcV8 instructions in TableGen format. |
Brian Gaeke | e785e53 | 2004-02-25 19:28:19 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Misha Brukman | e07c2aa | 2004-02-25 21:02:21 +0000 | [diff] [blame] | 14 | //===----------------------------------------------------------------------===// |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 15 | // Instruction format superclass |
Misha Brukman | e07c2aa | 2004-02-25 21:02:21 +0000 | [diff] [blame] | 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | class InstV8 : Instruction { // SparcV8 instruction baseline |
| 19 | field bits<32> Inst; |
| 20 | |
| 21 | let Namespace = "V8"; |
| 22 | |
| 23 | bits<2> op; |
| 24 | let Inst{31-30} = op; // Top two bits are the 'op' field |
| 25 | |
| 26 | // Bit attributes specific to SparcV8 instructions |
| 27 | bit isPasi = 0; // Does this instruction affect an alternate addr space? |
| 28 | bit isPrivileged = 0; // Is this a privileged instruction? |
Brian Gaeke | e785e53 | 2004-02-25 19:28:19 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Chris Lattner | a85d46e | 2004-02-28 19:45:39 +0000 | [diff] [blame^] | 31 | include "SparcV8InstrInfo_F2.td" |
| 32 | include "SparcV8InstrInfo_F3.td" |
Brian Gaeke | e785e53 | 2004-02-25 19:28:19 +0000 | [diff] [blame] | 33 | |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 34 | //===----------------------------------------------------------------------===// |
| 35 | // Instructions |
| 36 | //===----------------------------------------------------------------------===// |
| 37 | |
Chris Lattner | 275f645 | 2004-02-28 19:37:18 +0000 | [diff] [blame] | 38 | // Pseudo instructions. |
| 39 | def PHI : InstV8 { |
| 40 | let Name = "PHI"; |
| 41 | } |
| 42 | def ADJCALLSTACKDOWN : InstV8 { |
| 43 | let Name = "ADJCALLSTACKDOWN"; |
| 44 | } |
| 45 | def ADJCALLSTACKUP : InstV8 { |
| 46 | let Name = "ADJCALLSTACKUP"; |
| 47 | } |
| 48 | |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 49 | // Section B.20: SAVE and RESTORE - p117 |
| 50 | def SAVEr : F3_1<2, 0b111100, "save">; // save r, r, r |
| 51 | def SAVEi : F3_2<2, 0b111100, "save">; // save r, i, r |
| 52 | def RESTOREr : F3_1<2, 0b111101, "restore">; // restore r, r, r |
| 53 | def RESTOREi : F3_2<2, 0b111101, "restore">; // restore r, i, r |
| 54 | |
| 55 | // Section B.24: Call and Link - p125 |
| 56 | // This is the only Format 1 instruction |
| 57 | def CALL : InstV8 { |
| 58 | bits<30> disp; |
| 59 | |
| 60 | let op = 1; |
| 61 | let Inst{29-0} = disp; |
| 62 | let Name = "call"; |
| 63 | } |
| 64 | |
| 65 | // Section B.25: Jump and Link - p126 |
| 66 | def JMPLr : F3_1<2, 0b111000, "jmpl">; // jmpl [rs1+rs2], rd |
| 67 | def JMPLi : F3_2<2, 0b111000, "jmpl">; // jmpl [rs1+imm], rd |
| 68 | |