1 ;; ARM VFP instruction patterns
2 ;; Copyright (C) 2003-2013 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/>. */
22 ;; ??? For now do not allow loading constants into vfp regs. This causes
23 ;; problems because small constants get converted into adds.
24 (define_insn "*arm_movsi_vfp"
25 [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk,m ,*t,r,*t,*t, *Uv")
26 (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,rk,r,*t,*t,*Uvi,*t"))]
27 "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT
28 && ( s_register_operand (operands[0], SImode)
29 || s_register_operand (operands[1], SImode))"
31 switch (which_alternative)
34 return \"mov%?\\t%0, %1\";
36 return \"mvn%?\\t%0, #%B1\";
38 return \"movw%?\\t%0, %1\";
40 return \"ldr%?\\t%0, %1\";
42 return \"str%?\\t%1, %0\";
44 return \"fmsr%?\\t%0, %1\\t%@ int\";
46 return \"fmrs%?\\t%0, %1\\t%@ int\";
48 return \"fcpys%?\\t%0, %1\\t%@ int\";
50 return output_move_vfp (operands);
55 [(set_attr "predicable" "yes")
56 (set_attr "type" "*,*,simple_alu_imm,simple_alu_imm,load1,store1,r_2_f,f_2_r,fcpys,f_loads,f_stores")
57 (set_attr "neon_type" "*,*,*,*,*,*,neon_mcr,neon_mrc,neon_vmov,*,*")
58 (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*")
59 (set_attr "pool_range" "*,*,*,*,4096,*,*,*,*,1020,*")
60 (set_attr "neg_pool_range" "*,*,*,*,4084,*,*,*,*,1008,*")]
63 ;; See thumb2.md:thumb2_movsi_insn for an explanation of the split
64 ;; high/low register alternatives for loads and stores here.
65 (define_insn "*thumb2_movsi_vfp"
66 [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r, l,*hk,m, *m,*t, r,*t,*t, *Uv")
67 (match_operand:SI 1 "general_operand" "rk, I,K,j,mi,*mi,l,*hk, r,*t,*t,*Uvi,*t"))]
68 "TARGET_THUMB2 && TARGET_VFP && TARGET_HARD_FLOAT
69 && ( s_register_operand (operands[0], SImode)
70 || s_register_operand (operands[1], SImode))"
72 switch (which_alternative)
75 return \"mov%?\\t%0, %1\";
77 return \"mvn%?\\t%0, #%B1\";
79 return \"movw%?\\t%0, %1\";
82 return \"ldr%?\\t%0, %1\";
85 return \"str%?\\t%1, %0\";
87 return \"fmsr%?\\t%0, %1\\t%@ int\";
89 return \"fmrs%?\\t%0, %1\\t%@ int\";
91 return \"fcpys%?\\t%0, %1\\t%@ int\";
93 return output_move_vfp (operands);
98 [(set_attr "predicable" "yes")
99 (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_loads,f_stores")
100 (set_attr "neon_type" "*,*,*,*,*,*,*,*,neon_mcr,neon_mrc,neon_vmov,*,*")
101 (set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*,*,*")
102 (set_attr "pool_range" "*,*,*,*,1018,4094,*,*,*,*,*,1018,*")
103 (set_attr "neg_pool_range" "*,*,*,*, 0, 0,*,*,*,*,*,1008,*")]
109 (define_insn "*movdi_vfp"
110 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,q,q,m,w,r,w,w, Uv")
111 (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,q,r,w,w,Uvi,w"))]
112 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP && arm_tune != cortexa8
113 && ( register_operand (operands[0], DImode)
114 || register_operand (operands[1], DImode))
115 && !(TARGET_NEON && CONST_INT_P (operands[1])
116 && neon_immediate_valid_for_move (operands[1], DImode, NULL, NULL))"
118 switch (which_alternative)
128 return output_move_double (operands, true, NULL);
130 return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\";
132 return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\";
134 if (TARGET_VFP_SINGLE)
135 return \"fcpys%?\\t%0, %1\\t%@ int\;fcpys%?\\t%p0, %p1\\t%@ int\";
137 return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
139 return output_move_vfp (operands);
144 [(set_attr "type" "*,*,*,*,load2,load2,store2,r_2_f,f_2_r,ffarithd,f_loadd,f_stored")
145 (set_attr "neon_type" "*,*,*,*,*,*,*,neon_mcr_2_mcrr,neon_mrrc,neon_vmov,*,*")
146 (set (attr "length") (cond [(eq_attr "alternative" "1,4,5,6") (const_int 8)
147 (eq_attr "alternative" "2") (const_int 12)
148 (eq_attr "alternative" "3") (const_int 16)
149 (eq_attr "alternative" "9")
151 (match_test "TARGET_VFP_SINGLE")
155 (set_attr "arm_pool_range" "*,*,*,*,1020,4096,*,*,*,*,1020,*")
156 (set_attr "thumb2_pool_range" "*,*,*,*,1018,4094,*,*,*,*,1018,*")
157 (set_attr "neg_pool_range" "*,*,*,*,1004,0,*,*,*,*,1004,*")
158 (set_attr "arch" "t2,any,any,any,a,t2,any,any,any,any,any,any")]
161 (define_insn "*movdi_vfp_cortexa8"
162 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,r,r,r,r,m,w,!r,w,w, Uv")
163 (match_operand:DI 1 "di_operand" "r,rDa,Db,Dc,mi,mi,r,r,w,w,Uvi,w"))]
164 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP && arm_tune == cortexa8
165 && ( register_operand (operands[0], DImode)
166 || register_operand (operands[1], DImode))
167 && !(TARGET_NEON && CONST_INT_P (operands[1])
168 && neon_immediate_valid_for_move (operands[1], DImode, NULL, NULL))"
170 switch (which_alternative)
180 return output_move_double (operands, true, NULL);
182 return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\";
184 return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\";
186 return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
188 return output_move_vfp (operands);
193 [(set_attr "type" "*,*,*,*,load2,load2,store2,r_2_f,f_2_r,ffarithd,f_loadd,f_stored")
194 (set_attr "neon_type" "*,*,*,*,*,*,*,neon_mcr_2_mcrr,neon_mrrc,neon_vmov,*,*")
195 (set (attr "length") (cond [(eq_attr "alternative" "1") (const_int 8)
196 (eq_attr "alternative" "2") (const_int 12)
197 (eq_attr "alternative" "3") (const_int 16)
198 (eq_attr "alternative" "4,5,6")
200 "arm_count_output_move_double_insns (operands) \
203 (set_attr "predicable" "yes")
204 (set_attr "arm_pool_range" "*,*,*,*,1018,4094,*,*,*,*,1018,*")
205 (set_attr "thumb2_pool_range" "*,*,*,*,1018,4094,*,*,*,*,1018,*")
206 (set_attr "neg_pool_range" "*,*,*,*,1004,0,*,*,*,*,1004,*")
207 (set (attr "ce_count")
208 (symbol_ref "get_attr_length (insn) / 4"))
209 (set_attr "arch" "t2,any,any,any,a,t2,any,any,any,any,any,any")]
213 (define_insn "*movhf_vfp_neon"
214 [(set (match_operand:HF 0 "nonimmediate_operand" "= t,Um,r,m,t,r,t,r,r")
215 (match_operand:HF 1 "general_operand" " Um, t,m,r,t,r,r,t,F"))]
216 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_NEON_FP16
217 && ( s_register_operand (operands[0], HFmode)
218 || s_register_operand (operands[1], HFmode))"
220 switch (which_alternative)
222 case 0: /* S register from memory */
223 return \"vld1.16\\t{%z0}, %A1\";
224 case 1: /* memory from S register */
225 return \"vst1.16\\t{%z1}, %A0\";
226 case 2: /* ARM register from memory */
227 return \"ldrh\\t%0, %1\\t%@ __fp16\";
228 case 3: /* memory from ARM register */
229 return \"strh\\t%1, %0\\t%@ __fp16\";
230 case 4: /* S register from S register */
231 return \"fcpys\\t%0, %1\";
232 case 5: /* ARM register from ARM register */
233 return \"mov\\t%0, %1\\t%@ __fp16\";
234 case 6: /* S register from ARM register */
235 return \"fmsr\\t%0, %1\";
236 case 7: /* ARM register from S register */
237 return \"fmrs\\t%0, %1\";
238 case 8: /* ARM register from constant */
244 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
245 bits = real_to_target (NULL, &r, HFmode);
246 ops[0] = operands[0];
247 ops[1] = GEN_INT (bits);
248 ops[2] = GEN_INT (bits & 0xff00);
249 ops[3] = GEN_INT (bits & 0x00ff);
252 output_asm_insn (\"movw\\t%0, %1\", ops);
254 output_asm_insn (\"mov\\t%0, %2\;orr\\t%0, %0, %3\", ops);
261 [(set_attr "conds" "unconditional")
262 (set_attr "type" "*,*,load1,store1,fcpys,*,r_2_f,f_2_r,*")
263 (set_attr "neon_type" "neon_vld1_1_2_regs,neon_vst1_1_2_regs_vst2_2_regs,*,*,*,*,*,*,*")
264 (set_attr "length" "4,4,4,4,4,4,4,4,8")]
267 ;; FP16 without element load/store instructions.
268 (define_insn "*movhf_vfp"
269 [(set (match_operand:HF 0 "nonimmediate_operand" "=r,m,t,r,t,r,r")
270 (match_operand:HF 1 "general_operand" " m,r,t,r,r,t,F"))]
271 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FP16 && !TARGET_NEON_FP16
272 && ( s_register_operand (operands[0], HFmode)
273 || s_register_operand (operands[1], HFmode))"
275 switch (which_alternative)
277 case 0: /* ARM register from memory */
278 return \"ldrh\\t%0, %1\\t%@ __fp16\";
279 case 1: /* memory from ARM register */
280 return \"strh\\t%1, %0\\t%@ __fp16\";
281 case 2: /* S register from S register */
282 return \"fcpys\\t%0, %1\";
283 case 3: /* ARM register from ARM register */
284 return \"mov\\t%0, %1\\t%@ __fp16\";
285 case 4: /* S register from ARM register */
286 return \"fmsr\\t%0, %1\";
287 case 5: /* ARM register from S register */
288 return \"fmrs\\t%0, %1\";
289 case 6: /* ARM register from constant */
295 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
296 bits = real_to_target (NULL, &r, HFmode);
297 ops[0] = operands[0];
298 ops[1] = GEN_INT (bits);
299 ops[2] = GEN_INT (bits & 0xff00);
300 ops[3] = GEN_INT (bits & 0x00ff);
303 output_asm_insn (\"movw\\t%0, %1\", ops);
305 output_asm_insn (\"mov\\t%0, %2\;orr\\t%0, %0, %3\", ops);
312 [(set_attr "conds" "unconditional")
313 (set_attr "type" "load1,store1,fcpys,*,r_2_f,f_2_r,*")
314 (set_attr "length" "4,4,4,4,4,4,8")]
319 ;; Disparage the w<->r cases because reloading an invalid address is
320 ;; preferable to loading the value via integer registers.
322 (define_insn "*movsf_vfp"
323 [(set (match_operand:SF 0 "nonimmediate_operand" "=t,?r,t ,t ,Uv,r ,m,t,r")
324 (match_operand:SF 1 "general_operand" " ?r,t,Dv,UvE,t, mE,r,t,r"))]
325 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
326 && ( s_register_operand (operands[0], SFmode)
327 || s_register_operand (operands[1], SFmode))"
329 switch (which_alternative)
332 return \"fmsr%?\\t%0, %1\";
334 return \"fmrs%?\\t%0, %1\";
336 return \"fconsts%?\\t%0, #%G1\";
338 return output_move_vfp (operands);
340 return \"ldr%?\\t%0, %1\\t%@ float\";
342 return \"str%?\\t%1, %0\\t%@ float\";
344 return \"fcpys%?\\t%0, %1\";
346 return \"mov%?\\t%0, %1\\t%@ float\";
351 [(set_attr "predicable" "yes")
353 "r_2_f,f_2_r,fconsts,f_loads,f_stores,load1,store1,fcpys,*")
354 (set_attr "neon_type" "neon_mcr,neon_mrc,*,*,*,*,*,neon_vmov,*")
355 (set_attr "insn" "*,*,*,*,*,*,*,*,mov")
356 (set_attr "pool_range" "*,*,*,1020,*,4096,*,*,*")
357 (set_attr "neg_pool_range" "*,*,*,1008,*,4080,*,*,*")]
360 (define_insn "*thumb2_movsf_vfp"
361 [(set (match_operand:SF 0 "nonimmediate_operand" "=t,?r,t, t ,Uv,r ,m,t,r")
362 (match_operand:SF 1 "general_operand" " ?r,t,Dv,UvE,t, mE,r,t,r"))]
363 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP
364 && ( s_register_operand (operands[0], SFmode)
365 || s_register_operand (operands[1], SFmode))"
367 switch (which_alternative)
370 return \"fmsr%?\\t%0, %1\";
372 return \"fmrs%?\\t%0, %1\";
374 return \"fconsts%?\\t%0, #%G1\";
376 return output_move_vfp (operands);
378 return \"ldr%?\\t%0, %1\\t%@ float\";
380 return \"str%?\\t%1, %0\\t%@ float\";
382 return \"fcpys%?\\t%0, %1\";
384 return \"mov%?\\t%0, %1\\t%@ float\";
389 [(set_attr "predicable" "yes")
391 "r_2_f,f_2_r,fconsts,f_loads,f_stores,load1,store1,fcpys,*")
392 (set_attr "neon_type" "neon_mcr,neon_mrc,*,*,*,*,*,neon_vmov,*")
393 (set_attr "insn" "*,*,*,*,*,*,*,*,mov")
394 (set_attr "pool_range" "*,*,*,1018,*,4090,*,*,*")
395 (set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")]
401 (define_insn "*movdf_vfp"
402 [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,?r,w ,w ,Uv,r, m,w,r")
403 (match_operand:DF 1 "soft_df_operand" " ?r,w,Dy,UvF,w ,mF,r,w,r"))]
404 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
405 && ( register_operand (operands[0], DFmode)
406 || register_operand (operands[1], DFmode))"
409 switch (which_alternative)
412 return \"fmdrr%?\\t%P0, %Q1, %R1\";
414 return \"fmrrd%?\\t%Q0, %R0, %P1\";
416 gcc_assert (TARGET_VFP_DOUBLE);
417 return \"fconstd%?\\t%P0, #%G1\";
419 return output_move_vfp (operands);
421 return output_move_double (operands, true, NULL);
423 if (TARGET_VFP_SINGLE)
424 return \"fcpys%?\\t%0, %1\;fcpys%?\\t%p0, %p1\";
426 return \"fcpyd%?\\t%P0, %P1\";
435 "r_2_f,f_2_r,fconstd,f_loadd,f_stored,load2,store2,ffarithd,*")
436 (set_attr "neon_type" "neon_mcr_2_mcrr,neon_mrrc,*,*,*,*,*,neon_vmov,*")
437 (set (attr "length") (cond [(eq_attr "alternative" "5,6,8") (const_int 8)
438 (eq_attr "alternative" "7")
440 (match_test "TARGET_VFP_SINGLE")
444 (set_attr "predicable" "yes")
445 (set_attr "pool_range" "*,*,*,1020,*,1020,*,*,*")
446 (set_attr "neg_pool_range" "*,*,*,1004,*,1004,*,*,*")]
449 (define_insn "*thumb2_movdf_vfp"
450 [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,?r,w ,w ,Uv,r ,m,w,r")
451 (match_operand:DF 1 "soft_df_operand" " ?r,w,Dy,UvF,w, mF,r, w,r"))]
452 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP
453 && ( register_operand (operands[0], DFmode)
454 || register_operand (operands[1], DFmode))"
457 switch (which_alternative)
460 return \"fmdrr%?\\t%P0, %Q1, %R1\";
462 return \"fmrrd%?\\t%Q0, %R0, %P1\";
464 gcc_assert (TARGET_VFP_DOUBLE);
465 return \"fconstd%?\\t%P0, #%G1\";
467 return output_move_vfp (operands);
468 case 5: case 6: case 8:
469 return output_move_double (operands, true, NULL);
471 if (TARGET_VFP_SINGLE)
472 return \"fcpys%?\\t%0, %1\;fcpys%?\\t%p0, %p1\";
474 return \"fcpyd%?\\t%P0, %P1\";
481 "r_2_f,f_2_r,fconstd,f_loadd,f_stored,load2,store2,ffarithd,*")
482 (set_attr "neon_type" "neon_mcr_2_mcrr,neon_mrrc,*,*,*,*,*,neon_vmov,*")
483 (set (attr "length") (cond [(eq_attr "alternative" "5,6,8") (const_int 8)
484 (eq_attr "alternative" "7")
486 (match_test "TARGET_VFP_SINGLE")
490 (set_attr "pool_range" "*,*,*,1018,*,4094,*,*,*")
491 (set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")]
495 ;; Conditional move patterns
497 (define_insn "*movsfcc_vfp"
498 [(set (match_operand:SF 0 "s_register_operand" "=t,t,t,t,t,t,?r,?r,?r")
500 (match_operator 3 "arm_comparison_operator"
501 [(match_operand 4 "cc_register" "") (const_int 0)])
502 (match_operand:SF 1 "s_register_operand" "0,t,t,0,?r,?r,0,t,t")
503 (match_operand:SF 2 "s_register_operand" "t,0,t,?r,0,?r,t,0,t")))]
504 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
508 fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1
511 fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1
514 fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
515 [(set_attr "conds" "use")
516 (set_attr "length" "4,4,8,4,4,8,4,4,8")
517 (set_attr "type" "fcpys,fcpys,fcpys,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
518 (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr,neon_mcr,neon_mcr,neon_mrc,neon_mrc,neon_mrc")]
521 (define_insn "*thumb2_movsfcc_vfp"
522 [(set (match_operand:SF 0 "s_register_operand" "=t,t,t,t,t,t,?r,?r,?r")
524 (match_operator 3 "arm_comparison_operator"
525 [(match_operand 4 "cc_register" "") (const_int 0)])
526 (match_operand:SF 1 "s_register_operand" "0,t,t,0,?r,?r,0,t,t")
527 (match_operand:SF 2 "s_register_operand" "t,0,t,?r,0,?r,t,0,t")))]
528 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP"
530 it\\t%D3\;fcpys%D3\\t%0, %2
531 it\\t%d3\;fcpys%d3\\t%0, %1
532 ite\\t%D3\;fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1
533 it\\t%D3\;fmsr%D3\\t%0, %2
534 it\\t%d3\;fmsr%d3\\t%0, %1
535 ite\\t%D3\;fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1
536 it\\t%D3\;fmrs%D3\\t%0, %2
537 it\\t%d3\;fmrs%d3\\t%0, %1
538 ite\\t%D3\;fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
539 [(set_attr "conds" "use")
540 (set_attr "length" "6,6,10,6,6,10,6,6,10")
541 (set_attr "type" "fcpys,fcpys,fcpys,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
542 (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr,neon_mcr,neon_mcr,neon_mrc,neon_mrc,neon_mrc")]
545 (define_insn "*movdfcc_vfp"
546 [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
548 (match_operator 3 "arm_comparison_operator"
549 [(match_operand 4 "cc_register" "") (const_int 0)])
550 (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
551 (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
552 "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
556 fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1
557 fmdrr%D3\\t%P0, %Q2, %R2
558 fmdrr%d3\\t%P0, %Q1, %R1
559 fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1
560 fmrrd%D3\\t%Q0, %R0, %P2
561 fmrrd%d3\\t%Q0, %R0, %P1
562 fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
563 [(set_attr "conds" "use")
564 (set_attr "length" "4,4,8,4,4,8,4,4,8")
565 (set_attr "type" "ffarithd,ffarithd,ffarithd,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
566 (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mrrc,neon_mrrc,neon_mrrc")]
569 (define_insn "*thumb2_movdfcc_vfp"
570 [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
572 (match_operator 3 "arm_comparison_operator"
573 [(match_operand 4 "cc_register" "") (const_int 0)])
574 (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
575 (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
576 "TARGET_THUMB2 && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
578 it\\t%D3\;fcpyd%D3\\t%P0, %P2
579 it\\t%d3\;fcpyd%d3\\t%P0, %P1
580 ite\\t%D3\;fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1
581 it\t%D3\;fmdrr%D3\\t%P0, %Q2, %R2
582 it\t%d3\;fmdrr%d3\\t%P0, %Q1, %R1
583 ite\\t%D3\;fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1
584 it\t%D3\;fmrrd%D3\\t%Q0, %R0, %P2
585 it\t%d3\;fmrrd%d3\\t%Q0, %R0, %P1
586 ite\\t%D3\;fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
587 [(set_attr "conds" "use")
588 (set_attr "length" "6,6,10,6,6,10,6,6,10")
589 (set_attr "type" "ffarithd,ffarithd,ffarithd,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")
590 (set_attr "neon_type" "neon_vmov,neon_vmov,neon_vmov,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mcr_2_mcrr,neon_mrrc,neon_mrrc,neon_mrrc")]
594 ;; Sign manipulation functions
596 (define_insn "*abssf2_vfp"
597 [(set (match_operand:SF 0 "s_register_operand" "=t")
598 (abs:SF (match_operand:SF 1 "s_register_operand" "t")))]
599 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
601 [(set_attr "predicable" "yes")
602 (set_attr "type" "ffariths")]
605 (define_insn "*absdf2_vfp"
606 [(set (match_operand:DF 0 "s_register_operand" "=w")
607 (abs:DF (match_operand:DF 1 "s_register_operand" "w")))]
608 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
610 [(set_attr "predicable" "yes")
611 (set_attr "type" "ffarithd")]
614 (define_insn "*negsf2_vfp"
615 [(set (match_operand:SF 0 "s_register_operand" "=t,?r")
616 (neg:SF (match_operand:SF 1 "s_register_operand" "t,r")))]
617 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
620 eor%?\\t%0, %1, #-2147483648"
621 [(set_attr "predicable" "yes")
622 (set_attr "type" "ffariths")]
625 (define_insn_and_split "*negdf2_vfp"
626 [(set (match_operand:DF 0 "s_register_operand" "=w,?r,?r")
627 (neg:DF (match_operand:DF 1 "s_register_operand" "w,0,r")))]
628 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
633 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE && reload_completed
634 && arm_general_register_operand (operands[0], DFmode)"
635 [(set (match_dup 0) (match_dup 1))]
637 if (REGNO (operands[0]) == REGNO (operands[1]))
639 operands[0] = gen_highpart (SImode, operands[0]);
640 operands[1] = gen_rtx_XOR (SImode, operands[0], GEN_INT (0x80000000));
644 rtx in_hi, in_lo, out_hi, out_lo;
646 in_hi = gen_rtx_XOR (SImode, gen_highpart (SImode, operands[1]),
647 GEN_INT (0x80000000));
648 in_lo = gen_lowpart (SImode, operands[1]);
649 out_hi = gen_highpart (SImode, operands[0]);
650 out_lo = gen_lowpart (SImode, operands[0]);
652 if (REGNO (in_lo) == REGNO (out_hi))
654 emit_insn (gen_rtx_SET (SImode, out_lo, in_lo));
655 operands[0] = out_hi;
660 emit_insn (gen_rtx_SET (SImode, out_hi, in_hi));
661 operands[0] = out_lo;
666 [(set_attr "predicable" "yes")
667 (set_attr "length" "4,4,8")
668 (set_attr "type" "ffarithd")]
674 (define_insn "*addsf3_vfp"
675 [(set (match_operand:SF 0 "s_register_operand" "=t")
676 (plus:SF (match_operand:SF 1 "s_register_operand" "t")
677 (match_operand:SF 2 "s_register_operand" "t")))]
678 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
679 "fadds%?\\t%0, %1, %2"
680 [(set_attr "predicable" "yes")
681 (set_attr "type" "fadds")]
684 (define_insn "*adddf3_vfp"
685 [(set (match_operand:DF 0 "s_register_operand" "=w")
686 (plus:DF (match_operand:DF 1 "s_register_operand" "w")
687 (match_operand:DF 2 "s_register_operand" "w")))]
688 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
689 "faddd%?\\t%P0, %P1, %P2"
690 [(set_attr "predicable" "yes")
691 (set_attr "type" "faddd")]
695 (define_insn "*subsf3_vfp"
696 [(set (match_operand:SF 0 "s_register_operand" "=t")
697 (minus:SF (match_operand:SF 1 "s_register_operand" "t")
698 (match_operand:SF 2 "s_register_operand" "t")))]
699 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
700 "fsubs%?\\t%0, %1, %2"
701 [(set_attr "predicable" "yes")
702 (set_attr "type" "fadds")]
705 (define_insn "*subdf3_vfp"
706 [(set (match_operand:DF 0 "s_register_operand" "=w")
707 (minus:DF (match_operand:DF 1 "s_register_operand" "w")
708 (match_operand:DF 2 "s_register_operand" "w")))]
709 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
710 "fsubd%?\\t%P0, %P1, %P2"
711 [(set_attr "predicable" "yes")
712 (set_attr "type" "faddd")]
718 (define_insn "*divsf3_vfp"
719 [(set (match_operand:SF 0 "s_register_operand" "=t")
720 (div:SF (match_operand:SF 1 "s_register_operand" "t")
721 (match_operand:SF 2 "s_register_operand" "t")))]
722 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
723 "fdivs%?\\t%0, %1, %2"
724 [(set_attr "predicable" "yes")
725 (set_attr "type" "fdivs")]
728 (define_insn "*divdf3_vfp"
729 [(set (match_operand:DF 0 "s_register_operand" "=w")
730 (div:DF (match_operand:DF 1 "s_register_operand" "w")
731 (match_operand:DF 2 "s_register_operand" "w")))]
732 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
733 "fdivd%?\\t%P0, %P1, %P2"
734 [(set_attr "predicable" "yes")
735 (set_attr "type" "fdivd")]
739 ;; Multiplication insns
741 (define_insn "*mulsf3_vfp"
742 [(set (match_operand:SF 0 "s_register_operand" "=t")
743 (mult:SF (match_operand:SF 1 "s_register_operand" "t")
744 (match_operand:SF 2 "s_register_operand" "t")))]
745 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
746 "fmuls%?\\t%0, %1, %2"
747 [(set_attr "predicable" "yes")
748 (set_attr "type" "fmuls")]
751 (define_insn "*muldf3_vfp"
752 [(set (match_operand:DF 0 "s_register_operand" "=w")
753 (mult:DF (match_operand:DF 1 "s_register_operand" "w")
754 (match_operand:DF 2 "s_register_operand" "w")))]
755 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
756 "fmuld%?\\t%P0, %P1, %P2"
757 [(set_attr "predicable" "yes")
758 (set_attr "type" "fmuld")]
761 (define_insn "*mulsf3negsf_vfp"
762 [(set (match_operand:SF 0 "s_register_operand" "=t")
763 (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "t"))
764 (match_operand:SF 2 "s_register_operand" "t")))]
765 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
766 "fnmuls%?\\t%0, %1, %2"
767 [(set_attr "predicable" "yes")
768 (set_attr "type" "fmuls")]
771 (define_insn "*muldf3negdf_vfp"
772 [(set (match_operand:DF 0 "s_register_operand" "=w")
773 (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w"))
774 (match_operand:DF 2 "s_register_operand" "w")))]
775 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
776 "fnmuld%?\\t%P0, %P1, %P2"
777 [(set_attr "predicable" "yes")
778 (set_attr "type" "fmuld")]
782 ;; Multiply-accumulate insns
785 (define_insn "*mulsf3addsf_vfp"
786 [(set (match_operand:SF 0 "s_register_operand" "=t")
787 (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
788 (match_operand:SF 3 "s_register_operand" "t"))
789 (match_operand:SF 1 "s_register_operand" "0")))]
790 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
791 "fmacs%?\\t%0, %2, %3"
792 [(set_attr "predicable" "yes")
793 (set_attr "type" "fmacs")]
796 (define_insn "*muldf3adddf_vfp"
797 [(set (match_operand:DF 0 "s_register_operand" "=w")
798 (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
799 (match_operand:DF 3 "s_register_operand" "w"))
800 (match_operand:DF 1 "s_register_operand" "0")))]
801 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
802 "fmacd%?\\t%P0, %P2, %P3"
803 [(set_attr "predicable" "yes")
804 (set_attr "type" "fmacd")]
808 (define_insn "*mulsf3subsf_vfp"
809 [(set (match_operand:SF 0 "s_register_operand" "=t")
810 (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "t")
811 (match_operand:SF 3 "s_register_operand" "t"))
812 (match_operand:SF 1 "s_register_operand" "0")))]
813 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
814 "fmscs%?\\t%0, %2, %3"
815 [(set_attr "predicable" "yes")
816 (set_attr "type" "fmacs")]
819 (define_insn "*muldf3subdf_vfp"
820 [(set (match_operand:DF 0 "s_register_operand" "=w")
821 (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
822 (match_operand:DF 3 "s_register_operand" "w"))
823 (match_operand:DF 1 "s_register_operand" "0")))]
824 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
825 "fmscd%?\\t%P0, %P2, %P3"
826 [(set_attr "predicable" "yes")
827 (set_attr "type" "fmacd")]
831 (define_insn "*mulsf3negsfaddsf_vfp"
832 [(set (match_operand:SF 0 "s_register_operand" "=t")
833 (minus:SF (match_operand:SF 1 "s_register_operand" "0")
834 (mult:SF (match_operand:SF 2 "s_register_operand" "t")
835 (match_operand:SF 3 "s_register_operand" "t"))))]
836 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
837 "fnmacs%?\\t%0, %2, %3"
838 [(set_attr "predicable" "yes")
839 (set_attr "type" "fmacs")]
842 (define_insn "*fmuldf3negdfadddf_vfp"
843 [(set (match_operand:DF 0 "s_register_operand" "=w")
844 (minus:DF (match_operand:DF 1 "s_register_operand" "0")
845 (mult:DF (match_operand:DF 2 "s_register_operand" "w")
846 (match_operand:DF 3 "s_register_operand" "w"))))]
847 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
848 "fnmacd%?\\t%P0, %P2, %P3"
849 [(set_attr "predicable" "yes")
850 (set_attr "type" "fmacd")]
855 (define_insn "*mulsf3negsfsubsf_vfp"
856 [(set (match_operand:SF 0 "s_register_operand" "=t")
858 (neg:SF (match_operand:SF 2 "s_register_operand" "t"))
859 (match_operand:SF 3 "s_register_operand" "t"))
860 (match_operand:SF 1 "s_register_operand" "0")))]
861 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
862 "fnmscs%?\\t%0, %2, %3"
863 [(set_attr "predicable" "yes")
864 (set_attr "type" "fmacs")]
867 (define_insn "*muldf3negdfsubdf_vfp"
868 [(set (match_operand:DF 0 "s_register_operand" "=w")
870 (neg:DF (match_operand:DF 2 "s_register_operand" "w"))
871 (match_operand:DF 3 "s_register_operand" "w"))
872 (match_operand:DF 1 "s_register_operand" "0")))]
873 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
874 "fnmscd%?\\t%P0, %P2, %P3"
875 [(set_attr "predicable" "yes")
876 (set_attr "type" "fmacd")]
879 ;; Fused-multiply-accumulate
881 (define_insn "fma<SDF:mode>4"
882 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
883 (fma:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
884 (match_operand:SDF 2 "register_operand" "<F_constraint>")
885 (match_operand:SDF 3 "register_operand" "0")))]
886 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FMA"
887 "vfma%?.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
888 [(set_attr "predicable" "yes")
889 (set_attr "type" "ffma<vfp_type>")]
892 (define_insn "*fmsub<SDF:mode>4"
893 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
894 (fma:SDF (neg:SDF (match_operand:SDF 1 "register_operand"
896 (match_operand:SDF 2 "register_operand" "<F_constraint>")
897 (match_operand:SDF 3 "register_operand" "0")))]
898 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FMA"
899 "vfms%?.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
900 [(set_attr "predicable" "yes")
901 (set_attr "type" "ffma<vfp_type>")]
904 (define_insn "*fnmsub<SDF:mode>4"
905 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
906 (fma:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
907 (match_operand:SDF 2 "register_operand" "<F_constraint>")
908 (neg:SDF (match_operand:SDF 3 "register_operand" "0"))))]
909 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FMA"
910 "vfnms%?.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
911 [(set_attr "predicable" "yes")
912 (set_attr "type" "ffma<vfp_type>")]
915 (define_insn "*fnmadd<SDF:mode>4"
916 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
917 (fma:SDF (neg:SDF (match_operand:SDF 1 "register_operand"
919 (match_operand:SDF 2 "register_operand" "<F_constraint>")
920 (neg:SDF (match_operand:SDF 3 "register_operand" "0"))))]
921 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FMA"
922 "vfnma%?.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
923 [(set_attr "predicable" "yes")
924 (set_attr "type" "ffma<vfp_type>")]
928 ;; Conversion routines
930 (define_insn "*extendsfdf2_vfp"
931 [(set (match_operand:DF 0 "s_register_operand" "=w")
932 (float_extend:DF (match_operand:SF 1 "s_register_operand" "t")))]
933 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
935 [(set_attr "predicable" "yes")
936 (set_attr "type" "f_cvt")]
939 (define_insn "*truncdfsf2_vfp"
940 [(set (match_operand:SF 0 "s_register_operand" "=t")
941 (float_truncate:SF (match_operand:DF 1 "s_register_operand" "w")))]
942 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
944 [(set_attr "predicable" "yes")
945 (set_attr "type" "f_cvt")]
948 (define_insn "extendhfsf2"
949 [(set (match_operand:SF 0 "s_register_operand" "=t")
950 (float_extend:SF (match_operand:HF 1 "s_register_operand" "t")))]
951 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FP16"
952 "vcvtb%?.f32.f16\\t%0, %1"
953 [(set_attr "predicable" "yes")
954 (set_attr "type" "f_cvt")]
957 (define_insn "truncsfhf2"
958 [(set (match_operand:HF 0 "s_register_operand" "=t")
959 (float_truncate:HF (match_operand:SF 1 "s_register_operand" "t")))]
960 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_FP16"
961 "vcvtb%?.f16.f32\\t%0, %1"
962 [(set_attr "predicable" "yes")
963 (set_attr "type" "f_cvt")]
966 (define_insn "*truncsisf2_vfp"
967 [(set (match_operand:SI 0 "s_register_operand" "=t")
968 (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "t"))))]
969 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
971 [(set_attr "predicable" "yes")
972 (set_attr "type" "f_cvt")]
975 (define_insn "*truncsidf2_vfp"
976 [(set (match_operand:SI 0 "s_register_operand" "=t")
977 (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))]
978 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
979 "ftosizd%?\\t%0, %P1"
980 [(set_attr "predicable" "yes")
981 (set_attr "type" "f_cvt")]
985 (define_insn "fixuns_truncsfsi2"
986 [(set (match_operand:SI 0 "s_register_operand" "=t")
987 (unsigned_fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "t"))))]
988 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
990 [(set_attr "predicable" "yes")
991 (set_attr "type" "f_cvt")]
994 (define_insn "fixuns_truncdfsi2"
995 [(set (match_operand:SI 0 "s_register_operand" "=t")
996 (unsigned_fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "t"))))]
997 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
998 "ftouizd%?\\t%0, %P1"
999 [(set_attr "predicable" "yes")
1000 (set_attr "type" "f_cvt")]
1004 (define_insn "*floatsisf2_vfp"
1005 [(set (match_operand:SF 0 "s_register_operand" "=t")
1006 (float:SF (match_operand:SI 1 "s_register_operand" "t")))]
1007 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1009 [(set_attr "predicable" "yes")
1010 (set_attr "type" "f_cvt")]
1013 (define_insn "*floatsidf2_vfp"
1014 [(set (match_operand:DF 0 "s_register_operand" "=w")
1015 (float:DF (match_operand:SI 1 "s_register_operand" "t")))]
1016 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1017 "fsitod%?\\t%P0, %1"
1018 [(set_attr "predicable" "yes")
1019 (set_attr "type" "f_cvt")]
1023 (define_insn "floatunssisf2"
1024 [(set (match_operand:SF 0 "s_register_operand" "=t")
1025 (unsigned_float:SF (match_operand:SI 1 "s_register_operand" "t")))]
1026 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1028 [(set_attr "predicable" "yes")
1029 (set_attr "type" "f_cvt")]
1032 (define_insn "floatunssidf2"
1033 [(set (match_operand:DF 0 "s_register_operand" "=w")
1034 (unsigned_float:DF (match_operand:SI 1 "s_register_operand" "t")))]
1035 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1036 "fuitod%?\\t%P0, %1"
1037 [(set_attr "predicable" "yes")
1038 (set_attr "type" "f_cvt")]
1044 (define_insn "*sqrtsf2_vfp"
1045 [(set (match_operand:SF 0 "s_register_operand" "=t")
1046 (sqrt:SF (match_operand:SF 1 "s_register_operand" "t")))]
1047 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1049 [(set_attr "predicable" "yes")
1050 (set_attr "type" "fdivs")]
1053 (define_insn "*sqrtdf2_vfp"
1054 [(set (match_operand:DF 0 "s_register_operand" "=w")
1055 (sqrt:DF (match_operand:DF 1 "s_register_operand" "w")))]
1056 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1057 "fsqrtd%?\\t%P0, %P1"
1058 [(set_attr "predicable" "yes")
1059 (set_attr "type" "fdivd")]
1063 ;; Patterns to split/copy vfp condition flags.
1065 (define_insn "*movcc_vfp"
1066 [(set (reg CC_REGNUM)
1067 (reg VFPCC_REGNUM))]
1068 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1070 [(set_attr "conds" "set")
1071 (set_attr "type" "f_flag")]
1074 (define_insn_and_split "*cmpsf_split_vfp"
1075 [(set (reg:CCFP CC_REGNUM)
1076 (compare:CCFP (match_operand:SF 0 "s_register_operand" "t")
1077 (match_operand:SF 1 "vfp_compare_operand" "tG")))]
1078 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1080 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1081 [(set (reg:CCFP VFPCC_REGNUM)
1082 (compare:CCFP (match_dup 0)
1084 (set (reg:CCFP CC_REGNUM)
1085 (reg:CCFP VFPCC_REGNUM))]
1089 (define_insn_and_split "*cmpsf_trap_split_vfp"
1090 [(set (reg:CCFPE CC_REGNUM)
1091 (compare:CCFPE (match_operand:SF 0 "s_register_operand" "t")
1092 (match_operand:SF 1 "vfp_compare_operand" "tG")))]
1093 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1095 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1096 [(set (reg:CCFPE VFPCC_REGNUM)
1097 (compare:CCFPE (match_dup 0)
1099 (set (reg:CCFPE CC_REGNUM)
1100 (reg:CCFPE VFPCC_REGNUM))]
1104 (define_insn_and_split "*cmpdf_split_vfp"
1105 [(set (reg:CCFP CC_REGNUM)
1106 (compare:CCFP (match_operand:DF 0 "s_register_operand" "w")
1107 (match_operand:DF 1 "vfp_compare_operand" "wG")))]
1108 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1110 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1111 [(set (reg:CCFP VFPCC_REGNUM)
1112 (compare:CCFP (match_dup 0)
1114 (set (reg:CCFP CC_REGNUM)
1115 (reg:CCFP VFPCC_REGNUM))]
1119 (define_insn_and_split "*cmpdf_trap_split_vfp"
1120 [(set (reg:CCFPE CC_REGNUM)
1121 (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w")
1122 (match_operand:DF 1 "vfp_compare_operand" "wG")))]
1123 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1125 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1126 [(set (reg:CCFPE VFPCC_REGNUM)
1127 (compare:CCFPE (match_dup 0)
1129 (set (reg:CCFPE CC_REGNUM)
1130 (reg:CCFPE VFPCC_REGNUM))]
1135 ;; Comparison patterns
1137 (define_insn "*cmpsf_vfp"
1138 [(set (reg:CCFP VFPCC_REGNUM)
1139 (compare:CCFP (match_operand:SF 0 "s_register_operand" "t,t")
1140 (match_operand:SF 1 "vfp_compare_operand" "t,G")))]
1141 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1145 [(set_attr "predicable" "yes")
1146 (set_attr "type" "fcmps")]
1149 (define_insn "*cmpsf_trap_vfp"
1150 [(set (reg:CCFPE VFPCC_REGNUM)
1151 (compare:CCFPE (match_operand:SF 0 "s_register_operand" "t,t")
1152 (match_operand:SF 1 "vfp_compare_operand" "t,G")))]
1153 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1157 [(set_attr "predicable" "yes")
1158 (set_attr "type" "fcmps")]
1161 (define_insn "*cmpdf_vfp"
1162 [(set (reg:CCFP VFPCC_REGNUM)
1163 (compare:CCFP (match_operand:DF 0 "s_register_operand" "w,w")
1164 (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
1165 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1169 [(set_attr "predicable" "yes")
1170 (set_attr "type" "fcmpd")]
1173 (define_insn "*cmpdf_trap_vfp"
1174 [(set (reg:CCFPE VFPCC_REGNUM)
1175 (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w,w")
1176 (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
1177 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
1181 [(set_attr "predicable" "yes")
1182 (set_attr "type" "fcmpd")]
1185 ;; Fixed point to floating point conversions.
1186 (define_code_iterator FCVT [unsigned_float float])
1187 (define_code_attr FCVTI32typename [(unsigned_float "u32") (float "s32")])
1189 (define_insn "*combine_vcvt_f32_<FCVTI32typename>"
1190 [(set (match_operand:SF 0 "s_register_operand" "=t")
1191 (mult:SF (FCVT:SF (match_operand:SI 1 "s_register_operand" "0"))
1193 "const_double_vcvt_power_of_two_reciprocal" "Dt")))]
1194 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math"
1195 "vcvt.f32.<FCVTI32typename>\\t%0, %1, %v2"
1196 [(set_attr "predicable" "no")
1197 (set_attr "type" "f_cvt")]
1200 ;; Not the ideal way of implementing this. Ideally we would be able to split
1201 ;; this into a move to a DP register and then a vcvt.f64.i32
1202 (define_insn "*combine_vcvt_f64_<FCVTI32typename>"
1203 [(set (match_operand:DF 0 "s_register_operand" "=x,x,w")
1204 (mult:DF (FCVT:DF (match_operand:SI 1 "s_register_operand" "r,t,r"))
1206 "const_double_vcvt_power_of_two_reciprocal" "Dt,Dt,Dt")))]
1207 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math
1208 && !TARGET_VFP_SINGLE"
1210 vmov.f32\\t%0, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2
1211 vmov.f32\\t%0, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2
1212 vmov.f64\\t%P0, %1, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2"
1213 [(set_attr "predicable" "no")
1214 (set_attr "type" "f_cvt")
1215 (set_attr "length" "8")]
1218 ;; Store multiple insn used in function prologue.
1219 (define_insn "*push_multi_vfp"
1220 [(match_parallel 2 "multi_register_push"
1221 [(set (match_operand:BLK 0 "memory_operand" "=m")
1222 (unspec:BLK [(match_operand:DF 1 "vfp_register_operand" "")]
1223 UNSPEC_PUSH_MULT))])]
1224 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
1225 "* return vfp_output_fstmd (operands);"
1226 [(set_attr "type" "f_stored")]
1229 ;; VRINT round to integral instructions.
1230 ;; Invoked for the patterns: btruncsf2, btruncdf2, ceilsf2, ceildf2,
1231 ;; roundsf2, rounddf2, floorsf2, floordf2, nearbyintsf2, nearbyintdf2,
1232 ;; rintsf2, rintdf2.
1233 (define_insn "<vrint_pattern><SDF:mode>2"
1234 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
1235 (unspec:SDF [(match_operand:SDF 1
1236 "register_operand" "<F_constraint>")]
1238 "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 <vfp_double_cond>"
1239 "vrint<vrint_variant>%?.<V_if_elem>\\t%<V_reg>0, %<V_reg>1"
1240 [(set_attr "predicable" "<vrint_predicable>")
1241 (set_attr "type" "f_rint<vfp_type>")]
1244 ;; MIN_EXPR and MAX_EXPR eventually map to 'smin' and 'smax' in RTL.
1245 ;; The 'smax' and 'smin' RTL standard pattern names do not specify which
1246 ;; operand will be returned when both operands are zero (i.e. they may not
1247 ;; honour signed zeroes), or when either operand is NaN. Therefore GCC
1248 ;; only introduces MIN_EXPR/MAX_EXPR in fast math mode or when not honouring
1251 (define_insn "smax<mode>3"
1252 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
1253 (smax:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
1254 (match_operand:SDF 2 "register_operand" "<F_constraint>")))]
1255 "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 <vfp_double_cond>"
1256 "vmaxnm.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
1257 [(set_attr "type" "f_minmax<vfp_type>")]
1260 (define_insn "smin<mode>3"
1261 [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
1262 (smin:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
1263 (match_operand:SDF 2 "register_operand" "<F_constraint>")))]
1264 "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 <vfp_double_cond>"
1265 "vminnm.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
1266 [(set_attr "type" "f_minmax<vfp_type>")]
1269 ;; Unimplemented insns:
1272 ;; fmdhr et al (VFPv1)
1273 ;; Support for xD (single precision only) variants.