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 | |
Misha Brukman | c42077d | 2004-09-22 21:38:42 +0000 | [diff] [blame] | 31 | include "SparcV8InstrFormats.td" |
Brian Gaeke | e785e53 | 2004-02-25 19:28:19 +0000 | [diff] [blame] | 32 | |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 33 | //===----------------------------------------------------------------------===// |
| 34 | // Instructions |
| 35 | //===----------------------------------------------------------------------===// |
| 36 | |
Chris Lattner | 275f645 | 2004-02-28 19:37:18 +0000 | [diff] [blame] | 37 | // Pseudo instructions. |
Brian Gaeke | 7c4676f | 2004-07-16 10:32:10 +0000 | [diff] [blame] | 38 | class PseudoInstV8<string nm> : InstV8 { |
| 39 | let Name = nm; |
Chris Lattner | 275f645 | 2004-02-28 19:37:18 +0000 | [diff] [blame] | 40 | } |
Brian Gaeke | 7c4676f | 2004-07-16 10:32:10 +0000 | [diff] [blame] | 41 | def PHI : PseudoInstV8<"PHI">; |
| 42 | def ADJCALLSTACKDOWN : PseudoInstV8<"ADJCALLSTACKDOWN">; |
| 43 | def ADJCALLSTACKUP : PseudoInstV8<"ADJCALLSTACKUP">; |
| 44 | def IMPLICIT_USE : PseudoInstV8<"IMPLICIT_USE">; |
| 45 | def IMPLICIT_DEF : PseudoInstV8<"IMPLICIT_DEF">; |
Brian Gaeke | a036b53 | 2004-09-29 03:27:29 +0000 | [diff] [blame] | 46 | def FpMOVD : PseudoInstV8<"FpMOVD">; // pseudo 64-bit double move |
Chris Lattner | 275f645 | 2004-02-28 19:37:18 +0000 | [diff] [blame] | 47 | |
Brian Gaeke | a8056fa | 2004-03-06 05:32:13 +0000 | [diff] [blame] | 48 | // Section A.3 - Synthetic Instructions, p. 85 |
Brian Gaeke | c3e9701 | 2004-05-08 04:21:32 +0000 | [diff] [blame] | 49 | // special cases of JMPL: |
Misha Brukman | 3df04c5 | 2004-10-14 22:32:49 +0000 | [diff] [blame] | 50 | let isReturn = 1, isTerminator = 1, hasDelaySlot = 1 in { |
| 51 | let rd = I7.Num, rs1 = G0.Num, simm13 = 8 in |
| 52 | def RET : F3_2<2, 0b111000, "ret">; |
| 53 | let rd = O7.Num, rs1 = G0.Num, simm13 = 8 in |
| 54 | def RETL: F3_2<2, 0b111000, "retl">; |
| 55 | } |
Brian Gaeke | c3e9701 | 2004-05-08 04:21:32 +0000 | [diff] [blame] | 56 | // CMP is a special case of SUBCC where destination is ignored, by setting it to |
| 57 | // %g0 (hardwired zero). |
| 58 | // FIXME: should keep track of the fact that it defs the integer condition codes |
| 59 | let rd = 0 in |
| 60 | def CMPri: F3_2<2, 0b010100, "cmp">; |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 61 | |
| 62 | // Section B.1 - Load Integer Instructions, p. 90 |
Brian Gaeke | e7f9e0b | 2004-06-24 07:36:59 +0000 | [diff] [blame] | 63 | def LDSB: F3_2<3, 0b001001, "ldsb">; |
| 64 | def LDSH: F3_2<3, 0b001010, "ldsh">; |
| 65 | def LDUB: F3_2<3, 0b000001, "ldub">; |
| 66 | def LDUH: F3_2<3, 0b000010, "lduh">; |
| 67 | def LD : F3_2<3, 0b000000, "ld">; |
| 68 | def LDD : F3_2<3, 0b000011, "ldd">; |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 69 | |
Brian Gaeke | 562d5b0 | 2004-06-18 05:19:27 +0000 | [diff] [blame] | 70 | // Section B.2 - Load Floating-point Instructions, p. 92 |
Brian Gaeke | e7f9e0b | 2004-06-24 07:36:59 +0000 | [diff] [blame] | 71 | def LDFrr : F3_1<3, 0b100000, "ld">; |
| 72 | def LDFri : F3_2<3, 0b100000, "ld">; |
| 73 | def LDDFrr : F3_1<3, 0b100011, "ldd">; |
| 74 | def LDDFri : F3_2<3, 0b100011, "ldd">; |
| 75 | def LDFSRrr: F3_1<3, 0b100001, "ld">; |
| 76 | def LDFSRri: F3_2<3, 0b100001, "ld">; |
Brian Gaeke | 562d5b0 | 2004-06-18 05:19:27 +0000 | [diff] [blame] | 77 | |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 78 | // Section B.4 - Store Integer Instructions, p. 95 |
Brian Gaeke | e7f9e0b | 2004-06-24 07:36:59 +0000 | [diff] [blame] | 79 | def STB : F3_2<3, 0b000101, "stb">; |
| 80 | def STH : F3_2<3, 0b000110, "sth">; |
| 81 | def ST : F3_2<3, 0b000100, "st">; |
| 82 | def STD : F3_2<3, 0b000111, "std">; |
| 83 | |
| 84 | // Section B.5 - Store Floating-point Instructions, p. 97 |
| 85 | def STFrr : F3_1<3, 0b100100, "st">; |
| 86 | def STFri : F3_2<3, 0b100100, "st">; |
| 87 | def STDFrr : F3_1<3, 0b100111, "std">; |
| 88 | def STDFri : F3_2<3, 0b100111, "std">; |
| 89 | def STFSRrr : F3_1<3, 0b100101, "st">; |
| 90 | def STFSRri : F3_2<3, 0b100101, "st">; |
| 91 | def STDFQrr : F3_1<3, 0b100110, "std">; |
| 92 | def STDFQri : F3_2<3, 0b100110, "std">; |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 93 | |
Brian Gaeke | 775158d | 2004-03-04 04:37:45 +0000 | [diff] [blame] | 94 | // Section B.9 - SETHI Instruction, p. 104 |
Brian Gaeke | e806173 | 2004-03-04 00:56:25 +0000 | [diff] [blame] | 95 | def SETHIi: F2_1<0b100, "sethi">; |
| 96 | |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 97 | // Section B.10 - NOP Instruction, p. 105 |
| 98 | // (It's a special case of SETHI) |
Misha Brukman | d36047d | 2004-10-14 22:33:32 +0000 | [diff] [blame] | 99 | let rd = 0, imm22 = 0 in |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 100 | def NOP : F2_1<0b100, "nop">; |
| 101 | |
Brian Gaeke | bc1d27a | 2004-03-03 23:03:14 +0000 | [diff] [blame] | 102 | // Section B.11 - Logical Instructions, p. 106 |
Brian Gaeke | 82a4795 | 2004-11-23 06:39:37 +0000 | [diff] [blame] | 103 | def ANDrr : F3_1<2, 0b000001, "and">; |
| 104 | def ANDri : F3_2<2, 0b000001, "and">; |
| 105 | def ANDCCrr : F3_1<2, 0b010001, "andcc">; |
| 106 | def ANDCCri : F3_2<2, 0b010001, "andcc">; |
| 107 | def ANDNrr : F3_1<2, 0b000101, "andn">; |
| 108 | def ANDNri : F3_2<2, 0b000101, "andn">; |
| 109 | def ANDNCCrr: F3_1<2, 0b010101, "andncc">; |
| 110 | def ANDNCCri: F3_2<2, 0b010101, "andncc">; |
| 111 | def ORrr : F3_1<2, 0b000010, "or">; |
| 112 | def ORri : F3_2<2, 0b000010, "or">; |
| 113 | def ORCCrr : F3_1<2, 0b010010, "orcc">; |
| 114 | def ORCCri : F3_2<2, 0b010010, "orcc">; |
| 115 | def ORNrr : F3_1<2, 0b000110, "orn">; |
| 116 | def ORNri : F3_2<2, 0b000110, "orn">; |
| 117 | def ORNCCrr : F3_1<2, 0b010110, "orncc">; |
| 118 | def ORNCCri : F3_2<2, 0b010110, "orncc">; |
| 119 | def XORrr : F3_1<2, 0b000011, "xor">; |
| 120 | def XORri : F3_2<2, 0b000011, "xor">; |
| 121 | def XORCCrr : F3_1<2, 0b010011, "xorcc">; |
| 122 | def XORCCri : F3_2<2, 0b010011, "xorcc">; |
| 123 | def XNORrr : F3_1<2, 0b000111, "xnor">; |
| 124 | def XNORri : F3_2<2, 0b000111, "xnor">; |
| 125 | def XNORCCrr: F3_1<2, 0b010111, "xnorcc">; |
| 126 | def XNORCCri: F3_2<2, 0b010111, "xnorcc">; |
Brian Gaeke | bc1d27a | 2004-03-03 23:03:14 +0000 | [diff] [blame] | 127 | |
| 128 | // Section B.12 - Shift Instructions, p. 107 |
Chris Lattner | a562efc | 2004-04-07 04:26:57 +0000 | [diff] [blame] | 129 | def SLLrr : F3_1<2, 0b100101, "sll">; |
| 130 | def SLLri : F3_2<2, 0b100101, "sll">; |
| 131 | def SRLrr : F3_1<2, 0b100110, "srl">; |
| 132 | def SRLri : F3_2<2, 0b100110, "srl">; |
| 133 | def SRArr : F3_1<2, 0b100111, "sra">; |
| 134 | def SRAri : F3_2<2, 0b100111, "sra">; |
Brian Gaeke | bc1d27a | 2004-03-03 23:03:14 +0000 | [diff] [blame] | 135 | |
| 136 | // Section B.13 - Add Instructions, p. 108 |
Brian Gaeke | 4351857 | 2004-11-21 07:13:17 +0000 | [diff] [blame] | 137 | def ADDrr : F3_1<2, 0b000000, "add">; |
| 138 | def ADDri : F3_2<2, 0b000000, "add">; |
| 139 | def ADDCCrr : F3_1<2, 0b010000, "addcc">; |
| 140 | def ADDCCri : F3_2<2, 0b010000, "addcc">; |
| 141 | def ADDXrr : F3_1<2, 0b001000, "addx">; |
| 142 | def ADDXri : F3_2<2, 0b001000, "addx">; |
| 143 | def ADDXCCrr: F3_1<2, 0b011000, "addxcc">; |
| 144 | def ADDXCCri: F3_2<2, 0b011000, "addxcc">; |
Brian Gaeke | bc1d27a | 2004-03-03 23:03:14 +0000 | [diff] [blame] | 145 | |
Brian Gaeke | 775158d | 2004-03-04 04:37:45 +0000 | [diff] [blame] | 146 | // Section B.15 - Subtract Instructions, p. 110 |
Chris Lattner | 6179047 | 2004-04-07 05:04:01 +0000 | [diff] [blame] | 147 | def SUBrr : F3_1<2, 0b000100, "sub">; |
Brian Gaeke | 4351857 | 2004-11-21 07:13:17 +0000 | [diff] [blame] | 148 | def SUBri : F3_2<2, 0b000100, "sub">; |
Chris Lattner | 6179047 | 2004-04-07 05:04:01 +0000 | [diff] [blame] | 149 | def SUBCCrr : F3_1<2, 0b010100, "subcc">; |
Brian Gaeke | c3e9701 | 2004-05-08 04:21:32 +0000 | [diff] [blame] | 150 | def SUBCCri : F3_2<2, 0b010100, "subcc">; |
Brian Gaeke | 4351857 | 2004-11-21 07:13:17 +0000 | [diff] [blame] | 151 | def SUBXrr : F3_1<2, 0b001100, "subx">; |
| 152 | def SUBXri : F3_2<2, 0b001100, "subx">; |
| 153 | def SUBXCCrr: F3_1<2, 0b011100, "subxcc">; |
| 154 | def SUBXCCri: F3_2<2, 0b011100, "subxcc">; |
Brian Gaeke | 775158d | 2004-03-04 04:37:45 +0000 | [diff] [blame] | 155 | |
Brian Gaeke | 032f80f | 2004-03-16 22:37:13 +0000 | [diff] [blame] | 156 | // Section B.18 - Multiply Instructions, p. 113 |
Brian Gaeke | c2e5f36 | 2004-12-10 08:39:29 +0000 | [diff] [blame] | 157 | def UMULrr : F3_1<2, 0b001010, "umul">; |
| 158 | def UMULri : F3_2<2, 0b001010, "umul">; |
| 159 | def SMULrr : F3_1<2, 0b001011, "smul">; |
| 160 | def SMULri : F3_2<2, 0b001011, "smul">; |
| 161 | def UMULCCrr: F3_1<2, 0b011010, "umulcc">; |
| 162 | def UMULCCri: F3_2<2, 0b011010, "umulcc">; |
| 163 | def SMULCCrr: F3_1<2, 0b011011, "smulcc">; |
| 164 | def SMULCCri: F3_2<2, 0b011011, "smulcc">; |
Brian Gaeke | 032f80f | 2004-03-16 22:37:13 +0000 | [diff] [blame] | 165 | |
Brian Gaeke | e88c9dc | 2004-04-07 04:01:00 +0000 | [diff] [blame] | 166 | // Section B.19 - Divide Instructions, p. 115 |
Chris Lattner | 22ede70 | 2004-04-07 04:06:46 +0000 | [diff] [blame] | 167 | def UDIVrr : F3_1<2, 0b001110, "udiv">; |
| 168 | def UDIVri : F3_2<2, 0b001110, "udiv">; |
| 169 | def SDIVrr : F3_1<2, 0b001111, "sdiv">; |
| 170 | def SDIVri : F3_2<2, 0b001111, "sdiv">; |
| 171 | def UDIVCCrr : F3_1<2, 0b011110, "udivcc">; |
| 172 | def UDIVCCri : F3_2<2, 0b011110, "udivcc">; |
| 173 | def SDIVCCrr : F3_1<2, 0b011111, "sdivcc">; |
| 174 | def SDIVCCri : F3_2<2, 0b011111, "sdivcc">; |
Brian Gaeke | e88c9dc | 2004-04-07 04:01:00 +0000 | [diff] [blame] | 175 | |
Brian Gaeke | a8056fa | 2004-03-06 05:32:13 +0000 | [diff] [blame] | 176 | // Section B.20 - SAVE and RESTORE, p. 117 |
| 177 | def SAVErr : F3_1<2, 0b111100, "save">; // save r, r, r |
| 178 | def SAVEri : F3_2<2, 0b111100, "save">; // save r, i, r |
| 179 | def RESTORErr : F3_1<2, 0b111101, "restore">; // restore r, r, r |
| 180 | def RESTOREri : F3_2<2, 0b111101, "restore">; // restore r, i, r |
| 181 | |
Brian Gaeke | c3e9701 | 2004-05-08 04:21:32 +0000 | [diff] [blame] | 182 | // Section B.21 - Branch on Integer Condition Codes Instructions, p. 119 |
Brian Gaeke | 070bb4a | 2004-06-17 22:34:29 +0000 | [diff] [blame] | 183 | |
| 184 | // conditional branch class: |
| 185 | class BranchV8<bits<4> cc, string nm> : F2_2<cc, 0b010, nm> { |
| 186 | let isBranch = 1; |
| 187 | let isTerminator = 1; |
Brian Gaeke | d7bf501 | 2004-09-30 04:04:48 +0000 | [diff] [blame] | 188 | let hasDelaySlot = 1; |
Brian Gaeke | 070bb4a | 2004-06-17 22:34:29 +0000 | [diff] [blame] | 189 | } |
Chris Lattner | 0f6eab3 | 2004-07-31 02:24:37 +0000 | [diff] [blame] | 190 | |
| 191 | let isBarrier = 1 in |
| 192 | def BA : BranchV8<0b1000, "ba">; |
Brian Gaeke | 070bb4a | 2004-06-17 22:34:29 +0000 | [diff] [blame] | 193 | def BN : BranchV8<0b0000, "bn">; |
| 194 | def BNE : BranchV8<0b1001, "bne">; |
| 195 | def BE : BranchV8<0b0001, "be">; |
| 196 | def BG : BranchV8<0b1010, "bg">; |
| 197 | def BLE : BranchV8<0b0010, "ble">; |
| 198 | def BGE : BranchV8<0b1011, "bge">; |
| 199 | def BL : BranchV8<0b0011, "bl">; |
| 200 | def BGU : BranchV8<0b1100, "bgu">; |
| 201 | def BLEU : BranchV8<0b0100, "bleu">; |
| 202 | def BCC : BranchV8<0b1101, "bcc">; |
| 203 | def BCS : BranchV8<0b0101, "bcs">; |
Brian Gaeke | c3e9701 | 2004-05-08 04:21:32 +0000 | [diff] [blame] | 204 | |
Brian Gaeke | 4185d03 | 2004-07-08 09:08:22 +0000 | [diff] [blame] | 205 | // Section B.22 - Branch on Floating-point Condition Codes Instructions, p. 121 |
| 206 | |
| 207 | // floating-point conditional branch class: |
| 208 | class FPBranchV8<bits<4> cc, string nm> : F2_2<cc, 0b110, nm> { |
| 209 | let isBranch = 1; |
| 210 | let isTerminator = 1; |
Brian Gaeke | d7bf501 | 2004-09-30 04:04:48 +0000 | [diff] [blame] | 211 | let hasDelaySlot = 1; |
Brian Gaeke | 4185d03 | 2004-07-08 09:08:22 +0000 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | def FBA : FPBranchV8<0b1000, "fba">; |
| 215 | def FBN : FPBranchV8<0b0000, "fbn">; |
| 216 | def FBU : FPBranchV8<0b0111, "fbu">; |
| 217 | def FBG : FPBranchV8<0b0110, "fbg">; |
| 218 | def FBUG : FPBranchV8<0b0101, "fbug">; |
| 219 | def FBL : FPBranchV8<0b0100, "fbl">; |
| 220 | def FBUL : FPBranchV8<0b0011, "fbul">; |
| 221 | def FBLG : FPBranchV8<0b0010, "fblg">; |
| 222 | def FBNE : FPBranchV8<0b0001, "fbne">; |
| 223 | def FBE : FPBranchV8<0b1001, "fbe">; |
| 224 | def FBUE : FPBranchV8<0b1010, "fbue">; |
| 225 | def FBGE : FPBranchV8<0b1011, "fbge">; |
| 226 | def FBUGE: FPBranchV8<0b1100, "fbuge">; |
| 227 | def FBLE : FPBranchV8<0b1101, "fble">; |
| 228 | def FBULE: FPBranchV8<0b1110, "fbule">; |
| 229 | def FBO : FPBranchV8<0b1111, "fbo">; |
| 230 | |
Brian Gaeke | b354b71 | 2004-11-16 07:32:09 +0000 | [diff] [blame] | 231 | |
| 232 | |
Brian Gaeke | 8542e08 | 2004-04-02 20:53:37 +0000 | [diff] [blame] | 233 | // Section B.24 - Call and Link Instruction, p. 125 |
Brian Gaeke | a8056fa | 2004-03-06 05:32:13 +0000 | [diff] [blame] | 234 | // This is the only Format 1 instruction |
Brian Gaeke | b354b71 | 2004-11-16 07:32:09 +0000 | [diff] [blame] | 235 | let Uses = [O0, O1, O2, O3, O4, O5], hasDelaySlot = 1, isCall = 1 in { |
Brian Gaeke | d7bf501 | 2004-09-30 04:04:48 +0000 | [diff] [blame] | 236 | // pc-relative call: |
Brian Gaeke | b354b71 | 2004-11-16 07:32:09 +0000 | [diff] [blame] | 237 | let Defs = [O0, O1, O2, O3, O4, O5, O7, G1, G2, G3, G4, G5, G6, G7, |
| 238 | D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15] in |
Brian Gaeke | 374b36d | 2004-09-29 20:45:05 +0000 | [diff] [blame] | 239 | def CALL : InstV8 { |
| 240 | bits<30> disp; |
| 241 | let op = 1; |
| 242 | let Inst{29-0} = disp; |
| 243 | let Name = "call"; |
| 244 | } |
Brian Gaeke | b354b71 | 2004-11-16 07:32:09 +0000 | [diff] [blame] | 245 | |
| 246 | // indirect call (O7 is an EXPLICIT def in indirect calls, so it cannot also |
| 247 | // be an implicit def): |
| 248 | let Defs = [O0, O1, O2, O3, O4, O5, G1, G2, G3, G4, G5, G6, G7, |
| 249 | D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15] in |
Brian Gaeke | f89cc65 | 2004-06-18 06:28:10 +0000 | [diff] [blame] | 250 | def JMPLrr : F3_1<2, 0b111000, "jmpl">; // jmpl [rs1+rs2], rd |
Brian Gaeke | 374b36d | 2004-09-29 20:45:05 +0000 | [diff] [blame] | 251 | } |
Misha Brukman | 23e6c1f | 2004-02-26 00:37:12 +0000 | [diff] [blame] | 252 | |
Chris Lattner | 22ede70 | 2004-04-07 04:06:46 +0000 | [diff] [blame] | 253 | // Section B.29 - Write State Register Instructions |
| 254 | def WRrr : F3_1<2, 0b110000, "wr">; // wr rs1, rs2, rd |
| 255 | def WRri : F3_2<2, 0b110000, "wr">; // wr rs1, imm, rd |
Chris Lattner | 6179047 | 2004-04-07 05:04:01 +0000 | [diff] [blame] | 256 | |
Brian Gaeke | c53105c | 2004-06-27 22:53:56 +0000 | [diff] [blame] | 257 | // Convert Integer to Floating-point Instructions, p. 141 |
| 258 | def FITOS : F3_3<2, 0b110100, 0b011000100, "fitos">; |
Brian Gaeke | 22ad67d | 2004-09-29 19:59:07 +0000 | [diff] [blame] | 259 | def FITOD : F3_3<2, 0b110100, 0b011001000, "fitod">; |
Brian Gaeke | c53105c | 2004-06-27 22:53:56 +0000 | [diff] [blame] | 260 | |
Brian Gaeke | 59e12ed | 2004-10-14 19:39:35 +0000 | [diff] [blame] | 261 | // Convert Floating-point to Integer Instructions, p. 142 |
| 262 | def FSTOI : F3_3<2, 0b110100, 0b011010001, "fstoi">; |
| 263 | def FDTOI : F3_3<2, 0b110100, 0b011010010, "fdtoi">; |
| 264 | |
Brian Gaeke | 57ff2e3 | 2004-06-24 21:22:09 +0000 | [diff] [blame] | 265 | // Convert between Floating-point Formats Instructions, p. 143 |
| 266 | def FSTOD : F3_3<2, 0b110100, 0b011001001, "fstod">; |
| 267 | def FDTOS : F3_3<2, 0b110100, 0b011000110, "fdtos">; |
| 268 | |
Brian Gaeke | f89cc65 | 2004-06-18 06:28:10 +0000 | [diff] [blame] | 269 | // Floating-point Move Instructions, p. 144 |
| 270 | def FMOVS : F3_3<2, 0b110100, 0b000000001, "fmovs">; |
| 271 | def FNEGS : F3_3<2, 0b110100, 0b000000101, "fnegs">; |
| 272 | def FABSS : F3_3<2, 0b110100, 0b000001001, "fabss">; |
| 273 | |
Brian Gaeke | c53105c | 2004-06-27 22:53:56 +0000 | [diff] [blame] | 274 | // Floating-point Add and Subtract Instructions, p. 146 |
| 275 | def FADDS : F3_3<2, 0b110100, 0b001000001, "fadds">; |
| 276 | def FADDD : F3_3<2, 0b110100, 0b001000010, "faddd">; |
| 277 | def FSUBS : F3_3<2, 0b110100, 0b001000101, "fsubs">; |
| 278 | def FSUBD : F3_3<2, 0b110100, 0b001000110, "fsubd">; |
| 279 | |
| 280 | // Floating-point Multiply and Divide Instructions, p. 147 |
| 281 | def FMULS : F3_3<2, 0b110100, 0b001001001, "fmuls">; |
| 282 | def FMULD : F3_3<2, 0b110100, 0b001001010, "fmuld">; |
| 283 | def FSMULD : F3_3<2, 0b110100, 0b001101001, "fsmuld">; |
| 284 | def FDIVS : F3_3<2, 0b110100, 0b001001101, "fdivs">; |
| 285 | def FDIVD : F3_3<2, 0b110100, 0b001001110, "fdivd">; |
Brian Gaeke | 57ff2e3 | 2004-06-24 21:22:09 +0000 | [diff] [blame] | 286 | |
Brian Gaeke | 4185d03 | 2004-07-08 09:08:22 +0000 | [diff] [blame] | 287 | // Floating-point Compare Instructions, p. 148 |
Brian Gaeke | d7bf501 | 2004-09-30 04:04:48 +0000 | [diff] [blame] | 288 | // Note: the 2nd template arg is different for these guys. |
| 289 | // Note 2: the result of a FCMP is not available until the 2nd cycle |
| 290 | // after the instr is retired, but there is no interlock. This behavior |
| 291 | // is modelled as a delay slot. |
| 292 | let hasDelaySlot = 1 in { |
| 293 | def FCMPS : F3_3<2, 0b110101, 0b001010001, "fcmps">; |
| 294 | def FCMPD : F3_3<2, 0b110101, 0b001010010, "fcmpd">; |
| 295 | def FCMPES : F3_3<2, 0b110101, 0b001010101, "fcmpes">; |
| 296 | def FCMPED : F3_3<2, 0b110101, 0b001010110, "fcmped">; |
| 297 | } |
Brian Gaeke | 4185d03 | 2004-07-08 09:08:22 +0000 | [diff] [blame] | 298 | |