⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rs6000.md

📁 gcc库的原代码,对编程有很大帮助.
💻 MD
📖 第 1 页 / 共 5 页
字号:
;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler;; Copyright (C) 1990, 91, 92, 93, 94, 1995 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,fpload,imul,idiv,branch,compare,delayed_compare,fpcompare,mtjmpr,fp,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg"  (const_string "integer"));; Length (in bytes).(define_attr "length" ""  (if_then_else (eq_attr "type" "branch")		(if_then_else (and (ge (minus (pc) (match_dup 0))				       (const_int -32768))				   (lt (minus (pc) (match_dup 0))				       (const_int 32767)))			      (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,ppc403,ppc601,ppc603,ppc604,ppc620"  (const (symbol_ref "rs6000_cpu_attr"))); (define_function_unit NAME MULTIPLICITY SIMULTANEITY;			TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST]); Load/Store Unit -- POWER/2 and pure PowerPC only; (POWER and 601 use Integer Unit)(define_function_unit "lsu" 1 0  (and (eq_attr "type" "load")       (eq_attr "cpu" "rios2,ppc603,ppc604,ppc620"))  2 0)(define_function_unit "lsu" 1 0  (and (eq_attr "type" "fpload")       (eq_attr "cpu" "rios2,ppc603,ppc604,ppc620"))  2 0)(define_function_unit "iu" 1 0  (and (eq_attr "type" "load")       (eq_attr "cpu" "rios1,ppc403,ppc601"))  2 0)(define_function_unit "iu" 1 0  (and (eq_attr "type" "fpload")       (eq_attr "cpu" "rios1,ppc601"))  3 0); Integer Unit (RIOS1, PPC601, PPC603); Trivial operations take one cycle which need not be listed here.(define_function_unit "iu" 1 0  (and (eq_attr "type" "imul")       (eq_attr "cpu" "rios1"))  3 3)(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" "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.(define_function_unit "iu2" 2 0  (and (eq_attr "type" "integer")       (eq_attr "cpu" "rios2"))  1 0  [(eq_attr "type" "imul,idiv")])(define_function_unit "imuldiv" 1 0  (and (eq_attr "type" "imul")       (eq_attr "cpu" "rios2"))  2 2  [(eq_attr "type" "integer")])(define_function_unit "imuldiv" 1 0  (and (eq_attr "type" "idiv")       (eq_attr "cpu" "rios2"))  13 13  [(eq_attr "type" "integer")]); PPC604 has three integer units: one primary and two secondary.(define_function_unit "iu3" 3 0  (and (eq_attr "type" "integer")       (eq_attr "cpu" "ppc604,ppc620"))  1 0  [(eq_attr "type" "imul,idiv")])(define_function_unit "imuldiv" 1 0  (and (eq_attr "type" "imul")       (eq_attr "cpu" "ppc604,ppc620"))  4 2  [(eq_attr "type" "integer")])(define_function_unit "imuldiv" 1 0  (and (eq_attr "type" "idiv")       (eq_attr "cpu" "ppc604,ppc620"))  20 19  [(eq_attr "type" "integer")]); Branch Processing Unit(define_function_unit "bpu" 1 0  (eq_attr "type" "compare")  4 0)(define_function_unit "bpu" 1 0  (eq_attr "type" "delayed_compare")  5 0)(define_function_unit "bpu" 1 0  (and (eq_attr "type" "fpcompare")       (eq_attr "cpu" "rios1,rios2"))  8 0)(define_function_unit "bpu" 1 0  (and (eq_attr "type" "fpcompare")       (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc620"))  4 0)(define_function_unit "bpu" 1 0  (and (eq_attr "type" "mtjmpr")       (eq_attr "cpu" "rios1,rios2"))  5 0)(define_function_unit "bpu" 1 0  (and (eq_attr "type" "mtjmpr")       (eq_attr "cpu" "ppc403,ppc601,ppc603,ppc604,ppc620"))  4 0); Floating Point Unit (RIOS1, PPC601, PPC603, PPC604).(define_function_unit "fpu" 1 0  (and (eq_attr "type" "fp,dmul")       (eq_attr "cpu" "rios1"))  2 0)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "fp")       (eq_attr "cpu" "ppc601"))  4 0)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "fp")       (eq_attr "cpu" "ppc603,ppc604,ppc620"))  3 0)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "dmul")       (eq_attr "cpu" "ppc601"))  5 5)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "dmul")       (eq_attr "cpu" "ppc603"))  4 2)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "dmul")       (eq_attr "cpu" "ppc604,ppc620"))  3 0)(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" "ppc603,ppc604,ppc620"))  18 18)(define_function_unit "fpu" 1 0  (and (eq_attr "type" "ddiv")       (eq_attr "cpu" "ppc601,ppc604,ppc620"))  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 0)(define_function_unit "fpu2" 2 0  (and (eq_attr "type" "dmul")       (eq_attr "cpu" "rios2"))  2 0)(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"  "@   lbz%U1%X1 %0,%1   rldicl %0,%1,0,56"  [(set_attr "type" "load,*")])(define_insn ""  [(set (match_operand:CC 0 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (clobber (match_scratch:DI 2 "=r"))]  "TARGET_POWERPC64"  "rldicl. %2,%1,0,56"  [(set_attr "type" "compare")])(define_insn ""  [(set (match_operand:CC 2 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (set (match_operand:DI 0 "gpc_reg_operand" "=r")	(zero_extend:DI (match_dup 1)))]  "TARGET_POWERPC64"  "rldicl. %0,%1,0,56"  [(set_attr "type" "compare")])(define_insn "extendqidi2"  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")	(sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]  "TARGET_POWERPC64"  "extsb %0,%1")(define_insn ""  [(set (match_operand:CC 0 "cc_reg_operand" "=x")	(compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (clobber (match_scratch:DI 2 "=r"))]  "TARGET_POWERPC64"  "extsb. %2,%1"  [(set_attr "type" "compare")])(define_insn ""  [(set (match_operand:CC 2 "cc_reg_operand" "=x")	(compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (set (match_operand:DI 0 "gpc_reg_operand" "=r")	(sign_extend:DI (match_dup 1)))]  "TARGET_POWERPC64"  "extsb. %0,%1"  [(set_attr "type" "compare")])(define_expand "zero_extendhidi2"  [(set (match_operand:DI 0 "gpc_reg_operand" "")	(zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]  "TARGET_POWERPC64"  "")(define_insn ""  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")	(zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]  "TARGET_POWERPC64"  "@   lhz%U1%X1 %0,%1   rldicl %0,%1,0,48"  [(set_attr "type" "load,*")])(define_insn ""  [(set (match_operand:CC 0 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (clobber (match_scratch:DI 2 "=r"))]  "TARGET_POWERPC64"  "rldicl. %2,%1,0,48"  [(set_attr "type" "compare")])(define_insn ""  [(set (match_operand:CC 2 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (set (match_operand:DI 0 "gpc_reg_operand" "=r")	(zero_extend:DI (match_dup 1)))]  "TARGET_POWERPC64"  "rldicl. %0,%1,0,48"  [(set_attr "type" "compare")])(define_expand "extendhidi2"  [(set (match_operand:DI 0 "gpc_reg_operand" "")	(sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]  "TARGET_POWERPC64"  "")(define_insn ""  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")	(sign_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]  "TARGET_POWERPC64"  "@   lha%U1%X1 %0,%1   extsh %0,%1"  [(set_attr "type" "load,*")])(define_insn ""  [(set (match_operand:CC 0 "cc_reg_operand" "=x")	(compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (clobber (match_scratch:DI 2 "=r"))]  "TARGET_POWERPC64"  "extsh. %2,%1"  [(set_attr "type" "compare")])(define_insn ""  [(set (match_operand:CC 2 "cc_reg_operand" "=x")	(compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (set (match_operand:DI 0 "gpc_reg_operand" "=r")	(sign_extend:DI (match_dup 1)))]  "TARGET_POWERPC64"  "extsh. %0,%1"  [(set_attr "type" "compare")])(define_expand "zero_extendsidi2"  [(set (match_operand:DI 0 "gpc_reg_operand" "")	(zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]  "TARGET_POWERPC64"  "")(define_insn ""  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")	(zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))]  "TARGET_POWERPC64"  "@   lwz%U1%X1 %0,%1   rldicl %0,%1,0,32"  [(set_attr "type" "load,*")])(define_insn ""  [(set (match_operand:CC 0 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))		    (const_int 0)))   (clobber (match_scratch:DI 2 "=r"))]  "TARGET_POWERPC64"  "rldicl. %2,%1,0,32"  [(set_attr "type" "compare")])(define_insn ""  [(set (match_operand:CC 2 "cc_reg_operand" "=x")	(compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -