1132718Skan;;- Machine description for FPA co-processor for ARM cpus. 2132718Skan;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, 3169689Skan;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4132718Skan;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) 5132718Skan;; and Martin Simmons (@harleqn.co.uk). 6132718Skan;; More major hacks by Richard Earnshaw (rearnsha@arm.com). 7132718Skan 8132718Skan;; This file is part of GCC. 9132718Skan 10132718Skan;; GCC is free software; you can redistribute it and/or modify it 11132718Skan;; under the terms of the GNU General Public License as published 12132718Skan;; by the Free Software Foundation; either version 2, or (at your 13132718Skan;; option) any later version. 14132718Skan 15132718Skan;; GCC is distributed in the hope that it will be useful, but WITHOUT 16132718Skan;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17132718Skan;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18132718Skan;; License for more details. 19132718Skan 20132718Skan;; You should have received a copy of the GNU General Public License 21132718Skan;; along with GCC; see the file COPYING. If not, write to 22169689Skan;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, 23169689Skan;; Boston, MA 02110-1301, USA. 24132718Skan 25132718Skan;; FPA automaton. 26132718Skan(define_automaton "armfp") 27132718Skan 28132718Skan;; Floating point unit (FPA) 29132718Skan(define_cpu_unit "fpa" "armfp") 30132718Skan 31132718Skan; The fpa10 doesn't really have a memory read unit, but it can start 32132718Skan; to speculatively execute the instruction in the pipeline, provided 33132718Skan; the data is already loaded, so pretend reads have a delay of 2 (and 34132718Skan; that the pipeline is infinite). 35132718Skan(define_cpu_unit "fpa_mem" "arm") 36132718Skan 37132718Skan(define_insn_reservation "fdivx" 71 38132718Skan (and (eq_attr "fpu" "fpa") 39132718Skan (eq_attr "type" "fdivx")) 40132718Skan "core+fpa*69") 41132718Skan 42132718Skan(define_insn_reservation "fdivd" 59 43132718Skan (and (eq_attr "fpu" "fpa") 44132718Skan (eq_attr "type" "fdivd")) 45132718Skan "core+fpa*57") 46132718Skan 47132718Skan(define_insn_reservation "fdivs" 31 48132718Skan (and (eq_attr "fpu" "fpa") 49132718Skan (eq_attr "type" "fdivs")) 50132718Skan "core+fpa*29") 51132718Skan 52132718Skan(define_insn_reservation "fmul" 9 53132718Skan (and (eq_attr "fpu" "fpa") 54132718Skan (eq_attr "type" "fmul")) 55132718Skan "core+fpa*7") 56132718Skan 57132718Skan(define_insn_reservation "ffmul" 6 58132718Skan (and (eq_attr "fpu" "fpa") 59132718Skan (eq_attr "type" "ffmul")) 60132718Skan "core+fpa*4") 61132718Skan 62132718Skan(define_insn_reservation "farith" 4 63132718Skan (and (eq_attr "fpu" "fpa") 64132718Skan (eq_attr "type" "farith")) 65132718Skan "core+fpa*2") 66132718Skan 67132718Skan(define_insn_reservation "ffarith" 2 68132718Skan (and (eq_attr "fpu" "fpa") 69132718Skan (eq_attr "type" "ffarith")) 70132718Skan "core+fpa*2") 71132718Skan 72132718Skan(define_insn_reservation "r_2_f" 5 73132718Skan (and (eq_attr "fpu" "fpa") 74132718Skan (eq_attr "type" "r_2_f")) 75132718Skan "core+fpa*3") 76132718Skan 77132718Skan(define_insn_reservation "f_2_r" 1 78132718Skan (and (eq_attr "fpu" "fpa") 79132718Skan (eq_attr "type" "f_2_r")) 80132718Skan "core+fpa*2") 81132718Skan 82132718Skan(define_insn_reservation "f_load" 3 83132718Skan (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_load")) 84132718Skan "fpa_mem+core*3") 85132718Skan 86132718Skan(define_insn_reservation "f_store" 4 87132718Skan (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_store")) 88132718Skan "core*4") 89132718Skan 90132718Skan(define_insn_reservation "r_mem_f" 6 91132718Skan (and (eq_attr "model_wbuf" "no") 92132718Skan (and (eq_attr "fpu" "fpa") (eq_attr "type" "r_mem_f"))) 93132718Skan "core*6") 94132718Skan 95132718Skan(define_insn_reservation "f_mem_r" 7 96132718Skan (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_mem_r")) 97132718Skan "core*7") 98132718Skan 99132718Skan 100132718Skan(define_insn "*addsf3_fpa" 101132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f,f") 102132718Skan (plus:SF (match_operand:SF 1 "s_register_operand" "%f,f") 103169689Skan (match_operand:SF 2 "arm_float_add_operand" "fG,H")))] 104169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 105132718Skan "@ 106132718Skan adf%?s\\t%0, %1, %2 107132718Skan suf%?s\\t%0, %1, #%N2" 108132718Skan [(set_attr "type" "farith") 109132718Skan (set_attr "predicable" "yes")] 110132718Skan) 111132718Skan 112132718Skan(define_insn "*adddf3_fpa" 113132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f") 114132718Skan (plus:DF (match_operand:DF 1 "s_register_operand" "%f,f") 115169689Skan (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] 116169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 117132718Skan "@ 118132718Skan adf%?d\\t%0, %1, %2 119132718Skan suf%?d\\t%0, %1, #%N2" 120132718Skan [(set_attr "type" "farith") 121132718Skan (set_attr "predicable" "yes")] 122132718Skan) 123132718Skan 124132718Skan(define_insn "*adddf_esfdf_df_fpa" 125132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f") 126132718Skan (plus:DF (float_extend:DF 127132718Skan (match_operand:SF 1 "s_register_operand" "f,f")) 128169689Skan (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] 129169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 130132718Skan "@ 131132718Skan adf%?d\\t%0, %1, %2 132132718Skan suf%?d\\t%0, %1, #%N2" 133132718Skan [(set_attr "type" "farith") 134132718Skan (set_attr "predicable" "yes")] 135132718Skan) 136132718Skan 137132718Skan(define_insn "*adddf_df_esfdf_fpa" 138132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 139132718Skan (plus:DF (match_operand:DF 1 "s_register_operand" "f") 140132718Skan (float_extend:DF 141132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 142169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 143132718Skan "adf%?d\\t%0, %1, %2" 144132718Skan [(set_attr "type" "farith") 145132718Skan (set_attr "predicable" "yes")] 146132718Skan) 147132718Skan 148132718Skan(define_insn "*adddf_esfdf_esfdf_fpa" 149132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 150132718Skan (plus:DF (float_extend:DF 151132718Skan (match_operand:SF 1 "s_register_operand" "f")) 152132718Skan (float_extend:DF 153132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 154169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 155132718Skan "adf%?d\\t%0, %1, %2" 156132718Skan [(set_attr "type" "farith") 157132718Skan (set_attr "predicable" "yes")] 158132718Skan) 159132718Skan 160132718Skan(define_insn "*subsf3_fpa" 161132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f,f") 162169689Skan (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") 163169689Skan (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] 164169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 165132718Skan "@ 166132718Skan suf%?s\\t%0, %1, %2 167132718Skan rsf%?s\\t%0, %2, %1" 168132718Skan [(set_attr "type" "farith")] 169132718Skan) 170132718Skan 171132718Skan(define_insn "*subdf3_fpa" 172132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f") 173169689Skan (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") 174169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] 175169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 176132718Skan "@ 177132718Skan suf%?d\\t%0, %1, %2 178132718Skan rsf%?d\\t%0, %2, %1" 179132718Skan [(set_attr "type" "farith") 180132718Skan (set_attr "predicable" "yes")] 181132718Skan) 182132718Skan 183132718Skan(define_insn "*subdf_esfdf_df_fpa" 184132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 185132718Skan (minus:DF (float_extend:DF 186132718Skan (match_operand:SF 1 "s_register_operand" "f")) 187169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 188169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 189132718Skan "suf%?d\\t%0, %1, %2" 190132718Skan [(set_attr "type" "farith") 191132718Skan (set_attr "predicable" "yes")] 192132718Skan) 193132718Skan 194132718Skan(define_insn "*subdf_df_esfdf_fpa" 195132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f") 196169689Skan (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") 197132718Skan (float_extend:DF 198132718Skan (match_operand:SF 2 "s_register_operand" "f,f"))))] 199169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 200132718Skan "@ 201132718Skan suf%?d\\t%0, %1, %2 202132718Skan rsf%?d\\t%0, %2, %1" 203132718Skan [(set_attr "type" "farith") 204132718Skan (set_attr "predicable" "yes")] 205132718Skan) 206132718Skan 207132718Skan(define_insn "*subdf_esfdf_esfdf_fpa" 208132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 209132718Skan (minus:DF (float_extend:DF 210132718Skan (match_operand:SF 1 "s_register_operand" "f")) 211132718Skan (float_extend:DF 212132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 213169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 214132718Skan "suf%?d\\t%0, %1, %2" 215132718Skan [(set_attr "type" "farith") 216132718Skan (set_attr "predicable" "yes")] 217132718Skan) 218132718Skan 219132718Skan(define_insn "*mulsf3_fpa" 220132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 221132718Skan (mult:SF (match_operand:SF 1 "s_register_operand" "f") 222169689Skan (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] 223169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 224132718Skan "fml%?s\\t%0, %1, %2" 225132718Skan [(set_attr "type" "ffmul") 226132718Skan (set_attr "predicable" "yes")] 227132718Skan) 228132718Skan 229132718Skan(define_insn "*muldf3_fpa" 230132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 231132718Skan (mult:DF (match_operand:DF 1 "s_register_operand" "f") 232169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 233169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 234132718Skan "muf%?d\\t%0, %1, %2" 235132718Skan [(set_attr "type" "fmul") 236132718Skan (set_attr "predicable" "yes")] 237132718Skan) 238132718Skan 239132718Skan(define_insn "*muldf_esfdf_df_fpa" 240132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 241132718Skan (mult:DF (float_extend:DF 242132718Skan (match_operand:SF 1 "s_register_operand" "f")) 243169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 244169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 245132718Skan "muf%?d\\t%0, %1, %2" 246132718Skan [(set_attr "type" "fmul") 247132718Skan (set_attr "predicable" "yes")] 248132718Skan) 249132718Skan 250132718Skan(define_insn "*muldf_df_esfdf_fpa" 251132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 252132718Skan (mult:DF (match_operand:DF 1 "s_register_operand" "f") 253132718Skan (float_extend:DF 254132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 255169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 256132718Skan "muf%?d\\t%0, %1, %2" 257132718Skan [(set_attr "type" "fmul") 258132718Skan (set_attr "predicable" "yes")] 259132718Skan) 260132718Skan 261132718Skan(define_insn "*muldf_esfdf_esfdf_fpa" 262132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 263132718Skan (mult:DF 264132718Skan (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) 265132718Skan (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] 266169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 267132718Skan "muf%?d\\t%0, %1, %2" 268132718Skan [(set_attr "type" "fmul") 269132718Skan (set_attr "predicable" "yes")] 270132718Skan) 271132718Skan 272132718Skan;; Division insns 273132718Skan 274132718Skan(define_insn "*divsf3_fpa" 275132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f,f") 276169689Skan (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") 277169689Skan (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] 278169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 279132718Skan "@ 280132718Skan fdv%?s\\t%0, %1, %2 281132718Skan frd%?s\\t%0, %2, %1" 282132718Skan [(set_attr "type" "fdivs") 283132718Skan (set_attr "predicable" "yes")] 284132718Skan) 285132718Skan 286132718Skan(define_insn "*divdf3_fpa" 287132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f") 288169689Skan (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") 289169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] 290169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 291132718Skan "@ 292132718Skan dvf%?d\\t%0, %1, %2 293132718Skan rdf%?d\\t%0, %2, %1" 294132718Skan [(set_attr "type" "fdivd") 295132718Skan (set_attr "predicable" "yes")] 296132718Skan) 297132718Skan 298132718Skan(define_insn "*divdf_esfdf_df_fpa" 299132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 300132718Skan (div:DF (float_extend:DF 301132718Skan (match_operand:SF 1 "s_register_operand" "f")) 302169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 303169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 304132718Skan "dvf%?d\\t%0, %1, %2" 305132718Skan [(set_attr "type" "fdivd") 306132718Skan (set_attr "predicable" "yes")] 307132718Skan) 308132718Skan 309132718Skan(define_insn "*divdf_df_esfdf_fpa" 310132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 311169689Skan (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "fG") 312132718Skan (float_extend:DF 313132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 314169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 315132718Skan "rdf%?d\\t%0, %2, %1" 316132718Skan [(set_attr "type" "fdivd") 317132718Skan (set_attr "predicable" "yes")] 318132718Skan) 319132718Skan 320132718Skan(define_insn "*divdf_esfdf_esfdf_fpa" 321132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 322132718Skan (div:DF (float_extend:DF 323132718Skan (match_operand:SF 1 "s_register_operand" "f")) 324132718Skan (float_extend:DF 325132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 326169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 327132718Skan "dvf%?d\\t%0, %1, %2" 328132718Skan [(set_attr "type" "fdivd") 329132718Skan (set_attr "predicable" "yes")] 330132718Skan) 331132718Skan 332132718Skan(define_insn "*modsf3_fpa" 333132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 334132718Skan (mod:SF (match_operand:SF 1 "s_register_operand" "f") 335169689Skan (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] 336169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 337132718Skan "rmf%?s\\t%0, %1, %2" 338132718Skan [(set_attr "type" "fdivs") 339132718Skan (set_attr "predicable" "yes")] 340132718Skan) 341132718Skan 342132718Skan(define_insn "*moddf3_fpa" 343132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 344132718Skan (mod:DF (match_operand:DF 1 "s_register_operand" "f") 345169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 346169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 347132718Skan "rmf%?d\\t%0, %1, %2" 348132718Skan [(set_attr "type" "fdivd") 349132718Skan (set_attr "predicable" "yes")] 350132718Skan) 351132718Skan 352132718Skan(define_insn "*moddf_esfdf_df_fpa" 353132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 354132718Skan (mod:DF (float_extend:DF 355132718Skan (match_operand:SF 1 "s_register_operand" "f")) 356169689Skan (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] 357169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 358132718Skan "rmf%?d\\t%0, %1, %2" 359132718Skan [(set_attr "type" "fdivd") 360132718Skan (set_attr "predicable" "yes")] 361132718Skan) 362132718Skan 363132718Skan(define_insn "*moddf_df_esfdf_fpa" 364132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 365132718Skan (mod:DF (match_operand:DF 1 "s_register_operand" "f") 366132718Skan (float_extend:DF 367132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 368169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 369132718Skan "rmf%?d\\t%0, %1, %2" 370132718Skan [(set_attr "type" "fdivd") 371132718Skan (set_attr "predicable" "yes")] 372132718Skan) 373132718Skan 374132718Skan(define_insn "*moddf_esfdf_esfdf_fpa" 375132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 376132718Skan (mod:DF (float_extend:DF 377132718Skan (match_operand:SF 1 "s_register_operand" "f")) 378132718Skan (float_extend:DF 379132718Skan (match_operand:SF 2 "s_register_operand" "f"))))] 380169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 381132718Skan "rmf%?d\\t%0, %1, %2" 382132718Skan [(set_attr "type" "fdivd") 383132718Skan (set_attr "predicable" "yes")] 384132718Skan) 385132718Skan 386132718Skan(define_insn "*negsf2_fpa" 387132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 388132718Skan (neg:SF (match_operand:SF 1 "s_register_operand" "f")))] 389169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 390132718Skan "mnf%?s\\t%0, %1" 391132718Skan [(set_attr "type" "ffarith") 392132718Skan (set_attr "predicable" "yes")] 393132718Skan) 394132718Skan 395132718Skan(define_insn "*negdf2_fpa" 396132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 397132718Skan (neg:DF (match_operand:DF 1 "s_register_operand" "f")))] 398169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 399132718Skan "mnf%?d\\t%0, %1" 400132718Skan [(set_attr "type" "ffarith") 401132718Skan (set_attr "predicable" "yes")] 402132718Skan) 403132718Skan 404132718Skan(define_insn "*negdf_esfdf_fpa" 405132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 406132718Skan (neg:DF (float_extend:DF 407132718Skan (match_operand:SF 1 "s_register_operand" "f"))))] 408169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 409132718Skan "mnf%?d\\t%0, %1" 410132718Skan [(set_attr "type" "ffarith") 411132718Skan (set_attr "predicable" "yes")] 412132718Skan) 413132718Skan 414132718Skan(define_insn "*abssf2_fpa" 415132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 416132718Skan (abs:SF (match_operand:SF 1 "s_register_operand" "f")))] 417169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 418132718Skan "abs%?s\\t%0, %1" 419132718Skan [(set_attr "type" "ffarith") 420132718Skan (set_attr "predicable" "yes")] 421132718Skan) 422132718Skan 423132718Skan(define_insn "*absdf2_fpa" 424132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 425132718Skan (abs:DF (match_operand:DF 1 "s_register_operand" "f")))] 426169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 427132718Skan "abs%?d\\t%0, %1" 428132718Skan [(set_attr "type" "ffarith") 429132718Skan (set_attr "predicable" "yes")] 430132718Skan) 431132718Skan 432132718Skan(define_insn "*absdf_esfdf_fpa" 433132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 434132718Skan (abs:DF (float_extend:DF 435132718Skan (match_operand:SF 1 "s_register_operand" "f"))))] 436169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 437132718Skan "abs%?d\\t%0, %1" 438132718Skan [(set_attr "type" "ffarith") 439132718Skan (set_attr "predicable" "yes")] 440132718Skan) 441132718Skan 442132718Skan(define_insn "*sqrtsf2_fpa" 443132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 444132718Skan (sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))] 445169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 446132718Skan "sqt%?s\\t%0, %1" 447132718Skan [(set_attr "type" "float_em") 448132718Skan (set_attr "predicable" "yes")] 449132718Skan) 450132718Skan 451132718Skan(define_insn "*sqrtdf2_fpa" 452132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 453132718Skan (sqrt:DF (match_operand:DF 1 "s_register_operand" "f")))] 454169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 455132718Skan "sqt%?d\\t%0, %1" 456132718Skan [(set_attr "type" "float_em") 457132718Skan (set_attr "predicable" "yes")] 458132718Skan) 459132718Skan 460132718Skan(define_insn "*sqrtdf_esfdf_fpa" 461132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 462132718Skan (sqrt:DF (float_extend:DF 463132718Skan (match_operand:SF 1 "s_register_operand" "f"))))] 464169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 465132718Skan "sqt%?d\\t%0, %1" 466132718Skan [(set_attr "type" "float_em") 467132718Skan (set_attr "predicable" "yes")] 468132718Skan) 469132718Skan 470132718Skan(define_insn "*floatsisf2_fpa" 471132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 472132718Skan (float:SF (match_operand:SI 1 "s_register_operand" "r")))] 473169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 474132718Skan "flt%?s\\t%0, %1" 475132718Skan [(set_attr "type" "r_2_f") 476132718Skan (set_attr "predicable" "yes")] 477132718Skan) 478132718Skan 479132718Skan(define_insn "*floatsidf2_fpa" 480132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 481132718Skan (float:DF (match_operand:SI 1 "s_register_operand" "r")))] 482169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 483132718Skan "flt%?d\\t%0, %1" 484132718Skan [(set_attr "type" "r_2_f") 485132718Skan (set_attr "predicable" "yes")] 486132718Skan) 487132718Skan 488132718Skan(define_insn "*fix_truncsfsi2_fpa" 489132718Skan [(set (match_operand:SI 0 "s_register_operand" "=r") 490132718Skan (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "f"))))] 491169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 492132718Skan "fix%?z\\t%0, %1" 493132718Skan [(set_attr "type" "f_2_r") 494132718Skan (set_attr "predicable" "yes")] 495132718Skan) 496132718Skan 497132718Skan(define_insn "*fix_truncdfsi2_fpa" 498132718Skan [(set (match_operand:SI 0 "s_register_operand" "=r") 499132718Skan (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "f"))))] 500169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 501132718Skan "fix%?z\\t%0, %1" 502132718Skan [(set_attr "type" "f_2_r") 503132718Skan (set_attr "predicable" "yes")] 504132718Skan) 505132718Skan 506132718Skan(define_insn "*truncdfsf2_fpa" 507132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f") 508132718Skan (float_truncate:SF 509132718Skan (match_operand:DF 1 "s_register_operand" "f")))] 510169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 511132718Skan "mvf%?s\\t%0, %1" 512132718Skan [(set_attr "type" "ffarith") 513132718Skan (set_attr "predicable" "yes")] 514132718Skan) 515132718Skan 516132718Skan(define_insn "*extendsfdf2_fpa" 517132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f") 518132718Skan (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")))] 519169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 520132718Skan "mvf%?d\\t%0, %1" 521132718Skan [(set_attr "type" "ffarith") 522132718Skan (set_attr "predicable" "yes")] 523132718Skan) 524132718Skan 525132718Skan(define_insn "*movsf_fpa" 526132718Skan [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f, m,f,r,r,r, m") 527132718Skan (match_operand:SF 1 "general_operand" "fG,H,mE,f,r,f,r,mE,r"))] 528132718Skan "TARGET_ARM 529169689Skan && TARGET_HARD_FLOAT && TARGET_FPA 530132718Skan && (GET_CODE (operands[0]) != MEM 531132718Skan || register_operand (operands[1], SFmode))" 532132718Skan "@ 533132718Skan mvf%?s\\t%0, %1 534132718Skan mnf%?s\\t%0, #%N1 535132718Skan ldf%?s\\t%0, %1 536132718Skan stf%?s\\t%1, %0 537132718Skan str%?\\t%1, [%|sp, #-4]!\;ldf%?s\\t%0, [%|sp], #4 538132718Skan stf%?s\\t%1, [%|sp, #-4]!\;ldr%?\\t%0, [%|sp], #4 539132718Skan mov%?\\t%0, %1 540132718Skan ldr%?\\t%0, %1\\t%@ float 541132718Skan str%?\\t%1, %0\\t%@ float" 542132718Skan [(set_attr "length" "4,4,4,4,8,8,4,4,4") 543132718Skan (set_attr "predicable" "yes") 544132718Skan (set_attr "type" 545169689Skan "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1") 546132718Skan (set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*") 547132718Skan (set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")] 548132718Skan) 549132718Skan 550132718Skan(define_insn "*movdf_fpa" 551132718Skan [(set (match_operand:DF 0 "nonimmediate_operand" 552132718Skan "=r,Q,r,m,r, f, f,f, m,!f,!r") 553132718Skan (match_operand:DF 1 "general_operand" 554132718Skan "Q, r,r,r,mF,fG,H,mF,f,r, f"))] 555132718Skan "TARGET_ARM 556169689Skan && TARGET_HARD_FLOAT && TARGET_FPA 557132718Skan && (GET_CODE (operands[0]) != MEM 558132718Skan || register_operand (operands[1], DFmode))" 559132718Skan "* 560132718Skan { 561132718Skan switch (which_alternative) 562132718Skan { 563132718Skan default: 564132718Skan case 0: return \"ldm%?ia\\t%m1, %M0\\t%@ double\"; 565132718Skan case 1: return \"stm%?ia\\t%m0, %M1\\t%@ double\"; 566169689Skan case 2: return \"#\"; 567169689Skan case 3: case 4: return output_move_double (operands); 568132718Skan case 5: return \"mvf%?d\\t%0, %1\"; 569132718Skan case 6: return \"mnf%?d\\t%0, #%N1\"; 570132718Skan case 7: return \"ldf%?d\\t%0, %1\"; 571132718Skan case 8: return \"stf%?d\\t%1, %0\"; 572132718Skan case 9: return output_mov_double_fpa_from_arm (operands); 573132718Skan case 10: return output_mov_double_arm_from_fpa (operands); 574132718Skan } 575132718Skan } 576132718Skan " 577132718Skan [(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8") 578132718Skan (set_attr "predicable" "yes") 579132718Skan (set_attr "type" 580169689Skan "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") 581132718Skan (set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*") 582132718Skan (set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")] 583132718Skan) 584132718Skan 585169689Skan;; We treat XFmode as meaning 'internal format'. It's the right size and we 586169689Skan;; don't use it for anything else. We only support moving between FPA 587169689Skan;; registers and moving an FPA register to/from memory. 588132718Skan(define_insn "*movxf_fpa" 589169689Skan [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,m") 590169689Skan (match_operand:XF 1 "general_operand" "f,m,f"))] 591169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA 592169689Skan && (register_operand (operands[0], XFmode) 593169689Skan || register_operand (operands[1], XFmode))" 594132718Skan "* 595132718Skan switch (which_alternative) 596132718Skan { 597132718Skan default: 598132718Skan case 0: return \"mvf%?e\\t%0, %1\"; 599169689Skan case 1: if (arm_fpu_arch == FPUTYPE_FPA_EMU2) 600169689Skan return \"ldf%?e\\t%0, %1\"; 601169689Skan return \"lfm%?\\t%0, 1, %1\"; 602169689Skan case 2: if (arm_fpu_arch == FPUTYPE_FPA_EMU2) 603169689Skan return \"stf%?e\\t%1, %0\"; 604169689Skan return \"sfm%?\\t%1, 1, %0\"; 605132718Skan } 606132718Skan " 607169689Skan [(set_attr "length" "4,4,4") 608132718Skan (set_attr "predicable" "yes") 609169689Skan (set_attr "type" "ffarith,f_load,f_store")] 610132718Skan) 611132718Skan 612132718Skan(define_insn "*cmpsf_fpa" 613132718Skan [(set (reg:CCFP CC_REGNUM) 614132718Skan (compare:CCFP (match_operand:SF 0 "s_register_operand" "f,f") 615169689Skan (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] 616169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 617132718Skan "@ 618132718Skan cmf%?\\t%0, %1 619132718Skan cnf%?\\t%0, #%N1" 620132718Skan [(set_attr "conds" "set") 621132718Skan (set_attr "type" "f_2_r")] 622132718Skan) 623132718Skan 624132718Skan(define_insn "*cmpdf_fpa" 625132718Skan [(set (reg:CCFP CC_REGNUM) 626132718Skan (compare:CCFP (match_operand:DF 0 "s_register_operand" "f,f") 627169689Skan (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] 628169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 629132718Skan "@ 630132718Skan cmf%?\\t%0, %1 631132718Skan cnf%?\\t%0, #%N1" 632132718Skan [(set_attr "conds" "set") 633132718Skan (set_attr "type" "f_2_r")] 634132718Skan) 635132718Skan 636132718Skan(define_insn "*cmpesfdf_df_fpa" 637132718Skan [(set (reg:CCFP CC_REGNUM) 638132718Skan (compare:CCFP (float_extend:DF 639132718Skan (match_operand:SF 0 "s_register_operand" "f,f")) 640169689Skan (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] 641169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 642132718Skan "@ 643132718Skan cmf%?\\t%0, %1 644132718Skan cnf%?\\t%0, #%N1" 645132718Skan [(set_attr "conds" "set") 646132718Skan (set_attr "type" "f_2_r")] 647132718Skan) 648132718Skan 649132718Skan(define_insn "*cmpdf_esfdf_fpa" 650132718Skan [(set (reg:CCFP CC_REGNUM) 651132718Skan (compare:CCFP (match_operand:DF 0 "s_register_operand" "f") 652132718Skan (float_extend:DF 653132718Skan (match_operand:SF 1 "s_register_operand" "f"))))] 654169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 655132718Skan "cmf%?\\t%0, %1" 656132718Skan [(set_attr "conds" "set") 657132718Skan (set_attr "type" "f_2_r")] 658132718Skan) 659132718Skan 660132718Skan(define_insn "*cmpsf_trap_fpa" 661132718Skan [(set (reg:CCFPE CC_REGNUM) 662132718Skan (compare:CCFPE (match_operand:SF 0 "s_register_operand" "f,f") 663169689Skan (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] 664169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 665132718Skan "@ 666132718Skan cmf%?e\\t%0, %1 667132718Skan cnf%?e\\t%0, #%N1" 668132718Skan [(set_attr "conds" "set") 669132718Skan (set_attr "type" "f_2_r")] 670132718Skan) 671132718Skan 672132718Skan(define_insn "*cmpdf_trap_fpa" 673132718Skan [(set (reg:CCFPE CC_REGNUM) 674132718Skan (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f,f") 675169689Skan (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] 676169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 677132718Skan "@ 678132718Skan cmf%?e\\t%0, %1 679132718Skan cnf%?e\\t%0, #%N1" 680132718Skan [(set_attr "conds" "set") 681132718Skan (set_attr "type" "f_2_r")] 682132718Skan) 683132718Skan 684132718Skan(define_insn "*cmp_esfdf_df_trap_fpa" 685132718Skan [(set (reg:CCFPE CC_REGNUM) 686132718Skan (compare:CCFPE (float_extend:DF 687132718Skan (match_operand:SF 0 "s_register_operand" "f,f")) 688169689Skan (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] 689169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 690132718Skan "@ 691132718Skan cmf%?e\\t%0, %1 692132718Skan cnf%?e\\t%0, #%N1" 693132718Skan [(set_attr "conds" "set") 694132718Skan (set_attr "type" "f_2_r")] 695132718Skan) 696132718Skan 697132718Skan(define_insn "*cmp_df_esfdf_trap_fpa" 698132718Skan [(set (reg:CCFPE CC_REGNUM) 699132718Skan (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f") 700132718Skan (float_extend:DF 701132718Skan (match_operand:SF 1 "s_register_operand" "f"))))] 702169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 703132718Skan "cmf%?e\\t%0, %1" 704132718Skan [(set_attr "conds" "set") 705132718Skan (set_attr "type" "f_2_r")] 706132718Skan) 707132718Skan 708132718Skan(define_insn "*movsfcc_fpa" 709132718Skan [(set (match_operand:SF 0 "s_register_operand" "=f,f,f,f,f,f,f,f") 710132718Skan (if_then_else:SF 711132718Skan (match_operator 3 "arm_comparison_operator" 712132718Skan [(match_operand 4 "cc_register" "") (const_int 0)]) 713169689Skan (match_operand:SF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") 714169689Skan (match_operand:SF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] 715169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 716132718Skan "@ 717132718Skan mvf%D3s\\t%0, %2 718132718Skan mnf%D3s\\t%0, #%N2 719132718Skan mvf%d3s\\t%0, %1 720132718Skan mnf%d3s\\t%0, #%N1 721132718Skan mvf%d3s\\t%0, %1\;mvf%D3s\\t%0, %2 722132718Skan mvf%d3s\\t%0, %1\;mnf%D3s\\t%0, #%N2 723132718Skan mnf%d3s\\t%0, #%N1\;mvf%D3s\\t%0, %2 724132718Skan mnf%d3s\\t%0, #%N1\;mnf%D3s\\t%0, #%N2" 725132718Skan [(set_attr "length" "4,4,4,4,8,8,8,8") 726132718Skan (set_attr "type" "ffarith") 727132718Skan (set_attr "conds" "use")] 728132718Skan) 729132718Skan 730132718Skan(define_insn "*movdfcc_fpa" 731132718Skan [(set (match_operand:DF 0 "s_register_operand" "=f,f,f,f,f,f,f,f") 732132718Skan (if_then_else:DF 733132718Skan (match_operator 3 "arm_comparison_operator" 734132718Skan [(match_operand 4 "cc_register" "") (const_int 0)]) 735169689Skan (match_operand:DF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") 736169689Skan (match_operand:DF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] 737169689Skan "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" 738132718Skan "@ 739132718Skan mvf%D3d\\t%0, %2 740132718Skan mnf%D3d\\t%0, #%N2 741132718Skan mvf%d3d\\t%0, %1 742132718Skan mnf%d3d\\t%0, #%N1 743132718Skan mvf%d3d\\t%0, %1\;mvf%D3d\\t%0, %2 744132718Skan mvf%d3d\\t%0, %1\;mnf%D3d\\t%0, #%N2 745132718Skan mnf%d3d\\t%0, #%N1\;mvf%D3d\\t%0, %2 746132718Skan mnf%d3d\\t%0, #%N1\;mnf%D3d\\t%0, #%N2" 747132718Skan [(set_attr "length" "4,4,4,4,8,8,8,8") 748132718Skan (set_attr "type" "ffarith") 749132718Skan (set_attr "conds" "use")] 750132718Skan) 751