1 ;; ARM VFP instruction patterns
2 ;; Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
3 ;; Written by CodeSourcery.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; GCC is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>. */
21 ;; Additional register numbers
26 ;; The VFP "type" attributes differ from those used in the FPA model.
27 ;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp.
28 ;; farith Most arithmetic insns.
29 ;; fmul Double precision multiply.
30 ;; fdivs Single precision sqrt or division.
31 ;; fdivd Double precision sqrt or division.
32 ;; f_flag fmstat operation
33 ;; f_load[sd] Floating point load from memory.
34 ;; f_store[sd] Floating point store to memory.
35 ;; f_2_r Transfer vfp to arm reg.
36 ;; r_2_f Transfer arm to vfp reg.
37 ;; f_cvt Convert floating<->integral
40 ;; ??? For now do not allow loading constants into vfp regs. This causes
41 ;; problems because small constants get converted into adds.
42 (define_insn "*arm_movsi_vfp"
43 [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m ,*t,r,*t,*t, *Uv")
44 (match_operand:SI 1 "general_operand" "rk, I,K,N,mi,rk,r,*t,*t,*Uvi,*t"))]
45 "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT
46 && ( s_register_operand (operands[0], SImode)
47 || s_register_operand (operands[1], SImode))"
49 switch (which_alternative)
52 return \"mov%?\\t%0, %1\";
54 return \"mvn%?\\t%0, #%B1\";
56 return \"movw%?\\t%0, %1\";
58 return \"ldr%?\\t%0, %1\";
60 return \"str%?\\t%1, %0\";
62 return \"fmsr%?\\t%0, %1\\t%@ int\";
64 return \"fmrs%?\\t%0, %1\\t%@ int\";
66 return \"fcpys%?\\t%0, %1\\t%@ int\";
68 return output_move_vfp (operands);
73 [(set_attr "predicable" "yes")
74 (set_attr "type" "*,*,*,*,load1,store1,r_2_f,f_2_r,ffarith,f_loads,f_stores")
75 (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*")
76 (set_attr "neg_pool_range" "*,*,*,*,4084,*,*,*,*,1008,*")]
79 (define_insn "*thumb2_movsi_vfp"
80 [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m,*t,r, *t,*t, *Uv")
81 (match_operand:SI 1 "general_operand" "rk, I,K,N,mi,rk,r,*t,*t,*Uvi,*t"))]
82 "TARGET_THUMB2 && TARGET_VFP && TARGET_HARD_FLOAT
83 && ( s_register_operand (operands[0], SImode)
84 || s_register_operand (operands[1], SImode))"
86 switch (which_alternative)
89 return \"mov%?\\t%0, %1\";
91 return \"mvn%?\\t%0, #%B1\";
93 return \"movw%?\\t%0, %1\";
95 return \"ldr%?\\t%0, %1\";
97 return \"str%?\\t%1, %0\";
99 return \"fmsr%?\\t%0, %1\\t%@ int\";
101 return \"fmrs%?\\t%0, %1\\t%@ int\";
103 return \"fcpys%?\\t%0, %1\\t%@ int\";
105 return output_move_vfp (operands);
110 [(set_attr "predicable" "yes")
111 (set_attr "type" "*,*,*,*,load1,store1,r_2_f,f_2_r,ffarith,f_load,f_store")
112 (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*")
113 (set_attr "neg_pool_range" "*,*,*,*, 0,*,*,*,*,1008,*")]
119 (define_insn "*arm_movdi_vfp"
120 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,m,w,r,w,w, Uv")
121 (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))]
122 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
123 && ( register_operand (operands[0], DImode)
124 || register_operand (operands[1], DImode))"
126 switch (which_alternative)
132 return output_move_double (operands);
134 return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\";
136 return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\";
138 return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
140 return output_move_vfp (operands);
145 [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_loadd,f_stored")
146 (set_attr "length" "8,8,8,4,4,4,4,4")
147 (set_attr "pool_range" "*,1020,*,*,*,*,1020,*")
148 (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")]
151 (define_insn "*thumb2_movdi_vfp"
152 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,m,w,r,w,w, Uv")
153 (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))]
154 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP"
156 switch (which_alternative)
158 case 0: case 1: case 2:
159 return (output_move_double (operands));
161 return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\";
163 return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\";
165 return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
167 return output_move_vfp (operands);
172 [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_load,f_store")
173 (set_attr "length" "8,8,8,4,4,4,4,4")
174 (set_attr "pool_range" "*,4096,*,*,*,*,1020,*")
175 (set_attr "neg_pool_range" "*, 0,*,*,*,*,1008,*")]
180 ;; Disparage the w<->r cases because reloading an invalid address is
181 ;; preferable to loading the value via integer registers.
183 (define_insn "*movsf_vfp"
184 [(set (match_operand:SF 0 "nonimmediate_operand" "=t,?r,t ,t ,Uv,r ,m,t,r")
185 (match_operand:SF 1 "general_operand" " ?r,t,Dv,UvE,t, mE,r,t,r"))]
186 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
187 && ( s_register_operand (operands[0], SFmode)
188 || s_register_operand (operands[1], SFmode))"
190 switch (which_alternative)
193 return \"fmsr%?\\t%0, %1\";
195 return \"fmrs%?\\t%0, %1\";
197 return \"fconsts%?\\t%0, #%G1\";
199 return output_move_vfp (operands);
201 return \"ldr%?\\t%0, %1\\t%@ float\";
203 return \"str%?\\t%1, %0\\t%@ float\";
205 return \"fcpys%?\\t%0, %1\";
207 return \"mov%?\\t%0, %1\\t%@ float\";
212 [(set_attr "predicable" "yes")
214 "r_2_f,f_2_r,farith,f_loads,f_stores,load1,store1,ffarith,*")
215 (set_attr "pool_range" "*,*,*,1020,*,4096,*,*,*")
216 (set_attr "neg_pool_range" "*,*,*,1008,*,4080,*,*,*")]
219 (define_insn "*thumb2_movsf_vfp"
220 [(set (match_operand:SF 0 "nonimmediate_operand" "=t,?r,t, t ,Uv,r ,m,t,r")
221 (match_operand:SF 1 "general_operand" " ?r,t,Dv,UvE,t, mE,r,t,r"))]
222 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP
223 && ( s_register_operand (operands[0], SFmode)
224 || s_register_operand (operands[1], SFmode))"
226 switch (which_alternative)
229 return \"fmsr%?\\t%0, %1\";
231 return \"fmrs%?\\t%0, %1\";
233 return \"fconsts%?\\t%0, #%G1\";
235 return output_move_vfp (operands);
237 return \"ldr%?\\t%0, %1\\t%@ float\";
239 return \"str%?\\t%1, %0\\t%@ float\";
241 return \"fcpys%?\\t%0, %1\";
243 return \"mov%?\\t%0, %1\\t%@ float\";
248 [(set_attr "predicable" "yes")
250 "r_2_f,f_2_r,farith,f_load,f_store,load1,store1,ffarith,*")
251 (set_attr "pool_range" "*,*,*,1020,*,4092,*,*,*")
252 (set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")]
258 (define_insn "*movdf_vfp"
259 [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,?r,w ,r, m,w ,Uv,w,r")
260 (match_operand:DF 1 "soft_df_operand" " ?r,w,Dv,mF,r,UvF,w, w,r"))]
261 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
262 && ( register_operand (operands[0], DFmode)
263 || register_operand (operands[1], DFmode))"
266 switch (which_alternative)
269 return \"fmdrr%?\\t%P0, %Q1, %R1\";
271 return \"fmrrd%?\\t%Q0, %R0, %P1\";
273 return \"fconstd%?\\t%P0, #%G1\";
275 return output_move_double (operands);
277 return output_move_vfp (operands);
279 return \"fcpyd%?\\t%P0, %P1\";
288 "r_2_f,f_2_r,farith,f_loadd,f_stored,load2,store2,ffarith,*")
289 (set_attr "length" "4,4,4,8,8,4,4,4,8")
290 (set_attr "pool_range" "*,*,*,1020,*,1020,*,*,*")
291 (set_attr "neg_pool_range" "*,*,*,1008,*,1008,*,*,*")]
294 (define_insn "*thumb2_movdf_vfp"
295 [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,?r,w ,r, m,w ,Uv,w,r")
296 (match_operand:DF 1 "soft_df_operand" " ?r,w,Dv,mF,r,UvF,w, w,r"))]
297 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP"
300 switch (which_alternative)
303 return \"fmdrr%?\\t%P0, %Q1, %R1\";
305 return \"fmrrd%?\\t%Q0, %R0, %P1\";
307 return \"fconstd%?\\t%P0, #%G1\";
308 case 3: case 4: case 8:
309 return output_move_double (operands);
311 return output_move_vfp (operands);
313 return \"fcpyd%?\\t%P0, %P1\";
320 "r_2_f,f_2_r,farith,load2,store2,f_load,f_store,ffarith,*")
321 (set_attr "length" "4,4,4,8,8,4,4,4,8")
322 (set_attr "pool_range" "*,*,*,4096,*,1020,*,*,*")
323 (set_attr "neg_pool_range" "*,*,*,0,*,1008,*,*,*")]
327 ;; Conditional move patterns
329 (define_insn "*movsfcc_vfp"
330 [(set (match_operand:SF 0 "s_register_operand" "=t,t,t,t,t,t,?r,?r,?r")
332 (match_operator 3 "arm_comparison_operator"
333 [(match_operand 4 "cc_register" "") (const_int 0)])
334 (match_operand:SF 1 "s_register_operand" "0,t,t,0,?r,?r,0,t,t")
335 (match_operand:SF 2 "s_register_operand" "t,0,t,?r,0,?r,t,0,t")))]
336 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
340 fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1
343 fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1
346 fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
347 [(set_attr "conds" "use")
348 (set_attr "length" "4,4,8,4,4,8,4,4,8")
349 (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
352 (define_insn "*thumb2_movsfcc_vfp"
353 [(set (match_operand:SF 0 "s_register_operand" "=t,t,t,t,t,t,?r,?r,?r")
355 (match_operator 3 "arm_comparison_operator"
356 [(match_operand 4 "cc_register" "") (const_int 0)])
357 (match_operand:SF 1 "s_register_operand" "0,t,t,0,?r,?r,0,t,t")
358 (match_operand:SF 2 "s_register_operand" "t,0,t,?r,0,?r,t,0,t")))]
359 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP"
361 it\\t%D3\;fcpys%D3\\t%0, %2
362 it\\t%d3\;fcpys%d3\\t%0, %1
363 ite\\t%D3\;fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1
364 it\\t%D3\;fmsr%D3\\t%0, %2
365 it\\t%d3\;fmsr%d3\\t%0, %1
366 ite\\t%D3\;fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1
367 it\\t%D3\;fmrs%D3\\t%0, %2
368 it\\t%d3\;fmrs%d3\\t%0, %1
369 ite\\t%D3\;fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
370 [(set_attr "conds" "use")
371 (set_attr "length" "6,6,10,6,6,10,6,6,10")
372 (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
375 (define_insn "*movdfcc_vfp"
376 [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
378 (match_operator 3 "arm_comparison_operator"
379 [(match_operand 4 "cc_register" "") (const_int 0)])
380 (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
381 (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
382 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
386 fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1
387 fmdrr%D3\\t%P0, %Q2, %R2
388 fmdrr%d3\\t%P0, %Q1, %R1
389 fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1
390 fmrrd%D3\\t%Q0, %R0, %P2
391 fmrrd%d3\\t%Q0, %R0, %P1
392 fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
393 [(set_attr "conds" "use")
394 (set_attr "length" "4,4,8,4,4,8,4,4,8")
395 (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
398 (define_insn "*thumb2_movdfcc_vfp"
399 [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
401 (match_operator 3 "arm_comparison_operator"
402 [(match_operand 4 "cc_register" "") (const_int 0)])
403 (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
404 (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
405 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP"
407 it\\t%D3\;fcpyd%D3\\t%P0, %P2
408 it\\t%d3\;fcpyd%d3\\t%P0, %P1
409 ite\\t%D3\;fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1
410 it\t%D3\;fmdrr%D3\\t%P0, %Q2, %R2
411 it\t%d3\;fmdrr%d3\\t%P0, %Q1, %R1
412 ite\\t%D3\;fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1
413 it\t%D3\;fmrrd%D3\\t%Q0, %R0, %P2
414 it\t%d3\;fmrrd%d3\\t%Q0, %R0, %P1
415 ite\\t%D3\;fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
416 [(set_attr "conds" "use")
417 (set_attr "length" "6,6,10,6,6,10,6,6,10")
418 (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
422 ;; Sign manipulation functions
424 (define_insn "*abssf2_vfp"
425 [(set (match_operand:SF 0 "s_register_operand" "=t")
426 (abs:SF (match_operand:SF 1 "s_register_operand" "t")))]
427 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
429 [(set_attr "predicable" "yes")
430 (set_attr "type" "ffarith")]
433 (define_insn "*absdf2_vfp"
434 [(set (match_operand:DF 0 "s_register_operand" "=w")
435 (abs:DF (match_operand:DF 1 "s_register_operand" "w")))]
436 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
438 [(set_attr "predicable" "yes")
439 (set_attr "type" "ffarith")]
442 (define_insn "*negsf2_vfp"
443 [(set (match_operand:SF 0 "s_register_operand" "=t,?r")
444 (neg:SF (match_operand:SF 1 "s_register_operand" "t,r")))]
445 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
448 eor%?\\t%0, %1, #-2147483648"
449 [(set_attr "predicable" "yes")
450 (set_attr "type" "ffarith")]
453 (define_insn_and_split "*negdf2_vfp"
454 [(set (match_operand:DF 0 "s_register_operand" "=w,?r,?r")
455 (neg:DF (match_operand:DF 1 "s_register_operand" "w,0,r")))]
456 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
461 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP && reload_completed
462 && arm_general_register_operand (operands[0], DFmode)"
463 [(set (match_dup 0) (match_dup 1))]
465 if (REGNO (operands[0]) == REGNO (operands[1]))
467 operands[0] = gen_highpart (SImode, operands[0]);
468 operands[1] = gen_rtx_XOR (SImode, operands[0], GEN_INT (0x80000000));
472 rtx in_hi, in_lo, out_hi, out_lo;
474 in_hi = gen_rtx_XOR (SImode, gen_highpart (SImode, operands[1]),
475 GEN_INT (0x80000000));
476 in_lo = gen_lowpart (SImode, operands[1]);
477 out_hi = gen_highpart (SImode, operands[0]);
478 out_lo = gen_lowpart (SImode, operands[0]);
480 if (REGNO (in_lo) == REGNO (out_hi))
482 emit_insn (gen_rtx_SET (SImode, out_lo, in_lo));
483 operands[0] = out_hi;
488 emit_insn (gen_rtx_SET (SImode, out_hi, in_hi));
489 operands[0] = out_lo;
494 [(set_attr "predicable" "yes")
495 (set_attr "length" "4,4,8")
496 (set_attr "type" "ffarith")]
502 (define_insn "*addsf3_vfp"
503 [(set (match_operand:SF 0 "s_register_operand" "=t")
504 (plus:SF (match_operand:SF 1 "s_register_operand" "t")
505 (match_operand:SF 2 "s_register_operand" "t")))]
506 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
507 "fadds%?\\t%0, %1, %2"
508 [(set_attr "predicable" "yes")
509 (set_attr "type" "farith")]
512 (define_insn "*adddf3_vfp"
513 [(set (match_operand:DF 0 "s_register_operand" "=w")
514 (plus:DF (match_operand:DF 1 "s_register_operand" "w")
515 (match_operand:DF 2 "s_register_operand" "w")))]
516 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
517 "faddd%?\\t%P0, %P1, %P2"
518 [(set_attr "predicable" "yes")
519 (set_attr "type" "farith")]
523 (define_insn "*subsf3_vfp"
524 [(set (match_operand:SF 0 "s_register_operand" "=t")
525 (minus:SF (match_operand:SF 1 "s_register_operand" "t")
526 (match_operand:SF 2 "s_register_operand" "t")))]
527 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
528 "fsubs%?\\t%0, %1, %2"
529 [(set_attr "predicable" "yes")
530 (set_attr "type" "farith")]
533 (define_insn "*subdf3_vfp"
534 [(set (match_operand:DF 0 "s_register_operand" "=w")
535 (minus:DF (match_operand:DF 1 "s_register_operand" "w")
536 (match_operand:DF 2 "s_register_operand" "w")))]
537 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
538 "fsubd%?\\t%P0, %P1, %P2"
539 [(set_attr "predicable" "yes")
540 (set_attr "type" "farith")]
546 (define_insn "*divsf3_vfp"
547 [(set (match_operand:SF 0 "s_register_operand" "+t")
548 (div:SF (match_operand:SF 1 "s_register_operand" "t")
549 (match_operand:SF 2 "s_register_operand" "t")))]
550 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
551 "fdivs%?\\t%0, %1, %2"
552 [(set_attr "predicable" "yes")
553 (set_attr "type" "fdivs")]
556 (define_insn "*divdf3_vfp"
557 [(set (match_operand:DF 0 "s_register_operand" "+w")
558 (div:DF (match_operand:DF 1 "s_register_operand" "w")
559 (match_operand:DF 2 "s_register_operand" "w")))]
560 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
561 "fdivd%?\\t%P0, %P1, %P2"
562 [(set_attr "predicable" "yes")
563 (set_attr "type" "fdivd")]
567 ;; Multiplication insns
569 (define_insn "*mulsf3_vfp"
570 [(set (match_operand:SF 0 "s_register_operand" "+t")
571 (mult:SF (match_operand:SF 1 "s_register_operand" "t")
572 (match_operand:SF 2 "s_register_operand" "t")))]
573 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
574 "fmuls%?\\t%0, %1, %2"
575 [(set_attr "predicable" "yes")
576 (set_attr "type" "farith")]
579 (define_insn "*muldf3_vfp"
580 [(set (match_operand:DF 0 "s_register_operand" "+w")
581 (mult:DF (match_operand:DF 1 "s_register_operand" "w")
582 (match_operand:DF 2 "s_register_operand" "w")))]
583 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
584 "fmuld%?\\t%P0, %P1, %P2"
585 [(set_attr "predicable" "yes")
586 (set_attr "type" "fmul")]
590 (define_insn "*mulsf3negsf_vfp"
591 [(set (match_operand:SF 0 "s_register_operand" "+t")
592 (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "t"))
593 (match_operand:SF 2 "s_register_operand" "t")))]
594 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
595 "fnmuls%?\\t%0, %1, %2"
596 [(set_attr "predicable" "yes")
597 (set_attr "type" "farith")]
600 (define_insn "*muldf3negdf_vfp"
601 [(set (match_operand:DF 0 "s_register_operand" "+w")
602 (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w"))
603 (match_operand:DF 2 "s_register_operand" "w")))]
604 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
605 "fnmuld%?\\t%P0, %P1, %P2"
606 [(set_attr "predicable" "yes")
607 (set_attr "type" "fmul")]
611 ;; Multiply-accumulate insns
614 (define_insn "*mulsf3addsf_vfp"
615 [(set (match_operand:SF 0 "s_register_operand" "=t")
616 (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
617 (match_operand:SF 3 "s_register_operand" "t"))
618 (match_operand:SF 1 "s_register_operand" "0")))]
619 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
620 "fmacs%?\\t%0, %2, %3"
621 [(set_attr "predicable" "yes")
622 (set_attr "type" "farith")]
625 (define_insn "*muldf3adddf_vfp"
626 [(set (match_operand:DF 0 "s_register_operand" "=w")
627 (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
628 (match_operand:DF 3 "s_register_operand" "w"))
629 (match_operand:DF 1 "s_register_operand" "0")))]
630 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
631 "fmacd%?\\t%P0, %P2, %P3"
632 [(set_attr "predicable" "yes")
633 (set_attr "type" "fmul")]
637 (define_insn "*mulsf3subsf_vfp"
638 [(set (match_operand:SF 0 "s_register_operand" "=t")
639 (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
640 (match_operand:SF 3 "s_register_operand" "t"))
641 (match_operand:SF 1 "s_register_operand" "0")))]
642 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
643 "fmscs%?\\t%0, %2, %3"
644 [(set_attr "predicable" "yes")
645 (set_attr "type" "farith")]
648 (define_insn "*muldf3subdf_vfp"
649 [(set (match_operand:DF 0 "s_register_operand" "=w")
650 (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
651 (match_operand:DF 3 "s_register_operand" "w"))
652 (match_operand:DF 1 "s_register_operand" "0")))]
653 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
654 "fmscd%?\\t%P0, %P2, %P3"
655 [(set_attr "predicable" "yes")
656 (set_attr "type" "fmul")]
660 (define_insn "*mulsf3negsfaddsf_vfp"
661 [(set (match_operand:SF 0 "s_register_operand" "=t")
662 (minus:SF (match_operand:SF 1 "s_register_operand" "0")
663 (mult:SF (match_operand:SF 2 "s_register_operand" "t")
664 (match_operand:SF 3 "s_register_operand" "t"))))]
665 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
666 "fnmacs%?\\t%0, %2, %3"
667 [(set_attr "predicable" "yes")
668 (set_attr "type" "farith")]
671 (define_insn "*fmuldf3negdfadddf_vfp"
672 [(set (match_operand:DF 0 "s_register_operand" "=w")
673 (minus:DF (match_operand:DF 1 "s_register_operand" "0")
674 (mult:DF (match_operand:DF 2 "s_register_operand" "w")
675 (match_operand:DF 3 "s_register_operand" "w"))))]
676 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
677 "fnmacd%?\\t%P0, %P2, %P3"
678 [(set_attr "predicable" "yes")
679 (set_attr "type" "fmul")]
684 (define_insn "*mulsf3negsfsubsf_vfp"
685 [(set (match_operand:SF 0 "s_register_operand" "=t")
687 (neg:SF (match_operand:SF 2 "s_register_operand" "t"))
688 (match_operand:SF 3 "s_register_operand" "t"))
689 (match_operand:SF 1 "s_register_operand" "0")))]
690 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
691 "fnmscs%?\\t%0, %2, %3"
692 [(set_attr "predicable" "yes")
693 (set_attr "type" "farith")]
696 (define_insn "*muldf3negdfsubdf_vfp"
697 [(set (match_operand:DF 0 "s_register_operand" "=w")
699 (neg:DF (match_operand:DF 2 "s_register_operand" "w"))
700 (match_operand:DF 3 "s_register_operand" "w"))
701 (match_operand:DF 1 "s_register_operand" "0")))]
702 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
703 "fnmscd%?\\t%P0, %P2, %P3"
704 [(set_attr "predicable" "yes")
705 (set_attr "type" "fmul")]
709 ;; Conversion routines
711 (define_insn "*extendsfdf2_vfp"
712 [(set (match_operand:DF 0 "s_register_operand" "=w")
713 (float_extend:DF (match_operand:SF 1 "s_register_operand" "t")))]
714 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
716 [(set_attr "predicable" "yes")
717 (set_attr "type" "f_cvt")]
720 (define_insn "*truncdfsf2_vfp"
721 [(set (match_operand:SF 0 "s_register_operand" "=t")
722 (float_truncate:SF (match_operand:DF 1 "s_register_operand" "w")))]
723 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
725 [(set_attr "predicable" "yes")
726 (set_attr "type" "f_cvt")]
729 (define_insn "*truncsisf2_vfp"
730 [(set (match_operand:SI 0 "s_register_operand" "=t")
731 (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "t"))))]
732 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
734 [(set_attr "predicable" "yes")
735 (set_attr "type" "f_cvt")]
738 (define_insn "*truncsidf2_vfp"
739 [(set (match_operand:SI 0 "s_register_operand" "=t")
740 (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))]
741 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
742 "ftosizd%?\\t%0, %P1"
743 [(set_attr "predicable" "yes")
744 (set_attr "type" "f_cvt")]
748 (define_insn "fixuns_truncsfsi2"
749 [(set (match_operand:SI 0 "s_register_operand" "=t")
750 (unsigned_fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "t"))))]
751 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
753 [(set_attr "predicable" "yes")
754 (set_attr "type" "f_cvt")]
757 (define_insn "fixuns_truncdfsi2"
758 [(set (match_operand:SI 0 "s_register_operand" "=t")
759 (unsigned_fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "t"))))]
760 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
761 "ftouizd%?\\t%0, %P1"
762 [(set_attr "predicable" "yes")
763 (set_attr "type" "f_cvt")]
767 (define_insn "*floatsisf2_vfp"
768 [(set (match_operand:SF 0 "s_register_operand" "=t")
769 (float:SF (match_operand:SI 1 "s_register_operand" "t")))]
770 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
772 [(set_attr "predicable" "yes")
773 (set_attr "type" "f_cvt")]
776 (define_insn "*floatsidf2_vfp"
777 [(set (match_operand:DF 0 "s_register_operand" "=w")
778 (float:DF (match_operand:SI 1 "s_register_operand" "t")))]
779 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
781 [(set_attr "predicable" "yes")
782 (set_attr "type" "f_cvt")]
786 (define_insn "floatunssisf2"
787 [(set (match_operand:SF 0 "s_register_operand" "=t")
788 (unsigned_float:SF (match_operand:SI 1 "s_register_operand" "t")))]
789 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
791 [(set_attr "predicable" "yes")
792 (set_attr "type" "f_cvt")]
795 (define_insn "floatunssidf2"
796 [(set (match_operand:DF 0 "s_register_operand" "=w")
797 (unsigned_float:DF (match_operand:SI 1 "s_register_operand" "t")))]
798 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
800 [(set_attr "predicable" "yes")
801 (set_attr "type" "f_cvt")]
807 (define_insn "*sqrtsf2_vfp"
808 [(set (match_operand:SF 0 "s_register_operand" "=t")
809 (sqrt:SF (match_operand:SF 1 "s_register_operand" "t")))]
810 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
812 [(set_attr "predicable" "yes")
813 (set_attr "type" "fdivs")]
816 (define_insn "*sqrtdf2_vfp"
817 [(set (match_operand:DF 0 "s_register_operand" "=w")
818 (sqrt:DF (match_operand:DF 1 "s_register_operand" "w")))]
819 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
820 "fsqrtd%?\\t%P0, %P1"
821 [(set_attr "predicable" "yes")
822 (set_attr "type" "fdivd")]
826 ;; Patterns to split/copy vfp condition flags.
828 (define_insn "*movcc_vfp"
829 [(set (reg CC_REGNUM)
831 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
833 [(set_attr "conds" "set")
834 (set_attr "type" "f_flag")]
837 (define_insn_and_split "*cmpsf_split_vfp"
838 [(set (reg:CCFP CC_REGNUM)
839 (compare:CCFP (match_operand:SF 0 "s_register_operand" "t")
840 (match_operand:SF 1 "vfp_compare_operand" "tG")))]
841 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
843 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
844 [(set (reg:CCFP VFPCC_REGNUM)
845 (compare:CCFP (match_dup 0)
847 (set (reg:CCFP CC_REGNUM)
848 (reg:CCFP VFPCC_REGNUM))]
852 (define_insn_and_split "*cmpsf_trap_split_vfp"
853 [(set (reg:CCFPE CC_REGNUM)
854 (compare:CCFPE (match_operand:SF 0 "s_register_operand" "t")
855 (match_operand:SF 1 "vfp_compare_operand" "tG")))]
856 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
858 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
859 [(set (reg:CCFPE VFPCC_REGNUM)
860 (compare:CCFPE (match_dup 0)
862 (set (reg:CCFPE CC_REGNUM)
863 (reg:CCFPE VFPCC_REGNUM))]
867 (define_insn_and_split "*cmpdf_split_vfp"
868 [(set (reg:CCFP CC_REGNUM)
869 (compare:CCFP (match_operand:DF 0 "s_register_operand" "w")
870 (match_operand:DF 1 "vfp_compare_operand" "wG")))]
871 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
873 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
874 [(set (reg:CCFP VFPCC_REGNUM)
875 (compare:CCFP (match_dup 0)
877 (set (reg:CCFP CC_REGNUM)
878 (reg:CCFPE VFPCC_REGNUM))]
882 (define_insn_and_split "*cmpdf_trap_split_vfp"
883 [(set (reg:CCFPE CC_REGNUM)
884 (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w")
885 (match_operand:DF 1 "vfp_compare_operand" "wG")))]
886 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
888 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
889 [(set (reg:CCFPE VFPCC_REGNUM)
890 (compare:CCFPE (match_dup 0)
892 (set (reg:CCFPE CC_REGNUM)
893 (reg:CCFPE VFPCC_REGNUM))]
898 ;; Comparison patterns
900 (define_insn "*cmpsf_vfp"
901 [(set (reg:CCFP VFPCC_REGNUM)
902 (compare:CCFP (match_operand:SF 0 "s_register_operand" "t,t")
903 (match_operand:SF 1 "vfp_compare_operand" "t,G")))]
904 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
908 [(set_attr "predicable" "yes")
909 (set_attr "type" "ffarith")]
912 (define_insn "*cmpsf_trap_vfp"
913 [(set (reg:CCFPE VFPCC_REGNUM)
914 (compare:CCFPE (match_operand:SF 0 "s_register_operand" "t,t")
915 (match_operand:SF 1 "vfp_compare_operand" "t,G")))]
916 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
920 [(set_attr "predicable" "yes")
921 (set_attr "type" "ffarith")]
924 (define_insn "*cmpdf_vfp"
925 [(set (reg:CCFP VFPCC_REGNUM)
926 (compare:CCFP (match_operand:DF 0 "s_register_operand" "w,w")
927 (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
928 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
932 [(set_attr "predicable" "yes")
933 (set_attr "type" "ffarith")]
936 (define_insn "*cmpdf_trap_vfp"
937 [(set (reg:CCFPE VFPCC_REGNUM)
938 (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w,w")
939 (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
940 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
944 [(set_attr "predicable" "yes")
945 (set_attr "type" "ffarith")]
949 ;; Store multiple insn used in function prologue.
951 (define_insn "*push_multi_vfp"
952 [(match_parallel 2 "multi_register_push"
953 [(set (match_operand:BLK 0 "memory_operand" "=m")
954 (unspec:BLK [(match_operand:DF 1 "s_register_operand" "w")]
955 UNSPEC_PUSH_MULT))])]
956 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
957 "* return vfp_output_fstmd (operands);"
958 [(set_attr "type" "f_stored")]
962 ;; Unimplemented insns:
965 ;; fmdhr et al (VFPv1)
966 ;; Support for xD (single precision only) variants.