blob: 61b8bb27d7c4f25c69cee0a9057e1058803ba818 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===- ARMInstrVFP.td - VFP support for ARM -------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
Jim Grosbach31b3e682008-09-11 21:41:29 +000010// This file describes the ARM VFP instruction set.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011//
12//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// ARM VFP Instruction templates.
16//
17
18// ARM Float Instruction
Evan Chengb783fa32007-07-19 01:14:50 +000019class ASI<dag outs, dag ins, string opc, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000020 : AI<0x0, outs, ins, VFPFrm, opc, asm, pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021 // TODO: Mark the instructions with the appropriate subtarget info.
22}
23
Evan Chengb783fa32007-07-19 01:14:50 +000024class ASI5<dag outs, dag ins, string opc, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000025 : I<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
26 VFPFrm, opc, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027 // TODO: Mark the instructions with the appropriate subtarget info.
28}
29
30// ARM Double Instruction
Evan Chengb783fa32007-07-19 01:14:50 +000031class ADI<dag outs, dag ins, string opc, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000032 : AI<0x0, outs, ins, VFPFrm, opc, asm, pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000033 // TODO: Mark the instructions with the appropriate subtarget info.
34}
35
Evan Chengb783fa32007-07-19 01:14:50 +000036class ADI5<dag outs, dag ins, string opc, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000037 : I<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
38 VFPFrm, opc, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000039 // TODO: Mark the instructions with the appropriate subtarget info.
40}
41
42// Special cases.
Evan Chengb783fa32007-07-19 01:14:50 +000043class AXSI<dag outs, dag ins, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000044 : XI<0x0, outs, ins, AddrModeNone, Size4Bytes, IndexModeNone,
45 VFPFrm, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046 // TODO: Mark the instructions with the appropriate subtarget info.
47}
48
Evan Chengb783fa32007-07-19 01:14:50 +000049class AXSI5<dag outs, dag ins, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000050 : XI<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
51 VFPFrm, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000052 // TODO: Mark the instructions with the appropriate subtarget info.
53}
54
Evan Chengb783fa32007-07-19 01:14:50 +000055class AXDI<dag outs, dag ins, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000056 : XI<0x0, outs, ins, AddrModeNone, Size4Bytes, IndexModeNone,
57 VFPFrm, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058 // TODO: Mark the instructions with the appropriate subtarget info.
59}
60
Evan Chengb783fa32007-07-19 01:14:50 +000061class AXDI5<dag outs, dag ins, string asm, list<dag> pattern>
Evan Chenga7b3e7c2007-08-07 01:37:15 +000062 : XI<0x0, outs, ins, AddrMode5, Size4Bytes, IndexModeNone,
63 VFPFrm, asm, "", pattern> {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000064 // TODO: Mark the instructions with the appropriate subtarget info.
65}
66
67
68def SDT_FTOI :
69SDTypeProfile<1, 1, [SDTCisVT<0, f32>, SDTCisFP<1>]>;
70def SDT_ITOF :
71SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisVT<1, f32>]>;
72def SDT_CMPFP0 :
73SDTypeProfile<0, 1, [SDTCisFP<0>]>;
74def SDT_FMDRR :
75SDTypeProfile<1, 2, [SDTCisVT<0, f64>, SDTCisVT<1, i32>,
76 SDTCisSameAs<1, 2>]>;
77
78def arm_ftoui : SDNode<"ARMISD::FTOUI", SDT_FTOI>;
79def arm_ftosi : SDNode<"ARMISD::FTOSI", SDT_FTOI>;
80def arm_sitof : SDNode<"ARMISD::SITOF", SDT_ITOF>;
81def arm_uitof : SDNode<"ARMISD::UITOF", SDT_ITOF>;
Chris Lattner3d254552008-01-15 22:02:54 +000082def arm_fmstat : SDNode<"ARMISD::FMSTAT", SDTNone, [SDNPInFlag,SDNPOutFlag]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000083def arm_cmpfp : SDNode<"ARMISD::CMPFP", SDT_ARMCmp, [SDNPOutFlag]>;
84def arm_cmpfp0 : SDNode<"ARMISD::CMPFPw0", SDT_CMPFP0, [SDNPOutFlag]>;
85def arm_fmdrr : SDNode<"ARMISD::FMDRR", SDT_FMDRR>;
86
87//===----------------------------------------------------------------------===//
88// Load / store Instructions.
89//
90
Chris Lattner1a1932c2008-01-06 23:38:27 +000091let isSimpleLoad = 1 in {
Evan Chengb783fa32007-07-19 01:14:50 +000092def FLDD : ADI5<(outs DPR:$dst), (ins addrmode5:$addr),
Dan Gohmanf17a25c2007-07-18 16:29:46 +000093 "fldd", " $dst, $addr",
94 [(set DPR:$dst, (load addrmode5:$addr))]>;
95
Evan Chengb783fa32007-07-19 01:14:50 +000096def FLDS : ASI5<(outs SPR:$dst), (ins addrmode5:$addr),
Dan Gohmanf17a25c2007-07-18 16:29:46 +000097 "flds", " $dst, $addr",
98 [(set SPR:$dst, (load addrmode5:$addr))]>;
Chris Lattner1a1932c2008-01-06 23:38:27 +000099} // isSimpleLoad
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000100
Evan Chengb783fa32007-07-19 01:14:50 +0000101def FSTD : ADI5<(outs), (ins DPR:$src, addrmode5:$addr),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000102 "fstd", " $src, $addr",
103 [(store DPR:$src, addrmode5:$addr)]>;
104
Evan Chengb783fa32007-07-19 01:14:50 +0000105def FSTS : ASI5<(outs), (ins SPR:$src, addrmode5:$addr),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000106 "fsts", " $src, $addr",
107 [(store SPR:$src, addrmode5:$addr)]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000108
109//===----------------------------------------------------------------------===//
110// Load / store multiple Instructions.
111//
112
Chris Lattnerca4e0fe2008-01-10 05:12:37 +0000113let mayLoad = 1 in {
Evan Chengb783fa32007-07-19 01:14:50 +0000114def FLDMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$dst1,
115 variable_ops),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000116 "fldm${addr:submode}d${p} ${addr:base}, $dst1",
117 []>;
118
Evan Chengb783fa32007-07-19 01:14:50 +0000119def FLDMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$dst1,
120 variable_ops),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000121 "fldm${addr:submode}s${p} ${addr:base}, $dst1",
122 []>;
Chris Lattnerca4e0fe2008-01-10 05:12:37 +0000123}
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000124
Chris Lattner6887b142008-01-06 08:36:04 +0000125let mayStore = 1 in {
Evan Chengb783fa32007-07-19 01:14:50 +0000126def FSTMD : AXDI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$src1,
127 variable_ops),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000128 "fstm${addr:submode}d${p} ${addr:base}, $src1",
129 []>;
130
Evan Chengb783fa32007-07-19 01:14:50 +0000131def FSTMS : AXSI5<(outs), (ins addrmode5:$addr, pred:$p, reglist:$src1,
132 variable_ops),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000133 "fstm${addr:submode}s${p} ${addr:base}, $src1",
134 []>;
Chris Lattner6887b142008-01-06 08:36:04 +0000135} // mayStore
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000136
137// FLDMX, FSTMX - mixing S/D registers for pre-armv6 cores
138
139//===----------------------------------------------------------------------===//
140// FP Binary Operations.
141//
142
Evan Chengb783fa32007-07-19 01:14:50 +0000143def FADDD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000144 "faddd", " $dst, $a, $b",
145 [(set DPR:$dst, (fadd DPR:$a, DPR:$b))]>;
146
Evan Chengb783fa32007-07-19 01:14:50 +0000147def FADDS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000148 "fadds", " $dst, $a, $b",
149 [(set SPR:$dst, (fadd SPR:$a, SPR:$b))]>;
150
Evan Chengb783fa32007-07-19 01:14:50 +0000151def FCMPED : ADI<(outs), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000152 "fcmped", " $a, $b",
153 [(arm_cmpfp DPR:$a, DPR:$b)]>;
154
Evan Chengb783fa32007-07-19 01:14:50 +0000155def FCMPES : ASI<(outs), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000156 "fcmpes", " $a, $b",
157 [(arm_cmpfp SPR:$a, SPR:$b)]>;
158
Evan Chengb783fa32007-07-19 01:14:50 +0000159def FDIVD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000160 "fdivd", " $dst, $a, $b",
161 [(set DPR:$dst, (fdiv DPR:$a, DPR:$b))]>;
162
Evan Chengb783fa32007-07-19 01:14:50 +0000163def FDIVS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000164 "fdivs", " $dst, $a, $b",
165 [(set SPR:$dst, (fdiv SPR:$a, SPR:$b))]>;
166
Evan Chengb783fa32007-07-19 01:14:50 +0000167def FMULD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000168 "fmuld", " $dst, $a, $b",
169 [(set DPR:$dst, (fmul DPR:$a, DPR:$b))]>;
170
Evan Chengb783fa32007-07-19 01:14:50 +0000171def FMULS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000172 "fmuls", " $dst, $a, $b",
173 [(set SPR:$dst, (fmul SPR:$a, SPR:$b))]>;
174
Evan Chengb783fa32007-07-19 01:14:50 +0000175def FNMULD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000176 "fnmuld", " $dst, $a, $b",
177 [(set DPR:$dst, (fneg (fmul DPR:$a, DPR:$b)))]>;
178
Evan Chengb783fa32007-07-19 01:14:50 +0000179def FNMULS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000180 "fnmuls", " $dst, $a, $b",
181 [(set SPR:$dst, (fneg (fmul SPR:$a, SPR:$b)))]>;
182
183// Match reassociated forms only if not sign dependent rounding.
184def : Pat<(fmul (fneg DPR:$a), DPR:$b),
185 (FNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
186def : Pat<(fmul (fneg SPR:$a), SPR:$b),
187 (FNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>;
188
189
Evan Chengb783fa32007-07-19 01:14:50 +0000190def FSUBD : ADI<(outs DPR:$dst), (ins DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000191 "fsubd", " $dst, $a, $b",
192 [(set DPR:$dst, (fsub DPR:$a, DPR:$b))]>;
193
Evan Chengb783fa32007-07-19 01:14:50 +0000194def FSUBS : ASI<(outs SPR:$dst), (ins SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000195 "fsubs", " $dst, $a, $b",
196 [(set SPR:$dst, (fsub SPR:$a, SPR:$b))]>;
197
198//===----------------------------------------------------------------------===//
199// FP Unary Operations.
200//
201
Evan Chengb783fa32007-07-19 01:14:50 +0000202def FABSD : ADI<(outs DPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000203 "fabsd", " $dst, $a",
204 [(set DPR:$dst, (fabs DPR:$a))]>;
205
Evan Chengb783fa32007-07-19 01:14:50 +0000206def FABSS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000207 "fabss", " $dst, $a",
208 [(set SPR:$dst, (fabs SPR:$a))]>;
209
Evan Chengb783fa32007-07-19 01:14:50 +0000210def FCMPEZD : ADI<(outs), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000211 "fcmpezd", " $a",
212 [(arm_cmpfp0 DPR:$a)]>;
213
Evan Chengb783fa32007-07-19 01:14:50 +0000214def FCMPEZS : ASI<(outs), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000215 "fcmpezs", " $a",
216 [(arm_cmpfp0 SPR:$a)]>;
217
Evan Chengb783fa32007-07-19 01:14:50 +0000218def FCVTDS : ADI<(outs DPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000219 "fcvtds", " $dst, $a",
220 [(set DPR:$dst, (fextend SPR:$a))]>;
221
Evan Chengb783fa32007-07-19 01:14:50 +0000222def FCVTSD : ADI<(outs SPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000223 "fcvtsd", " $dst, $a",
224 [(set SPR:$dst, (fround DPR:$a))]>;
225
Evan Chengb783fa32007-07-19 01:14:50 +0000226def FCPYD : ADI<(outs DPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000227 "fcpyd", " $dst, $a", []>;
228
Evan Chengb783fa32007-07-19 01:14:50 +0000229def FCPYS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000230 "fcpys", " $dst, $a", []>;
231
Evan Chengb783fa32007-07-19 01:14:50 +0000232def FNEGD : ADI<(outs DPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000233 "fnegd", " $dst, $a",
234 [(set DPR:$dst, (fneg DPR:$a))]>;
235
Evan Chengb783fa32007-07-19 01:14:50 +0000236def FNEGS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000237 "fnegs", " $dst, $a",
238 [(set SPR:$dst, (fneg SPR:$a))]>;
239
Evan Chengb783fa32007-07-19 01:14:50 +0000240def FSQRTD : ADI<(outs DPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000241 "fsqrtd", " $dst, $a",
242 [(set DPR:$dst, (fsqrt DPR:$a))]>;
243
Evan Chengb783fa32007-07-19 01:14:50 +0000244def FSQRTS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000245 "fsqrts", " $dst, $a",
246 [(set SPR:$dst, (fsqrt SPR:$a))]>;
247
248//===----------------------------------------------------------------------===//
249// FP <-> GPR Copies. Int <-> FP Conversions.
250//
251
Evan Chengb783fa32007-07-19 01:14:50 +0000252def FMRS : ASI<(outs GPR:$dst), (ins SPR:$src),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000253 "fmrs", " $dst, $src",
254 [(set GPR:$dst, (bitconvert SPR:$src))]>;
255
Evan Chengb783fa32007-07-19 01:14:50 +0000256def FMSR : ASI<(outs SPR:$dst), (ins GPR:$src),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000257 "fmsr", " $dst, $src",
258 [(set SPR:$dst, (bitconvert GPR:$src))]>;
259
260
Evan Chengb783fa32007-07-19 01:14:50 +0000261def FMRRD : ADI<(outs GPR:$dst1, GPR:$dst2), (ins DPR:$src),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000262 "fmrrd", " $dst1, $dst2, $src",
263 [/* FIXME: Can't write pattern for multiple result instr*/]>;
264
265// FMDHR: GPR -> SPR
266// FMDLR: GPR -> SPR
267
Evan Chengb783fa32007-07-19 01:14:50 +0000268def FMDRR : ADI<(outs DPR:$dst), (ins GPR:$src1, GPR:$src2),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000269 "fmdrr", " $dst, $src1, $src2",
270 [(set DPR:$dst, (arm_fmdrr GPR:$src1, GPR:$src2))]>;
271
272// FMRDH: SPR -> GPR
273// FMRDL: SPR -> GPR
274// FMRRS: SPR -> GPR
275// FMRX : SPR system reg -> GPR
276
277// FMSRR: GPR -> SPR
278
Evan Cheng6e4d1d92007-09-11 19:55:27 +0000279let Defs = [CPSR] in
280def FMSTAT : ASI<(outs), (ins), "fmstat", "", [(arm_fmstat)]>;
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000281
282// FMXR: GPR -> VFP Sstem reg
283
284
285// Int to FP:
286
Evan Chengb783fa32007-07-19 01:14:50 +0000287def FSITOD : ADI<(outs DPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000288 "fsitod", " $dst, $a",
289 [(set DPR:$dst, (arm_sitof SPR:$a))]>;
290
Evan Chengb783fa32007-07-19 01:14:50 +0000291def FSITOS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000292 "fsitos", " $dst, $a",
293 [(set SPR:$dst, (arm_sitof SPR:$a))]>;
294
Evan Chengb783fa32007-07-19 01:14:50 +0000295def FUITOD : ADI<(outs DPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000296 "fuitod", " $dst, $a",
297 [(set DPR:$dst, (arm_uitof SPR:$a))]>;
298
Evan Chengb783fa32007-07-19 01:14:50 +0000299def FUITOS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000300 "fuitos", " $dst, $a",
301 [(set SPR:$dst, (arm_uitof SPR:$a))]>;
302
303// FP to Int:
304// Always set Z bit in the instruction, i.e. "round towards zero" variants.
305
Evan Chengb783fa32007-07-19 01:14:50 +0000306def FTOSIZD : ADI<(outs SPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000307 "ftosizd", " $dst, $a",
308 [(set SPR:$dst, (arm_ftosi DPR:$a))]>;
309
Evan Chengb783fa32007-07-19 01:14:50 +0000310def FTOSIZS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000311 "ftosizs", " $dst, $a",
312 [(set SPR:$dst, (arm_ftosi SPR:$a))]>;
313
Evan Chengb783fa32007-07-19 01:14:50 +0000314def FTOUIZD : ADI<(outs SPR:$dst), (ins DPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000315 "ftouizd", " $dst, $a",
316 [(set SPR:$dst, (arm_ftoui DPR:$a))]>;
317
Evan Chengb783fa32007-07-19 01:14:50 +0000318def FTOUIZS : ASI<(outs SPR:$dst), (ins SPR:$a),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000319 "ftouizs", " $dst, $a",
320 [(set SPR:$dst, (arm_ftoui SPR:$a))]>;
321
322//===----------------------------------------------------------------------===//
323// FP FMA Operations.
324//
325
Evan Chengb783fa32007-07-19 01:14:50 +0000326def FMACD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000327 "fmacd", " $dst, $a, $b",
328 [(set DPR:$dst, (fadd (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
329 RegConstraint<"$dstin = $dst">;
330
Evan Chengb783fa32007-07-19 01:14:50 +0000331def FMACS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000332 "fmacs", " $dst, $a, $b",
333 [(set SPR:$dst, (fadd (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
334 RegConstraint<"$dstin = $dst">;
335
Evan Chengb783fa32007-07-19 01:14:50 +0000336def FMSCD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000337 "fmscd", " $dst, $a, $b",
338 [(set DPR:$dst, (fsub (fmul DPR:$a, DPR:$b), DPR:$dstin))]>,
339 RegConstraint<"$dstin = $dst">;
340
Evan Chengb783fa32007-07-19 01:14:50 +0000341def FMSCS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000342 "fmscs", " $dst, $a, $b",
343 [(set SPR:$dst, (fsub (fmul SPR:$a, SPR:$b), SPR:$dstin))]>,
344 RegConstraint<"$dstin = $dst">;
345
Evan Chengb783fa32007-07-19 01:14:50 +0000346def FNMACD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000347 "fnmacd", " $dst, $a, $b",
348 [(set DPR:$dst, (fadd (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
349 RegConstraint<"$dstin = $dst">;
350
Evan Chengb783fa32007-07-19 01:14:50 +0000351def FNMACS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000352 "fnmacs", " $dst, $a, $b",
353 [(set SPR:$dst, (fadd (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
354 RegConstraint<"$dstin = $dst">;
355
Evan Chengb783fa32007-07-19 01:14:50 +0000356def FNMSCD : ADI<(outs DPR:$dst), (ins DPR:$dstin, DPR:$a, DPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000357 "fnmscd", " $dst, $a, $b",
358 [(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))]>,
359 RegConstraint<"$dstin = $dst">;
360
Evan Chengb783fa32007-07-19 01:14:50 +0000361def FNMSCS : ASI<(outs SPR:$dst), (ins SPR:$dstin, SPR:$a, SPR:$b),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000362 "fnmscs", " $dst, $a, $b",
363 [(set SPR:$dst, (fsub (fneg (fmul SPR:$a, SPR:$b)), SPR:$dstin))]>,
364 RegConstraint<"$dstin = $dst">;
365
366//===----------------------------------------------------------------------===//
367// FP Conditional moves.
368//
369
Evan Chengb783fa32007-07-19 01:14:50 +0000370def FCPYDcc : ADI<(outs DPR:$dst), (ins DPR:$false, DPR:$true),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000371 "fcpyd", " $dst, $true",
372 [/*(set DPR:$dst, (ARMcmov DPR:$false, DPR:$true, imm:$cc))*/]>,
373 RegConstraint<"$false = $dst">;
374
Evan Chengb783fa32007-07-19 01:14:50 +0000375def FCPYScc : ASI<(outs SPR:$dst), (ins SPR:$false, SPR:$true),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000376 "fcpys", " $dst, $true",
377 [/*(set SPR:$dst, (ARMcmov SPR:$false, SPR:$true, imm:$cc))*/]>,
378 RegConstraint<"$false = $dst">;
379
Evan Chengb783fa32007-07-19 01:14:50 +0000380def FNEGDcc : ADI<(outs DPR:$dst), (ins DPR:$false, DPR:$true),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000381 "fnegd", " $dst, $true",
382 [/*(set DPR:$dst, (ARMcneg DPR:$false, DPR:$true, imm:$cc))*/]>,
383 RegConstraint<"$false = $dst">;
384
Evan Chengb783fa32007-07-19 01:14:50 +0000385def FNEGScc : ASI<(outs SPR:$dst), (ins SPR:$false, SPR:$true),
Dan Gohmanf17a25c2007-07-18 16:29:46 +0000386 "fnegs", " $dst, $true",
387 [/*(set SPR:$dst, (ARMcneg SPR:$false, SPR:$true, imm:$cc))*/]>,
388 RegConstraint<"$false = $dst">;