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

📄 gcc-4.0.2.patch.svn-base

📁 PSP开发环境(Linux) 包含PSPLINK 请自行选择需要安装的库及源代码
💻 SVN-BASE
📖 第 1 页 / 共 3 页
字号:
  /* Implement `va_start' for varargs and stdarg.  */@@ -3017,3 +3041,7 @@ 	" TEXT_SECTION_ASM_OP); #endif #endif++extern unsigned int mips_preferred_stack_boundary;+extern unsigned int mips_preferred_stack_align;+extern const char *mips_preferred_stack_boundary_string;diff -burN gcc-4.0.2/gcc/config/mips/mips.md gcc-psp/gcc/config/mips/mips.md--- gcc-4.0.2/gcc/config/mips/mips.md	2005-05-08 12:56:58.000000000 +0100+++ gcc-psp/gcc/config/mips/mips.md	2007-01-21 16:35:39.000000000 +0000@@ -70,6 +70,21 @@    (UNSPEC_RSQRT2		209)    (UNSPEC_RECIP1		210)    (UNSPEC_RECIP2		211)++   ;; Sony ALLEGREX instructions+   (UNSPEC_BITREV		400)+   (UNSPEC_WSBH 		401)+   (UNSPEC_WSBW 		402)++   (UNSPEC_CLO			403)+   (UNSPEC_CTO			404)++   (UNSPEC_CACHE		405)+   (UNSPEC_SYNC 		406)++   (UNSPEC_CEIL_W_S		407)+   (UNSPEC_FLOOR_W_S		408)+   (UNSPEC_ROUND_W_S		409)   ] ) @@ -1514,9 +1529,9 @@ 	   (mult:DI 	      (any_extend:DI (match_operand:SI 1 "register_operand" "d")) 	      (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))]-  "!TARGET_64BIT && ISA_HAS_MSAC"+  "!TARGET_64BIT && (ISA_HAS_MSAC || TARGET_ALLEGREX)" {-  if (TARGET_MIPS5500)+  if (TARGET_MIPS5500 || TARGET_ALLEGREX)     return "msub<u>\t%1,%2";   else     return "msac<u>\t$0,%1,%2";@@ -1631,12 +1646,12 @@ 	 (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) 		  (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) 	 (match_operand:DI 3 "register_operand" "0")))]-  "(TARGET_MAD || ISA_HAS_MACC)+  "(TARGET_MAD || ISA_HAS_MACC || TARGET_ALLEGREX)    && !TARGET_64BIT" {   if (TARGET_MAD)     return "mad<u>\t%1,%2";-  else if (TARGET_MIPS5500)+  else if (TARGET_MIPS5500 || TARGET_ALLEGREX)     return "madd<u>\t%1,%2";   else     /* See comment in *macc.  */@@ -1911,36 +1926,24 @@ ;;  .................... ;; -(define_insn "ffs<mode>2"-  [(set (match_operand:GPR 0 "register_operand" "=&d")-	(ffs:GPR (match_operand:GPR 1 "register_operand" "d")))-   (clobber (match_scratch:GPR 2 "=&d"))-   (clobber (match_scratch:GPR 3 "=&d"))]-  "!TARGET_MIPS16"+(define_expand "ffs<mode>2"+  [(set (match_operand:GPR 0 "register_operand" "")+	(ffs:GPR (match_operand:GPR 1 "register_operand" "")))]+  "ISA_HAS_CLZ_CLO" {-  if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))-    return "%(\-move\t%0,%.\;\-beq\t%1,%.,2f\n\-%~1:\tand\t%2,%1,0x0001\;\-<d>addu\t%0,%0,1\;\-beq\t%2,%.,1b\;\-<d>srl\t%1,%1,1\n\-%~2:%)";--  return "%(\-move\t%0,%.\;\-move\t%3,%1\;\-beq\t%3,%.,2f\n\-%~1:\tand\t%2,%3,0x0001\;\-<d>addu\t%0,%0,1\;\-beq\t%2,%.,1b\;\-<d>srl\t%3,%3,1\n\-%~2:%)";-}-  [(set_attr "type" "multi")-   (set_attr "mode" "<MODE>")-   (set_attr "length" "28")])+  rtx r1, r2, r3, r4;++  r1 = gen_reg_rtx (<MODE>mode);+  r2 = gen_reg_rtx (<MODE>mode);+  r3 = gen_reg_rtx (<MODE>mode);+  r4 = gen_reg_rtx (<MODE>mode);+  emit_insn (gen_neg<mode>2 (r1, operands[1]));+  emit_insn (gen_and<mode>3 (r2, operands[1], r1));+  emit_insn (gen_clz<mode>2 (r3, r2));+  emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (<MODE>mode)));+  emit_insn (gen_sub<mode>3 (operands[0], r4, r3));+  DONE;+})  ;; ;;  ...................@@ -2790,7 +2793,7 @@  (define_expand "extzv"   [(set (match_operand 0 "register_operand")-	(zero_extract (match_operand:QI 1 "memory_operand")+	(zero_extract (match_operand 1 "nonimmediate_operand") 		      (match_operand 2 "immediate_operand") 		      (match_operand 3 "immediate_operand")))]   "!TARGET_MIPS16"@@ -2799,12 +2802,33 @@ 				  INTVAL (operands[2]), 				  INTVAL (operands[3])))     DONE;+  else if (mips_use_ins_ext_p (operands[1], operands[2], operands[3]))+    {+      if (GET_MODE (operands[0]) == DImode)+        emit_insn (gen_extzvdi (operands[0], operands[1], operands[2],+				operands[3]));+      else+        emit_insn (gen_extzvsi (operands[0], operands[1], operands[2],+				operands[3]));+      DONE;+    }   else     FAIL; }) +(define_insn "extzv<mode>"+  [(set (match_operand:GPR 0 "register_operand" "=d")+	(zero_extract:GPR (match_operand:GPR 1 "register_operand" "d")+			  (match_operand:SI 2 "immediate_operand" "I")+			  (match_operand:SI 3 "immediate_operand" "I")))]+  "mips_use_ins_ext_p (operands[1], operands[2], operands[3])"+  "<d>ext\t%0,%1,%3,%2"+  [(set_attr "type"	"arith")+   (set_attr "mode"	"<MODE>")])++ (define_expand "insv"-  [(set (zero_extract (match_operand:QI 0 "memory_operand")+  [(set (zero_extract (match_operand 0 "nonimmediate_operand") 		      (match_operand 1 "immediate_operand") 		      (match_operand 2 "immediate_operand")) 	(match_operand 3 "reg_or_0_operand"))]@@ -2814,10 +2838,30 @@ 				   INTVAL (operands[1]), 				   INTVAL (operands[2])))     DONE;+  else if (mips_use_ins_ext_p (operands[0], operands[1], operands[2]))+    {+      if (GET_MODE (operands[0]) == DImode)+        emit_insn (gen_insvdi (operands[0], operands[1], operands[2],+			       operands[3]));+      else+        emit_insn (gen_insvsi (operands[0], operands[1], operands[2],+			       operands[3]));+      DONE;+   }   else     FAIL; }) +(define_insn "insv<mode>"+  [(set (zero_extract:GPR (match_operand:GPR 0 "register_operand" "+d")+			  (match_operand:SI 1 "immediate_operand" "I")+			  (match_operand:SI 2 "immediate_operand" "I"))+	(match_operand:GPR 3 "reg_or_0_operand" "dJ"))]+  "mips_use_ins_ext_p (operands[0], operands[1], operands[2])"+  "<d>ins\t%0,%z3,%2,%1"+  [(set_attr "type"	"arith")+   (set_attr "mode"	"<MODE>")])+ ;; Unaligned word moves generated by the bit field patterns. ;; ;; As far as the rtl is concerned, both the left-part and right-part@@ -4087,6 +4131,25 @@   [(set_attr "type" "shift")    (set_attr "mode" "<MODE>")]) +(define_expand "rotl<mode>3"+  [(set (match_operand:GPR 0 "register_operand")+      	(rotate:GPR (match_operand:GPR 1 "register_operand")+		    (match_operand:SI 2 "arith_operand")))]+  "ISA_HAS_ROTR_<MODE>"+{+  rtx temp;++  if (GET_CODE (operands[2]) == CONST_INT)+    temp = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - INTVAL (operands[2]));+  else+    {+      temp = gen_reg_rtx (<MODE>mode);+      emit_insn (gen_neg<mode>2 (temp, operands[2]));+    }+  emit_insn (gen_rotr<mode>3 (operands[0], operands[1], temp));+  DONE;+})+ ;; ;;  .................... ;;@@ -5200,7 +5263,7 @@ 		 (const_int 0)]) 	 (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") 	 (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))]-  "ISA_HAS_CONDMOVE"+  "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"   "@     mov%T4\t%0,%z2,%1     mov%t4\t%0,%z3,%1"@@ -5230,8 +5293,12 @@ 	(if_then_else:GPR (match_dup 5) 			  (match_operand:GPR 2 "reg_or_0_operand") 			  (match_operand:GPR 3 "reg_or_0_operand")))]-  "ISA_HAS_CONDMOVE"+  "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" {+  if (ISA_HAS_INT_CONDMOVE+      && GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_FLOAT)+    FAIL;+   gen_conditional_move (operands);   DONE; })@@ -5299,3 +5366,6 @@ ; The MIPS Paired-Single Floating Point and MIPS-3D Instructions.  (include "mips-ps-3d.md")++; Sony ALLEGREX instructions.+(include "allegrex.md")diff -burN gcc-4.0.2/gcc/config/mips/psp.h gcc-psp/gcc/config/mips/psp.h--- gcc-4.0.2/gcc/config/mips/psp.h	1970-01-01 01:00:00.000000000 +0100+++ gcc-psp/gcc/config/mips/psp.h	2007-01-21 16:35:39.000000000 +0000@@ -0,0 +1,31 @@+/* Support for Sony's Playstation Portable (PSP).+   Copyright (C) 2005 Free Software Foundation, Inc.+   Contributed by Marcus R. Brown <mrbrown@ocgnet.org>++This file is part of GCC.++GCC 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.++GCC 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 GCC; see the file COPYING.  If not, write to+the Free Software Foundation, 59 Temple Place - Suite 330,+Boston, MA 02111-1307, USA.  */++/* Override the startfile spec to include crt0.o. */+#undef STARTFILE_SPEC+#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s"++#undef SUBTARGET_CPP_SPEC+#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1"++/* Get rid of the .pdr section. */+#undef SUBTARGET_ASM_SPEC+#define SUBTARGET_ASM_SPEC "-mno-pdr"diff -burN gcc-4.0.2/gcc/config/mips/t-allegrex gcc-psp/gcc/config/mips/t-allegrex--- gcc-4.0.2/gcc/config/mips/t-allegrex	1970-01-01 01:00:00.000000000 +0100+++ gcc-psp/gcc/config/mips/t-allegrex	2007-01-21 16:35:39.000000000 +0000@@ -0,0 +1,29 @@+# Suppress building libgcc1.a, since the MIPS compiler port is complete+# and does not need anything from libgcc1.a.+LIBGCC1 =+CROSS_LIBGCC1 =++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o+# Don't let CTOR_LIST end up in sdata section.+CRTSTUFF_T_CFLAGS = -G 0++# Assemble startup files.+$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)+	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \+	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm++$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)+	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \+	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm++# We must build libgcc2.a with -G 0, in case the user wants to link+# without the $gp register.+TARGET_LIBGCC2_CFLAGS = -G 0++# Build the libraries for both hard and soft floating point++MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = ++LIBGCC = stmp-multilib+INSTALL_LIBGCC = install-multilibdiff -burN gcc-4.0.2/gcc/config.gcc gcc-psp/gcc/config.gcc--- gcc-4.0.2/gcc/config.gcc	2005-08-09 11:57:04.000000000 +0100+++ gcc-psp/gcc/config.gcc	2007-01-21 16:35:39.000000000 +0000@@ -406,12 +406,6 @@       tm_defines="${tm_defines} FBSD_MAJOR=5" ;;     *-*-freebsd6 | *-*-freebsd[6].*)       tm_defines="${tm_defines} FBSD_MAJOR=6" ;;-    *-*-freebsd7 | *-*-freebsd[7].*)-      tm_defines="${tm_defines} FBSD_MAJOR=7" ;;-    *-*-freebsd8 | *-*-freebsd[8].*)-      tm_defines="${tm_defines} FBSD_MAJOR=8" ;;-    *-*-freebsd9 | *-*-freebsd[9].*)-      tm_defines="${tm_defines} FBSD_MAJOR=9" ;;     *)       echo 'Please update *-*-freebsd* in gcc/config.gcc'       exit 1@@ -740,11 +734,6 @@         tmake_file=bfin/t-bfin-elf         use_collect2=no         ;;-bfin*-uclinux*)-	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/uclinux.h"-        tmake_file=bfin/t-bfin-elf-        use_collect2=no-        ;; bfin*-*) 	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"         tmake_file=bfin/t-bfin@@ -1531,6 +1520,18 @@ 	tmake_file=mips/t-r3900 	use_fixproto=yes 	;;+mipsallegrex-*-elf* | mipsallegrexel-*-elf*)+	tm_file="elfos.h ${tm_file} mips/elf.h"+	tmake_file=mips/t-allegrex+	target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS"+	tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI"+	case ${target} in+	mipsallegrex*-psp-elf*)	+		tm_file="${tm_file} mips/psp.h"+		;;+	esac+	use_fixproto=yes+	;; mmix-knuth-mmixware) 	need_64bit_hwint=yes 	;;diff -burN gcc-4.0.2/gcc/hwint.h gcc-psp/gcc/hwint.h--- gcc-4.0.2/gcc/hwint.h	2004-11-24 04:31:57.000000000 +0000+++ gcc-psp/gcc/hwint.h	2007-01-21 16:35:39.000000000 +0000@@ -80,7 +80,7 @@ #  define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx" # endif #else-# define HOST_WIDE_INT_PRINT "ll"+# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT # define HOST_WIDE_INT_PRINT_C "LL"   /* We can assume that 'long long' is at least 64 bits.  */ # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \diff -burN gcc-4.0.2/gcc/version.c gcc-psp/gcc/version.c--- gcc-4.0.2/gcc/version.c	2005-09-21 04:58:56.000000000 +0100+++ gcc-psp/gcc/version.c	2007-01-21 16:35:39.000000000 +0000@@ -5,7 +5,7 @@    please modify this string to indicate that, e.g. by putting your    organization's name in parentheses at the end of the string.  */ -const char version_string[] = "4.0.2";+const char version_string[] = "4.0.2 (PSPDEV 20051022)";  /* This is the location of the online document giving instructions for    reporting bugs.  If you distribute a modified version of GCC,@@ -14,4 +14,4 @@    forward us bugs reported to you, if you determine that they are    not bugs in your modifications.)  */ -const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";+const char bug_report_url[] = "<URL:http://wiki.pspdev.org/psp:toolchain#bugs>";

⌨️ 快捷键说明

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