This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Extra machine modes out of tm.h


One reason why the entire bloody compiler needs to include - and
depend upon - the target configuration headers, is that they *might*
add extra modes to machmode.def, which *could* change the width of
enum machine_mode, which would affect every routine that takes an
enum machine_mode parameter.

This patch isolates that dependency from the rest of the contents of
tm.h.  Each architecture that formerly defined EXTRA_CC_MODES now has
a special file named <cpu>-modes.def containing a list of extra CC
modes.  configure notices the existence of this file and notifies
machmode.def to include it.  It also #defines EXTRA_CC_MODES to 1 for
the sake of combine.c, which has some code conditional on that macro.

In theory, we could use this facility to define other modes that are
only of use to some architectures, such as the vector modes or the
partial-integer modes.  For now, though, it's a straight-up
replacement for EXTRA_CC_MODES.

I also took the opportunity to get rid of some redundancy in the
extra-modes lists, now that we have symcat.h available everywhere.  I
may extend that to machmode.def in a separate patch.

An assumption of this patch is that #include MACRO works in K+R
compilers - can anyone confirm/deny this?  It works in our
-traditional preprocessor but that doesn't mean much.

Why does libgcc2.c include machmode.h?  This seems both unnecessary
and dangerous.  (I left it for the moment.)

I'm running an overnight bootstrap on i386-linux, and will also build
cross compilers to each affected architecture.  Comments?  OK for
installation assuming the tests succeed?

zw

p.s. There is a shocking absence of commentary on what these modes are
for, in most cases.  Would architecture maintainers care to step up
and add some to the *-modes.def files, after the patch goes in?

	* Makefile.in (MACHMODE_H) Add @extra_modes_file@.
	* configure.in: Check for <cpu>-modes.def; if found,
	substitute its name as @extra_modes_file@, and define
	EXTRA_MODES_FILE and EXTRA_CC_MODES in auto-host.h.
	* machmode.def: Update commentary.  Simplify call convention
	for CC macro.  #include EXTRA_MODES_FILE if defined; don't use
	EXTRA_CC_MODES.
	* tm.texi: Document <cpu>-modes.def.

	* libgcc2.c: Include symcat.h for the sake of machmode.def.

	* arc-modes.def, arm-modes.def, c4x-modes.def, i386-modes.def, 
	i960-modes.def, ia64-modes.def, m88k-modes.def,	mmix-modes.def, 
	pa-modes.def, pdp11-modes.def, rs6000-modes.def, s390-modes.def,
	sparc-modes.def: New files.
	* arc.h, arm.h, c4x.h, i386.h, i960.h, ia64.h, m88k.h, mmix.h, pa.h,
	pdp11.h, rs6000.h, s390.h, sparc.h: Don't define EXTRA_CC_MODES.

===================================================================
Index: Makefile.in
--- Makefile.in	9 Jun 2002 23:20:06 -0000	1.892
+++ Makefile.in	10 Jun 2002 06:42:49 -0000
@@ -548,7 +548,7 @@ LANGHOOKS_DEF_H = langhooks.h $(HOOKS_H)
 TARGET_DEF_H = target-def.h $(HOOKS_H)
 TM_P_H = tm_p.h $(tm_p_file_list) tm-preds.h
 
-MACHMODE_H = machmode.h machmode.def
+MACHMODE_H = machmode.h machmode.def @extra_modes_file@
 RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
 RTL_H = $(RTL_BASE_H) genrtl.h
 PARAMS_H = params.h params.def
===================================================================
Index: configure.in
--- configure.in	9 Jun 2002 23:33:49 -0000	1.601
+++ configure.in	10 Jun 2002 06:42:51 -0000
@@ -869,6 +869,19 @@ if test x$thread_file = x; then
 	fi
 fi
 
+# Look for a file containing extra machine modes.
+if test -f $srcdir/config/${cpu_type}/${cpu_type}-modes.def; then
+  extra_modes_file='$(srcdir)/config/'${cpu_type}/${cpu_type}-modes.def
+  AC_SUBST(extra_modes_file)
+  AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE,
+			   "${cpu_type}/${cpu_type}-modes.def",
+  [Define to the name of a file containing a list of extra machine modes
+   for this architecture.])
+  AC_DEFINE(EXTRA_CC_MODES, 1,
+  [Define if the target architecture needs extra machine modes to represent
+   the results of comparisons.])
+fi
+
 # auto-host.h is the file containing items generated by autoconf and is
 # the first file included by config.h.
 # If host=build, it is correct to have hconfig include auto-host.h
===================================================================
Index: machmode.def
--- machmode.def	24 Mar 2002 08:03:43 -0000	1.19
+++ machmode.def	10 Jun 2002 06:42:51 -0000
@@ -151,15 +151,17 @@ DEF_MACHMODE (BLKmode, "BLK", MODE_RANDO
 
 /* The modes for representing the condition codes come last.  CCmode
    is always defined.  Additional modes for the condition code can be
-   specified in the EXTRA_CC_MODES macro.  All MODE_CC modes are the
+   specified in the EXTRA_MODES_FILE header.  All MODE_CC modes are the
    same width as SImode and have VOIDmode as their next wider mode.  */
 
-#define CC(E, M)  DEF_MACHMODE (E, M, MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
+#define CC(N)  \
+  DEF_MACHMODE (CONCAT2 (N,mode), STRINGX (N), \
+                MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
 
-CC (CCmode, "CC")
+CC (CC)
 
-#ifdef EXTRA_CC_MODES
-EXTRA_CC_MODES
+#ifdef EXTRA_MODES_FILE
+#include EXTRA_MODES_FILE
 #endif
 
 #undef CC
===================================================================
Index: config/arc/arc-modes.def
--- config/arc/arc-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/arc/arc-modes.def	10 Jun 2002 06:42:52 -0000
@@ -0,0 +1,25 @@
+/* Definitions of target machine for GNU compiler, Argonaut ARC cpu.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+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.  */
+
+/* Some insns set all condition code flags, some only set the ZNC flags, and
+   some only set the ZN flags.  */
+
+CC (CCZNC)
+CC (CCZN)
===================================================================
Index: config/arc/arc.h
--- config/arc/arc.h	19 May 2002 05:22:59 -0000	1.50
+++ config/arc/arc.h	10 Jun 2002 06:42:52 -0000
@@ -990,15 +990,6 @@ do { \
     goto LABEL;				\
 }
 
-/* Condition code usage.  */
-
-/* Some insns set all condition code flags, some only set the ZNC flags, and
-   some only set the ZN flags.  */
-
-#define EXTRA_CC_MODES \
-	CC(CCZNCmode, "CCZNC") \
-	CC(CCZNmode, "CCZN")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  */
 #define SELECT_CC_MODE(OP, X, Y) \
===================================================================
Index: config/arm/arm-modes.def
--- config/arm/arm-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/arm/arm-modes.def	10 Jun 2002 06:42:52 -0000
@@ -0,0 +1,46 @@
+/* Definitions of target machine for GNU compiler, for ARM.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
+   and Martin Simmons (@harleqn.co.uk).
+   More major hacks by Richard Earnshaw (rearnsha@arm.com)
+   Minor hacks by Nick Clifton (nickc@cygnus.com)
+
+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.  */
+
+/* CCFPEmode should be used with floating inequalities,
+   CCFPmode should be used with floating equalities.
+   CC_NOOVmode should be used with SImode integer equalities.
+   CC_Zmode should be used if only the Z flag is set correctly
+   CCmode should be used otherwise. */
+
+CC (CC_NOOV)
+CC (CC_Z)
+CC (CC_SWP)
+CC (CCFP)
+CC (CCFPE)
+CC (CC_DNE)
+CC (CC_DEQ)
+CC (CC_DLE)
+CC (CC_DLT)
+CC (CC_DGE)
+CC (CC_DGT)
+CC (CC_DLEU)
+CC (CC_DLTU)
+CC (CC_DGEU)
+CC (CC_DGTU)
+CC (CC_C)
===================================================================
Index: config/arm/arm.h
--- config/arm/arm.h	4 Jun 2002 07:08:45 -0000	1.151
+++ config/arm/arm.h	10 Jun 2002 06:42:53 -0000
@@ -2417,30 +2417,7 @@ extern int making_const_table;
 
 /* Condition code information. */
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
-   return the mode to be used for the comparison. 
-   CCFPEmode should be used with floating inequalities,
-   CCFPmode should be used with floating equalities.
-   CC_NOOVmode should be used with SImode integer equalities.
-   CC_Zmode should be used if only the Z flag is set correctly
-   CCmode should be used otherwise. */
-
-#define EXTRA_CC_MODES \
-        CC(CC_NOOVmode, "CC_NOOV") \
-        CC(CC_Zmode, "CC_Z") \
-        CC(CC_SWPmode, "CC_SWP") \
-        CC(CCFPmode, "CCFP") \
-        CC(CCFPEmode, "CCFPE") \
-        CC(CC_DNEmode, "CC_DNE") \
-        CC(CC_DEQmode, "CC_DEQ") \
-        CC(CC_DLEmode, "CC_DLE") \
-        CC(CC_DLTmode, "CC_DLT") \
-        CC(CC_DGEmode, "CC_DGE") \
-        CC(CC_DGTmode, "CC_DGT") \
-        CC(CC_DLEUmode, "CC_DLEU") \
-        CC(CC_DLTUmode, "CC_DLTU") \
-        CC(CC_DGEUmode, "CC_DGEU") \
-        CC(CC_DGTUmode, "CC_DGTU") \
-        CC(CC_Cmode, "CC_C")
+   return the mode to be used for the comparison.  */
 
 #define SELECT_CC_MODE(OP, X, Y)  arm_select_cc_mode (OP, X, Y)
 
===================================================================
Index: config/c4x/c4x-modes.def
--- config/c4x/c4x-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/c4x/c4x-modes.def	10 Jun 2002 06:42:53 -0000
@@ -0,0 +1,102 @@
+/* Definitions of target machine for GNU compiler.  TMS320C[34]x
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
+              and Herman Ten Brugge (Haj.Ten.Brugge@net.HCC.nl).
+
+   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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   On the C4x, we have a "no-overflow" mode which is used when an ADD,
+   SUB, NEG, or MPY insn is used to set the condition code.  This is
+   to prevent the combiner from optimising away a following CMP of the
+   result with zero when a signed conditional branch or load insn
+   follows.
+
+   The problem is a subtle one and deals with the manner in which the
+   negative condition (N) flag is used on the C4x.  This flag does not
+   reflect the status of the actual result but of the ideal result had
+   no overflow occurred (when considering signed operands).
+
+   For example, 0x7fffffff + 1 => 0x80000000 Z=0 V=1 N=0 C=0.  Here
+   the flags reflect the untruncated result, not the actual result.
+   While the actual result is less than zero, the N flag is not set
+   since the ideal result of the addition without truncation would
+   have been positive.
+   
+   Note that the while the N flag is handled differently to most other
+   architectures, the use of it is self consistent and is not the
+   cause of the problem.
+
+   Logical operations set the N flag to the MSB of the result so if
+   the result is negative, N is 1.  However, integer and floating
+   point operations set the N flag to be the MSB of the result
+   exclusive ored with the overflow (V) flag.  Thus if an overflow
+   occurs and the result does not have the MSB set (i.e., the result
+   looks like a positive number), the N flag is set.  Conversely, if
+   an overflow occurs and the MSB of the result is set, N is set to 0.
+   Thus the N flag represents the sign of the result if it could have
+   been stored without overflow but does not represent the apparent
+   sign of the result.  Note that most architectures set the N flag to
+   be the MSB of the result.
+
+   The C4x approach to setting the N flag simplifies signed
+   conditional branches and loads which only have to test the state of
+   the N flag, whereas most architectures have to look at both the N
+   and V flags.  The disadvantage is that there is no flag giving the
+   status of the sign bit of the operation.  However, there are no
+   conditional load or branch instructions that make use of this
+   feature (e.g., BMI---branch minus) instruction.  Note that BN and
+   BLT are identical in the C4x.
+   
+   To handle the problem where the N flag is set differently whenever
+   there is an overflow we use a different CC mode, CC_NOOVmode which
+   says that the CC reflects the comparison of the result against zero
+   if no overflow occurred.
+
+   For example, 
+
+   [(set (reg:CC_NOOV 21)
+         (compare:CC_NOOV (minus:QI (match_operand:QI 1 "src_operand" "")
+                                    (match_operand:QI 2 "src_operand" ""))
+                          (const_int 0)))
+    (set (match_operand:QI 0 "ext_reg_operand" "")
+         (minus:QI (match_dup 1)
+                   (match_dup 2)))]
+
+   Note that there is no problem for insns that don't return a result
+   like CMP, since the CC reflects the effect of operation.
+
+   An example of a potential problem is when GCC
+   converts   (LTU (MINUS (0x80000000) (0x7fffffff) (0x80000000)))
+   to         (LEU (MINUS (0x80000000) (0x7fffffff) (0x7fffffff)))
+   to         (GE  (MINUS (0x80000000) (0x7fffffff) (0x00000000)))
+
+   Now (MINUS (0x80000000) (0x7fffffff)) returns 0x00000001 but the
+   C4x sets the N flag since the result without overflow would have
+   been 0xffffffff when treating the operands as signed integers.
+   Thus (GE (MINUS (0x80000000) (0x7fffffff) (0x00000000))) sets the N
+   flag but (GE (0x00000001)) does not set the N flag.
+
+   The upshot is that we can not use signed branch and conditional
+   load instructions after an add, subtract, neg, abs or multiply.
+   We must emit a compare insn to check the result against 0.  */
+
+CC (CC_NOOV)
+
===================================================================
Index: config/c4x/c4x.h
--- config/c4x/c4x.h	1 Jun 2002 23:27:50 -0000	1.106
+++ config/c4x/c4x.h	10 Jun 2002 06:42:54 -0000
@@ -1284,85 +1284,6 @@ CUMULATIVE_ARGS;
 
 #define TARGET_MEM_FUNCTIONS
 
-/* Add any extra modes needed to represent the condition code.
-
-   On the C4x, we have a "no-overflow" mode which is used when an ADD,
-   SUB, NEG, or MPY insn is used to set the condition code.  This is
-   to prevent the combiner from optimising away a following CMP of the
-   result with zero when a signed conditional branch or load insn
-   follows.
-
-   The problem is a subtle one and deals with the manner in which the
-   negative condition (N) flag is used on the C4x.  This flag does not
-   reflect the status of the actual result but of the ideal result had
-   no overflow occurred (when considering signed operands).
-
-   For example, 0x7fffffff + 1 => 0x80000000 Z=0 V=1 N=0 C=0.  Here
-   the flags reflect the untruncated result, not the actual result.
-   While the actual result is less than zero, the N flag is not set
-   since the ideal result of the addition without truncation would
-   have been positive.
-   
-   Note that the while the N flag is handled differently to most other
-   architectures, the use of it is self consistent and is not the
-   cause of the problem.
-
-   Logical operations set the N flag to the MSB of the result so if
-   the result is negative, N is 1.  However, integer and floating
-   point operations set the N flag to be the MSB of the result
-   exclusive ored with the overflow (V) flag.  Thus if an overflow
-   occurs and the result does not have the MSB set (i.e., the result
-   looks like a positive number), the N flag is set.  Conversely, if
-   an overflow occurs and the MSB of the result is set, N is set to 0.
-   Thus the N flag represents the sign of the result if it could have
-   been stored without overflow but does not represent the apparent
-   sign of the result.  Note that most architectures set the N flag to
-   be the MSB of the result.
-
-   The C4x approach to setting the N flag simplifies signed
-   conditional branches and loads which only have to test the state of
-   the N flag, whereas most architectures have to look at both the N
-   and V flags.  The disadvantage is that there is no flag giving the
-   status of the sign bit of the operation.  However, there are no
-   conditional load or branch instructions that make use of this
-   feature (e.g., BMI---branch minus) instruction.  Note that BN and
-   BLT are identical in the C4x.
-   
-   To handle the problem where the N flag is set differently whenever
-   there is an overflow we use a different CC mode, CC_NOOVmode which
-   says that the CC reflects the comparison of the result against zero
-   if no overflow occurred.
-
-   For example, 
-
-   [(set (reg:CC_NOOV 21)
-         (compare:CC_NOOV (minus:QI (match_operand:QI 1 "src_operand" "")
-                                    (match_operand:QI 2 "src_operand" ""))
-                          (const_int 0)))
-    (set (match_operand:QI 0 "ext_reg_operand" "")
-         (minus:QI (match_dup 1)
-                   (match_dup 2)))]
-
-   Note that there is no problem for insns that don't return a result
-   like CMP, since the CC reflects the effect of operation.
-
-   An example of a potential problem is when GCC
-   converts   (LTU (MINUS (0x80000000) (0x7fffffff) (0x80000000)))
-   to         (LEU (MINUS (0x80000000) (0x7fffffff) (0x7fffffff)))
-   to         (GE  (MINUS (0x80000000) (0x7fffffff) (0x00000000)))
-
-   Now (MINUS (0x80000000) (0x7fffffff)) returns 0x00000001 but the
-   C4x sets the N flag since the result without overflow would have
-   been 0xffffffff when treating the operands as signed integers.
-   Thus (GE (MINUS (0x80000000) (0x7fffffff) (0x00000000))) sets the N
-   flag but (GE (0x00000001)) does not set the N flag.
-
-   The upshot is that we can not use signed branch and conditional
-   load instructions after an add, subtract, neg, abs or multiply.
-   We must emit a compare insn to check the result against 0.  */
-
-#define EXTRA_CC_MODES CC(CC_NOOVmode, "CC_NOOV")
-
 /* CC_NOOVmode should be used when the first operand is a PLUS, MINUS, NEG
    or MULT.
    CCmode should be used when no special processing is needed.  */
===================================================================
Index: config/i386/i386-modes.def
--- config/i386/i386-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/i386/i386-modes.def	10 Jun 2002 06:42:54 -0000
@@ -0,0 +1,46 @@
+/* Definitions of target machine for GNU compiler for IA-32.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   For the i386, we need separate modes when floating-point
+   equality comparisons are being done. 
+   
+   Add CCNO to indicate comparisons against zero that requires
+   Overflow flag to be unset.  Sign bit test is used instead and
+   thus can be used to form "a&b>0" type of tests.
+
+   Add CCGC to indicate comparisons agains zero that allows
+   unspecified garbage in the Carry flag.  This mode is used
+   by inc/dec instructions.
+
+   Add CCGOC to indicate comparisons agains zero that allows
+   unspecified garbage in the Carry and Overflow flag. This
+   mode is used to simulate comparisons of (a-b) and (a+b)
+   against zero using sub/cmp/add operations.
+
+   Add CCZ to indicate that only the Zero flag is valid.  */
+
+CC (CCGC)
+CC (CCGOC)
+CC (CCNO)
+CC (CCZ)
+CC (CCFP)
+CC (CCFPU)
===================================================================
Index: config/i386/i386.h
--- config/i386/i386.h	4 Jun 2002 18:07:38 -0000	1.268
+++ config/i386/i386.h	10 Jun 2002 06:42:55 -0000
@@ -2848,33 +2848,6 @@ do {							\
 
 #define NO_RECURSIVE_FUNCTION_CSE
 
-/* Add any extra modes needed to represent the condition code.
-
-   For the i386, we need separate modes when floating-point
-   equality comparisons are being done. 
-   
-   Add CCNO to indicate comparisons against zero that requires
-   Overflow flag to be unset.  Sign bit test is used instead and
-   thus can be used to form "a&b>0" type of tests.
-
-   Add CCGC to indicate comparisons agains zero that allows
-   unspecified garbage in the Carry flag.  This mode is used
-   by inc/dec instructions.
-
-   Add CCGOC to indicate comparisons agains zero that allows
-   unspecified garbage in the Carry and Overflow flag. This
-   mode is used to simulate comparisons of (a-b) and (a+b)
-   against zero using sub/cmp/add operations.
-
-   Add CCZ to indicate that only the Zero flag is valid.  */
-
-#define EXTRA_CC_MODES		\
-	CC (CCGCmode, "CCGC")	\
-	CC (CCGOCmode, "CCGOC")	\
-	CC (CCNOmode, "CCNO")	\
-	CC (CCZmode, "CCZ")	\
-	CC (CCFPmode, "CCFP")	\
-	CC (CCFPUmode, "CCFPU")
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.
===================================================================
Index: config/i960/i960-modes.def
--- config/i960/i960-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/i960/i960-modes.def	10 Jun 2002 06:42:55 -0000
@@ -0,0 +1,30 @@
+/* Definitions of target machine for GNU compiler, for Intel 80960
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Steven McGeady, Intel Corp.
+   Additional Work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson
+   Converted to GCC 2.0 by Jim Wilson and Michael Tiemann, Cygnus Support.
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   Also, signed and unsigned comparisons are distinguished, as
+   are operations which are compatible with chkbit insns.  */
+
+CC (CC_UNS)
+CC (CC_CHK)
===================================================================
Index: config/i960/i960.h
--- config/i960/i960.h	19 May 2002 08:31:51 -0000	1.57
+++ config/i960/i960.h	10 Jun 2002 06:42:55 -0000
@@ -1200,14 +1200,6 @@ struct cum_args { int ca_nregparms; int 
 
 extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
 
-/* Add any extra modes needed to represent the condition code.
-
-   Also, signed and unsigned comparisons are distinguished, as
-   are operations which are compatible with chkbit insns.  */
-#define EXTRA_CC_MODES		\
-    CC(CC_UNSmode, "CC_UNS")	\
-    CC(CC_CHKmode, "CC_CHK")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
    should be used.  CC_NOOVmode should be used when the first operand is a
===================================================================
Index: config/ia64/ia64-modes.def
--- config/ia64/ia64-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/ia64/ia64-modes.def	10 Jun 2002 06:42:55 -0000
@@ -0,0 +1,29 @@
+/* Definitions of target machine GNU compiler.  IA-64 version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by James E. Wilson <wilson@cygnus.com> and
+   		  David Mosberger <davidm@hpl.hp.com>.
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   CCImode is used to mark a single predicate register instead
+   of a register pair.  This is currently only used in reg_raw_mode
+   so that flow doesn't do something stupid.  */
+
+CC (CCI)
===================================================================
Index: config/ia64/ia64.h
--- config/ia64/ia64.h	4 Jun 2002 07:09:07 -0000	1.118
+++ config/ia64/ia64.h	10 Jun 2002 06:42:56 -0000
@@ -595,14 +595,6 @@ while (0)
 #define LOCAL_REGNO(REGNO) \
   (IN_REGNO_P (REGNO) || LOC_REGNO_P (REGNO))
 
-/* Add any extra modes needed to represent the condition code.
-
-   CCImode is used to mark a single predicate register instead
-   of a register pair.  This is currently only used in reg_raw_mode
-   so that flow doesn't do something stupid.  */
-
-#define EXTRA_CC_MODES		CC(CCImode, "CCI")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  Must be defined if
    EXTRA_CC_MODES is defined.  */
===================================================================
Index: config/m88k/m88k-modes.def
--- config/m88k/m88k-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/m88k/m88k-modes.def	10 Jun 2002 06:42:57 -0000
@@ -0,0 +1,27 @@
+/* Definitions of target machine for GNU compiler for Motorola m88100.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Michael Tiemann (tiemann@cygnus.com).
+   Currently maintained by (gcc@dg-rtp.dg.com)
+
+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.  */
+
+/* Extra machine modes to represent the condition code.  */
+
+CC (CCEVEN)
+
+
===================================================================
Index: config/m88k/m88k.h
--- config/m88k/m88k.h	23 May 2002 23:37:06 -0000	1.60
+++ config/m88k/m88k.h	10 Jun 2002 06:42:58 -0000
@@ -1162,8 +1162,6 @@ enum reg_class { NO_REGS, AP_REG, XRF_RE
 
 /*** Addressing Modes ***/
 
-#define EXTRA_CC_MODES CC(CCEVENmode, "CCEVEN")
-
 #define SELECT_CC_MODE(OP,X,Y) CCmode
 
 /* #define HAVE_POST_INCREMENT 0 */
===================================================================
Index: config/mmix/mmix-modes.def
--- config/mmix/mmix-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/mmix/mmix-modes.def	10 Jun 2002 06:42:58 -0000
@@ -0,0 +1,27 @@
+/* Definitions of target machine for GNU compiler, for MMIX.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Hans-Peter Nilsson (hp@bitrange.com)
+
+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.  */
+
+/* Extra machine modes to represent the condition code.  */
+
+CC (CC_UNS)
+CC (CC_FP)
+CC (CC_FPEQ)
+CC (CC_FUN)
===================================================================
Index: config/mmix/mmix.h
--- config/mmix/mmix.h	4 Jun 2002 07:09:19 -0000	1.30
+++ config/mmix/mmix.h	10 Jun 2002 06:42:58 -0000
@@ -846,12 +846,6 @@ typedef struct { int regs; int lib; int 
 
 /* Node: Condition Code */
 
-#define EXTRA_CC_MODES				\
- CC(CC_UNSmode, "CC_UNS")			\
- CC(CC_FPmode, "CC_FP")				\
- CC(CC_FPEQmode, "CC_FPEQ")			\
- CC(CC_FUNmode, "CC_FUN")
-
 #define SELECT_CC_MODE(OP, X, Y)		\
  mmix_select_cc_mode (OP, X, Y)
 
===================================================================
Index: config/pa/pa-modes.def
--- config/pa/pa-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/pa/pa-modes.def	10 Jun 2002 06:42:58 -0000
@@ -0,0 +1,30 @@
+/* Definitions of target machine for GNU compiler, for the HP Spectrum.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
+   and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
+   Software Science at the University of Utah.
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   HPPA floating comparisons produce condition codes.  */
+
+CC (CCFP)
+
+
===================================================================
Index: config/pa/pa.h
--- config/pa/pa.h	5 Jun 2002 20:35:23 -0000	1.161
+++ config/pa/pa.h	10 Jun 2002 06:42:59 -0000
@@ -1515,11 +1515,6 @@ do { 									\
    between pointers and any other objects of this machine mode.  */
 #define Pmode word_mode
 
-/* Add any extra modes needed to represent the condition code.
-
-   HPPA floating comparisons produce condition codes.  */
-#define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
    should be used.  CC_NOOVmode should be used when the first operand is a
===================================================================
Index: config/pdp11/pdp11-modes.def
--- config/pdp11/pdp11-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/pdp11/pdp11-modes.def	10 Jun 2002 06:42:59 -0000
@@ -0,0 +1,26 @@
+/* Definitions of target machine for GNU compiler, for the pdp-11
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+   CCFPmode is used for FPU, but should we use a separate reg? */
+
+CC (CCFP)
+
===================================================================
Index: config/pdp11/pdp11.h
--- config/pdp11/pdp11.h	23 Mar 2002 01:10:43 -0000	1.38
+++ config/pdp11/pdp11.h	10 Jun 2002 06:42:59 -0000
@@ -884,12 +884,6 @@ extern int may_call_alloca;
    is done just by pretending it is already truncated.  */
 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
 
-
-/* Add any extra modes needed to represent the condition code.
-
-   CCFPmode is used for FPU, but should we use a separate reg? */
-#define EXTRA_CC_MODES CC(CCFPmode, "CCFP")
-
 /* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point, CCFPmode
    should be used. */
===================================================================
Index: config/rs6000/rs6000-modes.def
--- config/rs6000/rs6000-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/rs6000/rs6000-modes.def	10 Jun 2002 06:42:59 -0000
@@ -0,0 +1,31 @@
+/* Definitions of target machine for GNU compiler, for IBM RS/6000.
+   Copyright (C) 2002 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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   For the RS/6000, we need separate modes when unsigned (logical) comparisons
+   are being done and we need a separate mode for floating-point.  We also
+   use a mode for the case when we are comparing the results of two
+   comparisons, as then only the EQ bit is valid in the register.  */
+
+CC (CCUNS)
+CC (CCFP)
+CC (CCEQ)
===================================================================
Index: config/rs6000/rs6000.h
--- config/rs6000/rs6000.h	9 Jun 2002 15:05:08 -0000	1.207
+++ config/rs6000/rs6000.h	10 Jun 2002 06:43:00 -0000
@@ -2379,18 +2379,6 @@ do {									     \
 
 /* #define ADJUST_INSN_LENGTH(X,LENGTH) */
 
-/* Add any extra modes needed to represent the condition code.
-
-   For the RS/6000, we need separate modes when unsigned (logical) comparisons
-   are being done and we need a separate mode for floating-point.  We also
-   use a mode for the case when we are comparing the results of two
-   comparisons, as then only the EQ bit is valid in the register.  */
-
-#define EXTRA_CC_MODES		\
-    CC(CCUNSmode,  "CCUNS")	\
-    CC(CCFPmode,   "CCFP")	\
-    CC(CCEQmode,   "CCEQ")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a
    COMPARE, return the mode to be used for the comparison.  For
    floating-point, CCFPmode should be used.  CCUNSmode should be used
===================================================================
Index: config/s390/s390-modes.def
--- config/s390/s390-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/s390/s390-modes.def	10 Jun 2002 06:43:00 -0000
@@ -0,0 +1,29 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+                  Ulrich Weigand (uweigand@de.ibm.com).
+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.  */
+
+/* Add any extra modes needed to represent the condition code.  */
+
+CC (CCZ)
+CC (CCA)
+CC (CCL)
+CC (CCU)
+CC (CCS)
+CC (CCT)
===================================================================
Index: config/s390/s390.h
--- config/s390/s390.h	19 May 2002 05:23:22 -0000	1.35
+++ config/s390/s390.h	10 Jun 2002 06:43:01 -0000
@@ -1207,15 +1207,6 @@ CUMULATIVE_ARGS;
 
 #define BRANCH_COST 1
 
-/* Add any extra modes needed to represent the condition code.  */
-#define EXTRA_CC_MODES \
-	CC (CCZmode, "CCZ") \
-	CC (CCAmode, "CCA") \
-	CC (CCLmode, "CCL") \
-	CC (CCUmode, "CCU") \
-	CC (CCSmode, "CCS") \
-	CC (CCTmode, "CCT")
- 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  */
  
===================================================================
Index: config/sparc/sparc-modes.def
--- config/sparc/sparc-modes.def	1 Jan 1970 00:00:00 -0000
+++ config/sparc/sparc-modes.def	10 Jun 2002 06:43:01 -0000
@@ -0,0 +1,42 @@
+/* Definitions of target machine for GNU compiler, for Sun SPARC.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by Michael Tiemann (tiemann@cygnus.com).
+   64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
+   at Cygnus Support.
+
+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.  */
+
+/* Add any extra modes needed to represent the condition code.
+
+   On the Sparc, we have a "no-overflow" mode which is used when an add or
+   subtract insn is used to set the condition code.  Different branches are
+   used in this case for some operations.
+
+   We also have two modes to indicate that the relevant condition code is
+   in the floating-point condition code register.  One for comparisons which
+   will generate an exception if the result is unordered (CCFPEmode) and
+   one for comparisons which will never trap (CCFPmode).
+
+   CCXmode and CCX_NOOVmode are only used by v9.  */
+
+CC (CCX)
+CC (CC_NOOV)
+CC (CCX_NOOV)
+CC (CCFP)
+CC (CCFPE)
+
===================================================================
Index: config/sparc/sparc.h
--- config/sparc/sparc.h	4 Jun 2002 07:09:40 -0000	1.199
+++ config/sparc/sparc.h	10 Jun 2002 06:43:02 -0000
@@ -2484,26 +2484,6 @@ do {                                    
 /* Generate calls to memcpy, memcmp and memset.  */
 #define TARGET_MEM_FUNCTIONS
 
-/* Add any extra modes needed to represent the condition code.
-
-   On the Sparc, we have a "no-overflow" mode which is used when an add or
-   subtract insn is used to set the condition code.  Different branches are
-   used in this case for some operations.
-
-   We also have two modes to indicate that the relevant condition code is
-   in the floating-point condition code register.  One for comparisons which
-   will generate an exception if the result is unordered (CCFPEmode) and
-   one for comparisons which will never trap (CCFPmode).
-
-   CCXmode and CCX_NOOVmode are only used by v9.  */
-
-#define EXTRA_CC_MODES			\
-    CC(CCXmode,	     "CCX")		\
-    CC(CC_NOOVmode,  "CC_NOOV")		\
-    CC(CCX_NOOVmode, "CCX_NOOV")	\
-    CC(CCFPmode,     "CCFP")		\
-    CC(CCFPEmode,    "CCFPE")
-
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.  For floating-point,
    CCFP[E]mode is used.  CC_NOOVmode should be used when the first operand
===================================================================
Index: doc/tm.texi
--- doc/tm.texi	4 Jun 2002 07:10:27 -0000	1.136
+++ doc/tm.texi	10 Jun 2002 06:43:05 -0000
@@ -4985,23 +4985,27 @@ two places, the @file{md} file and in @c
 
 @findex EXTRA_CC_MODES
 @item EXTRA_CC_MODES
-A list of additional modes for condition code values in registers
-(@pxref{Jump Patterns}).  This macro should expand to a sequence of
-calls of the macro @code{CC} separated by white space.  @code{CC} takes
-two arguments.  The first is the enumeration name of the mode, which
-should begin with @samp{CC} and end with @samp{mode}.  The second is a C
-string giving the printable name of the mode; it should be the same as
-the first argument, but with the trailing @samp{mode} removed.
+Condition codes are represented in registers by machine modes of class
+@code{MODE_CC}.  By default, there is just one mode, @code{CCmode}, with
+this class.  If you need more such modes, create a file named
+@file{@var{cpu}-modes.def} in your @file{config/@var{cpu}}
+directory, containing a list of these modes.  Each entry in the list
+should be a call to the macro @code{CC}.  This macro takes one argument,
+which is the name of the mode: it should begin with @samp{CC}.  Do not
+put quotation marks around the name, or include the trailing
+@samp{mode}; these are automatically added.  There should not be
+anything else in the file except comments.
 
-You should only define this macro if additional modes are required.
+A sample @file{@var{cpu}-modes.def} file might look like this:
 
-A sample definition of @code{EXTRA_CC_MODES} is:
 @smallexample
-#define EXTRA_CC_MODES            \
-    CC(CC_NOOVmode, "CC_NOOV")    \
-    CC(CCFPmode, "CCFP")          \
-    CC(CCFPEmode, "CCFPE")
+CC (CC_NOOV)   /* @r{Comparison only valid if there was no overflow.} */
+CC (CCFP)      /* @r{Floating point comparison that cannot trap.} */
+CC (CCFPE)     /* @r{Floating point comparison that may trap.} */
 @end smallexample
+
+When you create this file, the macro @code{EXTRA_CC_MODES} is
+automatically defined by @command{configure}, with value @samp{1}.
 
 @findex SELECT_CC_MODE
 @item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
===================================================================
Index: libgcc2.c
--- libgcc2.c	30 May 2002 20:55:08 -0000	1.141
+++ libgcc2.c	10 Jun 2002 07:07:36 -0000
@@ -36,6 +36,7 @@ Software Foundation, 59 Temple Place - S
 #include "tconfig.h"
 #include "tsystem.h"
 
+#include "symcat.h"
 #include "machmode.h"
 
 /* Don't use `fancy_abort' here even if config.h says to use it.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]