📄 rs6000.md
字号:
;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,;; 2000, 2001 Free Software Foundation, Inc.;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu);; This file is part of GNU CC.;; GNU CC is free software; you can redistribute it and/or modify;; it under the terms of the GNU General Public License as published by;; the Free Software Foundation; either version 2, or (at your option);; any later version.;; GNU CC is distributed in the hope that it will be useful,;; but WITHOUT ANY WARRANTY; without even the implied warranty of;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the;; GNU General Public License for more details.;; You should have received a copy of the GNU General Public License;; along with GNU CC; see the file COPYING. If not, write to;; the Free Software Foundation, 59 Temple Place - Suite 330,;; Boston, MA 02111-1307, USA.;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.;; Define an insn type attribute. This is used in function unit delay;; computations.(define_attr "type" "integer,load,store,fpload,fpstore,imul,idiv,branch,compare,delayed_compare,fpcompare,mtjmpr,fp,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg" (const_string "integer"));; Length (in bytes).; '(pc)' in the following doesn't include the instruction itself; it is ; calculated as if the instruction had zero size.(define_attr "length" "" (if_then_else (eq_attr "type" "branch") (if_then_else (and (ge (minus (match_dup 0) (pc)) (const_int -32768)) (lt (minus (match_dup 0) (pc)) (const_int 32764))) (const_int 8) (const_int 12)) (const_int 4)));; Processor type -- this attribute must exactly match the processor_type;; enumeration in rs6000.h.(define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750" (const (symbol_ref "rs6000_cpu_attr"))); (define_function_unit NAME MULTIPLICITY SIMULTANEITY; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST]); Load/Store Unit -- pure PowerPC only; (POWER and 601 use Integer Unit)(define_function_unit "lsu" 1 0 (and (eq_attr "type" "load") (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620,ppc750")) 2 1)(define_function_unit "lsu" 1 0 (and (eq_attr "type" "store,fpstore") (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620,ppc750")) 1 1)(define_function_unit "lsu" 1 0 (and (eq_attr "type" "fpload") (eq_attr "cpu" "mpccore,ppc603,ppc750")) 2 1)(define_function_unit "lsu" 1 0 (and (eq_attr "type" "fpload") (eq_attr "cpu" "ppc604,ppc604e,ppc620")) 3 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "load") (eq_attr "cpu" "rios1,ppc403,ppc601")) 2 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "store,fpstore") (eq_attr "cpu" "rios1,ppc403,ppc601")) 1 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fpstore") (eq_attr "cpu" "rios1,ppc601")) 0 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "fpload") (eq_attr "cpu" "rios1")) 2 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "fpload") (eq_attr "cpu" "ppc601")) 3 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "load,fpload") (eq_attr "cpu" "rios2")) 2 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "store,fpstore") (eq_attr "cpu" "rios2")) 1 1); Integer Unit (RIOS1, PPC601, PPC603)(define_function_unit "iu" 1 0 (and (eq_attr "type" "integer") (eq_attr "cpu" "rios1,mpccore,ppc403,ppc601,ppc603")) 1 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "ppc403")) 4 4)(define_function_unit "iu" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "rios1,ppc601,ppc603")) 5 5)(define_function_unit "iu" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "rios1")) 19 19)(define_function_unit "iu" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "ppc403")) 33 33)(define_function_unit "iu" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "ppc601")) 36 36)(define_function_unit "iu" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "ppc603")) 37 36); RIOS2 has two integer units: a primary one which can perform all; operations and a secondary one which is fed in lock step with the first; and can perform "simple" integer operations. ; To catch this we define a 'dummy' imuldiv-unit that is also needed; for the complex insns. (define_function_unit "iu2" 2 0 (and (eq_attr "type" "integer") (eq_attr "cpu" "rios2")) 1 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "rios2")) 2 2)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "rios2")) 13 13)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "rios2")) 2 2)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "rios2")) 13 13); MPCCORE has separate IMUL/IDIV unit for multicycle instructions; Divide latency varies greatly from 2-11, use 6 as average(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "mpccore")) 2 1)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "mpccore")) 6 6); PPC604{,e} has two units that perform integer operations; and one unit for divide/multiply operations (and move; from/to spr).(define_function_unit "iu2" 2 0 (and (eq_attr "type" "integer") (eq_attr "cpu" "ppc604,ppc604e,ppc620")) 1 1)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "ppc604,ppc620")) 4 2)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "ppc604e")) 2 1)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "ppc604,ppc604e,ppc620")) 20 19); PPC750 has two integer units: a primary one which can perform all; operations and a secondary one which is fed in lock step with the first; and can perform "simple" integer operations. ; To catch this we define a 'dummy' imuldiv-unit that is also needed; for the complex insns. (define_function_unit "iu2" 2 0 (and (eq_attr "type" "integer") (eq_attr "cpu" "ppc750")) 1 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "ppc750")) 4 2)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "imul") (eq_attr "cpu" "ppc750")) 4 2)(define_function_unit "imuldiv" 1 0 (and (eq_attr "type" "idiv") (eq_attr "cpu" "ppc750")) 19 19); compare is done on integer unit, but feeds insns which; execute on the branch unit.(define_function_unit "iu" 1 0 (and (eq_attr "type" "compare") (eq_attr "cpu" "rios1")) 4 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "delayed_compare") (eq_attr "cpu" "rios1")) 5 1)(define_function_unit "iu" 1 0 (and (eq_attr "type" "compare,delayed_compare") (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750")) 3 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "compare,delayed_compare") (eq_attr "cpu" "rios2")) 3 1)(define_function_unit "iu2" 2 0 (and (eq_attr "type" "compare,delayed_compare") (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc750")) 1 1); fp compare uses fp unit(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fpcompare") (eq_attr "cpu" "rios1")) 9 1); rios1 and rios2 have different fpcompare delays(define_function_unit "fpu2" 2 0 (and (eq_attr "type" "fpcompare") (eq_attr "cpu" "rios2")) 5 1); on ppc601 and ppc603, fpcompare takes also 2 cycles from; the integer unit; here we do not define delays, just occupy the unit. The dependencies; will be assigned by the fpcompare definition in the fpu.(define_function_unit "iu" 1 0 (and (eq_attr "type" "fpcompare") (eq_attr "cpu" "ppc601,ppc603")) 0 2); fp compare uses fp unit(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fpcompare") (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750")) 5 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fpcompare") (eq_attr "cpu" "mpccore")) 1 1)(define_function_unit "bpu" 1 0 (and (eq_attr "type" "mtjmpr") (eq_attr "cpu" "rios1,rios2")) 5 1)(define_function_unit "bpu" 1 0 (and (eq_attr "type" "mtjmpr") (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750")) 4 1); all jumps/branches are executing on the bpu, in 1 cycle, for all machines.(define_function_unit "bpu" 1 0 (eq_attr "type" "jmpreg") 1 1)(define_function_unit "bpu" 1 0 (eq_attr "type" "branch") 1 1); Floating Point Unit(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fp,dmul") (eq_attr "cpu" "rios1")) 2 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fp") (eq_attr "cpu" "mpccore")) 4 4)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fp") (eq_attr "cpu" "ppc601")) 4 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "fp") (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750")) 3 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "dmul") (eq_attr "cpu" "mpccore")) 5 5)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "dmul") (eq_attr "cpu" "ppc601")) 5 2); is this true?(define_function_unit "fpu" 1 0 (and (eq_attr "type" "dmul") (eq_attr "cpu" "ppc603,ppc750")) 4 2)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "dmul") (eq_attr "cpu" "ppc604,ppc604e,ppc620")) 3 1)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "sdiv,ddiv") (eq_attr "cpu" "rios1")) 19 19)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "sdiv") (eq_attr "cpu" "ppc601")) 17 17)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "sdiv") (eq_attr "cpu" "mpccore")) 10 10)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "sdiv") (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620")) 18 18)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "ddiv") (eq_attr "cpu" "mpccore")) 17 17)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "ddiv") (eq_attr "cpu" "ppc601,ppc604,ppc604e,ppc620,ppc750")) 31 31)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "ddiv") (eq_attr "cpu" "ppc603")) 33 33)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "ssqrt") (eq_attr "cpu" "ppc620")) 31 31)(define_function_unit "fpu" 1 0 (and (eq_attr "type" "dsqrt") (eq_attr "cpu" "ppc620")) 31 31); RIOS2 has two symmetric FPUs.(define_function_unit "fpu2" 2 0 (and (eq_attr "type" "fp") (eq_attr "cpu" "rios2")) 2 1)(define_function_unit "fpu2" 2 0 (and (eq_attr "type" "dmul") (eq_attr "cpu" "rios2")) 2 1)(define_function_unit "fpu2" 2 0 (and (eq_attr "type" "sdiv,ddiv") (eq_attr "cpu" "rios2")) 17 17)(define_function_unit "fpu2" 2 0 (and (eq_attr "type" "ssqrt,dsqrt") (eq_attr "cpu" "rios2")) 26 26);; Start with fixed-point load and store insns. Here we put only the more;; complex forms. Basic data transfer is done later.(define_expand "zero_extendqidi2" [(set (match_operand:DI 0 "gpc_reg_operand" "") (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))] "TARGET_POWERPC64" "")(define_insn "" [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") (zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))] "TARGET_POWERPC64" "@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -