;; ARM 926EJ-S Pipeline Description
|
;; ARM 926EJ-S Pipeline Description
|
;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
|
;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
|
;; Written by CodeSourcery, LLC.
|
;; Written by CodeSourcery, LLC.
|
;;
|
;;
|
;; This file is part of GCC.
|
;; This file is part of GCC.
|
;;
|
;;
|
;; GCC is free software; you can redistribute it and/or modify it
|
;; GCC is free software; you can redistribute it and/or modify it
|
;; under the terms of the GNU General Public License as published by
|
;; under the terms of the GNU General Public License as published by
|
;; the Free Software Foundation; either version 3, or (at your option)
|
;; the Free Software Foundation; either version 3, or (at your option)
|
;; any later version.
|
;; any later version.
|
;;
|
;;
|
;; GCC is distributed in the hope that it will be useful, but
|
;; GCC is distributed in the hope that it will be useful, but
|
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
;; General Public License for more details.
|
;; General Public License for more details.
|
;;
|
;;
|
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
;; along with GCC; see the file COPYING3. If not see
|
;; along with GCC; see the file COPYING3. If not see
|
;; . */
|
;; . */
|
|
|
;; These descriptions are based on the information contained in the
|
;; These descriptions are based on the information contained in the
|
;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM
|
;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM
|
;; Limited.
|
;; Limited.
|
;;
|
;;
|
|
|
;; This automaton provides a pipeline description for the ARM
|
;; This automaton provides a pipeline description for the ARM
|
;; 926EJ-S core.
|
;; 926EJ-S core.
|
;;
|
;;
|
;; The model given here assumes that the condition for all conditional
|
;; The model given here assumes that the condition for all conditional
|
;; instructions is "true", i.e., that all of the instructions are
|
;; instructions is "true", i.e., that all of the instructions are
|
;; actually executed.
|
;; actually executed.
|
|
|
(define_automaton "arm926ejs")
|
(define_automaton "arm926ejs")
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Pipelines
|
;; Pipelines
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; There is a single pipeline
|
;; There is a single pipeline
|
;;
|
;;
|
;; The ALU pipeline has fetch, decode, execute, memory, and
|
;; The ALU pipeline has fetch, decode, execute, memory, and
|
;; write stages. We only need to model the execute, memory and write
|
;; write stages. We only need to model the execute, memory and write
|
;; stages.
|
;; stages.
|
|
|
(define_cpu_unit "e,m,w" "arm926ejs")
|
(define_cpu_unit "e,m,w" "arm926ejs")
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ALU Instructions
|
;; ALU Instructions
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; ALU instructions require three cycles to execute, and use the ALU
|
;; ALU instructions require three cycles to execute, and use the ALU
|
;; pipeline in each of the three stages. The results are available
|
;; pipeline in each of the three stages. The results are available
|
;; after the execute stage stage has finished.
|
;; after the execute stage stage has finished.
|
;;
|
;;
|
;; If the destination register is the PC, the pipelines are stalled
|
;; If the destination register is the PC, the pipelines are stalled
|
;; for several cycles. That case is not modeled here.
|
;; for several cycles. That case is not modeled here.
|
|
|
;; ALU operations with no shifted operand
|
;; ALU operations with no shifted operand
|
(define_insn_reservation "9_alu_op" 1
|
(define_insn_reservation "9_alu_op" 1
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "alu,alu_shift"))
|
(eq_attr "type" "alu,alu_shift"))
|
"e,m,w")
|
"e,m,w")
|
|
|
;; ALU operations with a shift-by-register operand
|
;; ALU operations with a shift-by-register operand
|
;; These really stall in the decoder, in order to read
|
;; These really stall in the decoder, in order to read
|
;; the shift value in a second cycle. Pretend we take two cycles in
|
;; the shift value in a second cycle. Pretend we take two cycles in
|
;; the execute stage.
|
;; the execute stage.
|
(define_insn_reservation "9_alu_shift_reg_op" 2
|
(define_insn_reservation "9_alu_shift_reg_op" 2
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "alu_shift_reg"))
|
(eq_attr "type" "alu_shift_reg"))
|
"e*2,m,w")
|
"e*2,m,w")
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Multiplication Instructions
|
;; Multiplication Instructions
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; Multiplication instructions loop in the execute stage until the
|
;; Multiplication instructions loop in the execute stage until the
|
;; instruction has been passed through the multiplier array enough
|
;; instruction has been passed through the multiplier array enough
|
;; times. Multiply operations occur in both the execute and memory
|
;; times. Multiply operations occur in both the execute and memory
|
;; stages of the pipeline
|
;; stages of the pipeline
|
|
|
(define_insn_reservation "9_mult1" 3
|
(define_insn_reservation "9_mult1" 3
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "smlalxy,mul,mla"))
|
(eq_attr "insn" "smlalxy,mul,mla"))
|
"e*2,m,w")
|
"e*2,m,w")
|
|
|
(define_insn_reservation "9_mult2" 4
|
(define_insn_reservation "9_mult2" 4
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "muls,mlas"))
|
(eq_attr "insn" "muls,mlas"))
|
"e*3,m,w")
|
"e*3,m,w")
|
|
|
(define_insn_reservation "9_mult3" 4
|
(define_insn_reservation "9_mult3" 4
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "umull,umlal,smull,smlal"))
|
(eq_attr "insn" "umull,umlal,smull,smlal"))
|
"e*3,m,w")
|
"e*3,m,w")
|
|
|
(define_insn_reservation "9_mult4" 5
|
(define_insn_reservation "9_mult4" 5
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "umulls,umlals,smulls,smlals"))
|
(eq_attr "insn" "umulls,umlals,smulls,smlals"))
|
"e*4,m,w")
|
"e*4,m,w")
|
|
|
(define_insn_reservation "9_mult5" 2
|
(define_insn_reservation "9_mult5" 2
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "smulxy,smlaxy,smlawx"))
|
(eq_attr "insn" "smulxy,smlaxy,smlawx"))
|
"e,m,w")
|
"e,m,w")
|
|
|
(define_insn_reservation "9_mult6" 3
|
(define_insn_reservation "9_mult6" 3
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "insn" "smlalxy"))
|
(eq_attr "insn" "smlalxy"))
|
"e*2,m,w")
|
"e*2,m,w")
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Load/Store Instructions
|
;; Load/Store Instructions
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; The models for load/store instructions do not accurately describe
|
;; The models for load/store instructions do not accurately describe
|
;; the difference between operations with a base register writeback
|
;; the difference between operations with a base register writeback
|
;; (such as "ldm!"). These models assume that all memory references
|
;; (such as "ldm!"). These models assume that all memory references
|
;; hit in dcache.
|
;; hit in dcache.
|
|
|
;; Loads with a shifted offset take 3 cycles, and are (a) probably the
|
;; Loads with a shifted offset take 3 cycles, and are (a) probably the
|
;; most common and (b) the pessimistic assumption will lead to fewer stalls.
|
;; most common and (b) the pessimistic assumption will lead to fewer stalls.
|
(define_insn_reservation "9_load1_op" 3
|
(define_insn_reservation "9_load1_op" 3
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "load1,load_byte"))
|
(eq_attr "type" "load1,load_byte"))
|
"e*2,m,w")
|
"e*2,m,w")
|
|
|
(define_insn_reservation "9_store1_op" 0
|
(define_insn_reservation "9_store1_op" 0
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "store1"))
|
(eq_attr "type" "store1"))
|
"e,m,w")
|
"e,m,w")
|
|
|
;; multiple word loads and stores
|
;; multiple word loads and stores
|
(define_insn_reservation "9_load2_op" 3
|
(define_insn_reservation "9_load2_op" 3
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "load2"))
|
(eq_attr "type" "load2"))
|
"e,m*2,w")
|
"e,m*2,w")
|
|
|
(define_insn_reservation "9_load3_op" 4
|
(define_insn_reservation "9_load3_op" 4
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "load3"))
|
(eq_attr "type" "load3"))
|
"e,m*3,w")
|
"e,m*3,w")
|
|
|
(define_insn_reservation "9_load4_op" 5
|
(define_insn_reservation "9_load4_op" 5
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "load4"))
|
(eq_attr "type" "load4"))
|
"e,m*4,w")
|
"e,m*4,w")
|
|
|
(define_insn_reservation "9_store2_op" 0
|
(define_insn_reservation "9_store2_op" 0
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "store2"))
|
(eq_attr "type" "store2"))
|
"e,m*2,w")
|
"e,m*2,w")
|
|
|
(define_insn_reservation "9_store3_op" 0
|
(define_insn_reservation "9_store3_op" 0
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "store3"))
|
(eq_attr "type" "store3"))
|
"e,m*3,w")
|
"e,m*3,w")
|
|
|
(define_insn_reservation "9_store4_op" 0
|
(define_insn_reservation "9_store4_op" 0
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "store4"))
|
(eq_attr "type" "store4"))
|
"e,m*4,w")
|
"e,m*4,w")
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Branch and Call Instructions
|
;; Branch and Call Instructions
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
;; Branch instructions are difficult to model accurately. The ARM
|
;; Branch instructions are difficult to model accurately. The ARM
|
;; core can predict most branches. If the branch is predicted
|
;; core can predict most branches. If the branch is predicted
|
;; correctly, and predicted early enough, the branch can be completely
|
;; correctly, and predicted early enough, the branch can be completely
|
;; eliminated from the instruction stream. Some branches can
|
;; eliminated from the instruction stream. Some branches can
|
;; therefore appear to require zero cycles to execute. We assume that
|
;; therefore appear to require zero cycles to execute. We assume that
|
;; all branches are predicted correctly, and that the latency is
|
;; all branches are predicted correctly, and that the latency is
|
;; therefore the minimum value.
|
;; therefore the minimum value.
|
|
|
(define_insn_reservation "9_branch_op" 0
|
(define_insn_reservation "9_branch_op" 0
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "branch"))
|
(eq_attr "type" "branch"))
|
"nothing")
|
"nothing")
|
|
|
;; The latency for a call is not predictable. Therefore, we use 32 as
|
;; The latency for a call is not predictable. Therefore, we use 32 as
|
;; roughly equivalent to positive infinity.
|
;; roughly equivalent to positive infinity.
|
|
|
(define_insn_reservation "9_call_op" 32
|
(define_insn_reservation "9_call_op" 32
|
(and (eq_attr "tune" "arm926ejs")
|
(and (eq_attr "tune" "arm926ejs")
|
(eq_attr "type" "call"))
|
(eq_attr "type" "call"))
|
"nothing")
|
"nothing")
|
|
|