| 1 |
;; Scheduling description for LEON. |
| 2 |
;; Copyright (C) 2010-2025 Free Software Foundation, Inc. |
| 3 |
;; |
| 4 |
;; This file is part of GCC. |
| 5 |
;; |
| 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) |
| 9 |
;; any later version. |
| 10 |
;; |
| 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. |
| 15 |
;; |
| 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/>. |
| 19 |
|
| 20 |
;; Leon is a single-issue processor. |
| 21 |
|
| 22 |
(define_automaton "leon") |
| 23 |
|
| 24 |
(define_cpu_unit "leon_memory" "leon") |
| 25 |
|
| 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"))) |
| 29 |
"leon_memory") |
| 30 |
|
| 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"))) |
| 35 |
"leon_memory*2") |
| 36 |
|
| 37 |
(define_insn_reservation "leon_store" 2 |
| 38 |
(and (eq_attr "cpu" "leon,leon3,leon3v7") (eq_attr "type" "store")) |
| 39 |
"leon_memory*2") |
| 40 |
|
| 41 |
;; This describes Gaisler Research's FPU |
| 42 |
|
| 43 |
(define_automaton "grfpu") |
| 44 |
|
| 45 |
(define_cpu_unit "grfpu_alu" "grfpu") |
| 46 |
(define_cpu_unit "grfpu_ds" "grfpu") |
| 47 |
|
| 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") |
| 51 |
|
| 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") |
| 55 |
|
| 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") |
| 59 |
|
| 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") |
| 63 |
|
| 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") |