1 ;; Scheduling description for LEON.
2 ;; Copyright (C) 2010-2024 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 3, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
20 ;; Leon is a single-issue processor.
22 (define_automaton "leon")
24 (define_cpu_unit "leon_memory" "leon")
26 (define_insn_reservation "leon_load" 1
27 (and (eq_attr "cpu" "leon,leon3,leon3v7")
28 (and (eq_attr "fix_ut699" "false") (eq_attr "type" "load,sload")))
31 ;; Use a double reservation to work around the load pipeline hazard on UT699.
32 (define_insn_reservation "ut699_load" 1
33 (and (eq_attr "cpu" "leon,leon3,leon3v7")
34 (and (eq_attr "fix_ut699" "true") (eq_attr "type" "load,sload")))
37 (define_insn_reservation "leon_store" 2
38 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "store"))
41 ;; This describes Gaisler Research's FPU
43 (define_automaton "grfpu")
45 (define_cpu_unit "grfpu_alu" "grfpu")
46 (define_cpu_unit "grfpu_ds" "grfpu")
48 (define_insn_reservation "leon_fp_alu" 4
49 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fp,fpcmp,fpmul"))
50 "grfpu_alu, nothing*3")
52 (define_insn_reservation "leon_fp_divs" 16
53 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpdivs"))
54 "grfpu_ds*14, nothing*2")
56 (define_insn_reservation "leon_fp_divd" 17
57 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpdivd"))
58 "grfpu_ds*15, nothing*2")
60 (define_insn_reservation "leon_fp_sqrts" 24
61 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpsqrts"))
62 "grfpu_ds*22, nothing*2")
64 (define_insn_reservation "leon_fp_sqrtd" 25
65 (and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "fpsqrtd"))
66 "grfpu_ds*23, nothing*2")