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]

Committed, MMIX: mmix.opt


Noticed a bug: -mno-set-program-start was incorrectly specified as
-mno-toplevel-symbols in TARGET_SWITCHES.  Otherwise nothing unexpected.
Tested manually, as I don't see the option handling changing again in the
next ten years in a way calling for specific target maintenance.

	* config/mmix/mmix.opt: New file.
	* config/mmix/mmix.h: Move options-related comments to mmix.opt.
 	(mmix_cc1_ignored_option): Don't declare.
	(TARGET_OPTIONS, TARGET_MASK_LIBFUNCS, TARGET_MASK_ABI_GNU)
	(TARGET_MASK_FCMP_EPSILON, TARGET_MASK_ZERO_EXTEND)
	(TARGET_MASK_KNUTH_DIVISION, TARGET_MASK_TOPLEVEL_SYMBOLS)
	(TARGET_MASK_BRANCH_PREDICT, TARGET_MASK_USE_RETURN_INSN)
	(TARGET_MASK_BASE_ADDRESSES, TARGET_LIBFUNC, TARGET_ABI_GNU,
	(TARGET_FCMP_EPSILON, TARGET_ZERO_EXTEND, TARGET_KNUTH_DIVISION)
	(TARGET_TOPLEVEL_SYMBOLS, TARGET_BRANCH_PREDICT)
	(TARGET_BASE_ADDRESSES, TARGET_USE_RETURN_INSN, TARGET_SWITCHES):
	Don't define.
	(TARGET_DEFAULT): Change TARGET_MASK_... to MASK_...
	* config/mmix/mmix.c (mmix_cc1_ignored_option): Remove.
	(TARGET_DEFAULT_TARGET_FLAGS): Override default.

Index: mmix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.c,v
retrieving revision 1.77
diff -p -c -r1.77 mmix.c
*** mmix.c	28 Apr 2005 05:38:42 -0000	1.77
--- mmix.c	2 May 2005 21:07:14 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 107,117 ****
  rtx mmix_compare_op0;
  rtx mmix_compare_op1;

- /* We ignore some options with arguments.  They are passed to the linker,
-    but also ends up here because they start with "-m".  We tell the driver
-    to store them in a variable we don't inspect.  */
- const char *mmix_cc1_ignored_option;
-
  /* Declarations of locals.  */

  /* Intermediate for insn output.  */
--- 107,112 ----
*************** static bool mmix_pass_by_reference (cons
*** 209,214 ****
--- 204,211 ----
  #define TARGET_PASS_BY_REFERENCE mmix_pass_by_reference
  #undef TARGET_CALLEE_COPIES
  #define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
+ #undef TARGET_DEFAULT_TARGET_FLAGS
+ #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT

  struct gcc_target targetm = TARGET_INITIALIZER;

Index: mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.71
diff -p -c -r1.71 mmix.h
*** mmix.h	30 Dec 2004 01:16:09 -0000	1.71
--- mmix.h	2 May 2005 21:07:15 -0000
*************** struct machine_function GTY(())
*** 124,138 ****
       %{!r:--defsym __.MMIX.start..text=0x100}}}\
    %{!melf:%{!r:-m mmo}}%{melf|r:-m elf64mmix}"

- /* Put unused option values here.  */
- extern const char *mmix_cc1_ignored_option;
-
- #define TARGET_OPTIONS					\
-    {{"set-program-start=", &mmix_cc1_ignored_option,	\
-   N_("Set start-address of the program"), 0},		\
-     {"set-data-start=", &mmix_cc1_ignored_option,	\
-   N_("Set start-address of data"), 0} }
-
  /* FIXME: There's no provision for profiling here.  */
  #define STARTFILE_SPEC  \
    "crti%O%s crtbegin%O%s"
--- 124,129 ----
*************** extern const char *mmix_cc1_ignored_opti
*** 156,235 ****

  extern int target_flags;

- #define TARGET_MASK_LIBFUNCS 1
- #define TARGET_MASK_ABI_GNU 2
- #define TARGET_MASK_FCMP_EPSILON 4
- #define TARGET_MASK_ZERO_EXTEND 8
- #define TARGET_MASK_KNUTH_DIVISION 16
- #define TARGET_MASK_TOPLEVEL_SYMBOLS 32
- #define TARGET_MASK_BRANCH_PREDICT 64
- #define TARGET_MASK_USE_RETURN_INSN 128
-
- /* We use the term "base address" since that's what Knuth uses.  The base
-    address goes in a global register.  When addressing, it's more like
-    "base address plus offset", with the offset being 0..255 from the base,
-    which itself can be a symbol plus an offset.  The effect is like having
-    a constant pool in global registers, code offsetting from those
-    registers (automatically causing a request for a suitable constant base
-    address register) without having to know the specific register or the
-    specific offset.  The setback is that there's a limited number of
-    registers, and you'll not find out until link time whether you
-    should have compiled with -mno-base-addresses.  */
- #define TARGET_MASK_BASE_ADDRESSES 128
-
- /* FIXME: Get rid of this one.  */
- #define TARGET_LIBFUNC (target_flags & TARGET_MASK_LIBFUNCS)
- #define TARGET_ABI_GNU (target_flags & TARGET_MASK_ABI_GNU)
- #define TARGET_FCMP_EPSILON (target_flags & TARGET_MASK_FCMP_EPSILON)
- #define TARGET_ZERO_EXTEND (target_flags & TARGET_MASK_ZERO_EXTEND)
- #define TARGET_KNUTH_DIVISION (target_flags & TARGET_MASK_KNUTH_DIVISION)
- #define TARGET_TOPLEVEL_SYMBOLS (target_flags & TARGET_MASK_TOPLEVEL_SYMBOLS)
- #define TARGET_BRANCH_PREDICT (target_flags & TARGET_MASK_BRANCH_PREDICT)
- #define TARGET_BASE_ADDRESSES (target_flags & TARGET_MASK_BASE_ADDRESSES)
- #define TARGET_USE_RETURN_INSN (target_flags & TARGET_MASK_USE_RETURN_INSN)
-
  #define TARGET_DEFAULT \
!  (TARGET_MASK_BRANCH_PREDICT | TARGET_MASK_BASE_ADDRESSES \
!   | TARGET_MASK_USE_RETURN_INSN)
!
! /* FIXME: Provide a way to *load* the epsilon register.  */
! #define TARGET_SWITCHES							\
!  {{"libfuncs",		TARGET_MASK_LIBFUNCS,				\
!    N_("For intrinsics library: pass all parameters in registers")},	\
!   {"no-libfuncs",	-TARGET_MASK_LIBFUNCS, ""},			\
!   {"abi=mmixware",	-TARGET_MASK_ABI_GNU,				\
!    N_("Use register stack for parameters and return value")},		\
!   {"abi=gnu",		TARGET_MASK_ABI_GNU,				\
!    N_("Use call-clobbered registers for parameters and return value")},	\
!   {"epsilon",		TARGET_MASK_FCMP_EPSILON,			\
!    N_("Use epsilon-respecting floating point compare instructions")},	\
!   {"no-epsilon",	-TARGET_MASK_FCMP_EPSILON, ""},			\
!   {"zero-extend",	TARGET_MASK_ZERO_EXTEND,			\
!    N_("Use zero-extending memory loads, not sign-extending ones")},	\
!   {"no-zero-extend",	-TARGET_MASK_ZERO_EXTEND,  ""},			\
!   {"knuthdiv",		TARGET_MASK_KNUTH_DIVISION,			\
!    N_("Generate divide results with reminder having the same sign as the\
!  divisor (not the dividend)")},						\
!   {"no-knuthdiv",	-TARGET_MASK_KNUTH_DIVISION, ""},		\
!   {"toplevel-symbols",	TARGET_MASK_TOPLEVEL_SYMBOLS,			\
!    N_("Prepend global symbols with \":\" (for use with PREFIX)")},	\
!   {"no-toplevel-symbols", -TARGET_MASK_TOPLEVEL_SYMBOLS,		\
!    N_("Do not provide a default start-address 0x100 of the program")},	\
!   {"elf", 0,								\
!    N_("Link to emit program in ELF format (rather than mmo)")},		\
!   {"branch-predict",	TARGET_MASK_BRANCH_PREDICT,			\
!    N_("Use P-mnemonics for branches statically predicted as taken")},	\
!   {"no-branch-predict",	-TARGET_MASK_BRANCH_PREDICT,			\
!    N_("Don't use P-mnemonics for branches")},				\
!   {"base-addresses",	TARGET_MASK_BASE_ADDRESSES,			\
!    N_("Use addresses that allocate global registers")},			\
!   {"no-base-addresses",	-TARGET_MASK_BASE_ADDRESSES,			\
!    N_("Do not use addresses that allocate global registers")},		\
!   {"single-exit",	-TARGET_MASK_USE_RETURN_INSN,			\
!    N_("Generate a single exit point for each function")},		\
!   {"no-single-exit",	TARGET_MASK_USE_RETURN_INSN,			\
!    N_("Do not generate a single exit point for each function")},	\
!   {"",			TARGET_DEFAULT, ""}}

  /* Unfortunately, this must not reference anything in "mmix.c".  */
  #define TARGET_VERSION \
--- 147,154 ----

  extern int target_flags;

  #define TARGET_DEFAULT \
!  (MASK_BRANCH_PREDICT | MASK_BASE_ADDRESSES | MASK_USE_RETURN_INSN)

  /* Unfortunately, this must not reference anything in "mmix.c".  */
  #define TARGET_VERSION \
--- /dev/null	2004-02-23 22:02:56.000000000 +0100
+++ mmix.opt	2005-05-01 23:20:52.000000000 +0200
@@ -0,0 +1,100 @@
+; Options for the MMIX port of the compiler.
+
+; Copyright (C) 2005 Free Software Foundation, Inc.
+;
+; 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.
+
+; FIXME: Get rid of this one.
+mlibfuncs
+Target Report Mask(LIBFUNC)
+For intrinsics library: pass all parameters in registers
+
+mabi=mmixware
+Target Report RejectNegative InverseMask(ABI_GNU)
+Use register stack for parameters and return value
+
+mabi=gnu
+Target Report RejectNegative Mask(ABI_GNU)
+Use call-clobbered registers for parameters and return value
+
+; FIXME: Provide a way to *load* the epsilon register.
+mepsilon
+Target Report Mask(FCMP_EPSILON)
+Use epsilon-respecting floating point compare instructions
+
+mzero-extend
+Target Report Mask(ZERO_EXTEND)
+Use zero-extending memory loads, not sign-extending ones
+
+mknuthdiv
+Target Report Mask(KNUTH_DIVISION)
+Generate divide results with reminder having the same sign as the divisor (not the dividend)
+
+mtoplevel-symbols
+Target Report Mask(TOPLEVEL_SYMBOLS)
+Prepend global symbols with \":\" (for use with PREFIX)
+
+mno-set-program-start
+Target Report RejectNegative
+Do not provide a default start-address 0x100 of the program
+
+melf
+Target Report RejectNegative
+Link to emit program in ELF format (rather than mmo)
+
+mbranch-predict
+Target Report RejectNegative Mask(BRANCH_PREDICT)
+Use P-mnemonics for branches statically predicted as taken
+
+mno-branch-predict
+Target Report RejectNegative InverseMask(BRANCH_PREDICT)
+Don't use P-mnemonics for branches
+
+; We use the term "base address" since that's what Knuth uses.  The base
+; address goes in a global register.  When addressing, it's more like
+; "base address plus offset", with the offset being 0..255 from the base,
+; which itself can be a symbol plus an offset.  The effect is like having
+; a constant pool in global registers, code offsetting from those
+; registers (automatically causing a request for a suitable constant base
+; address register) without having to know the specific register or the
+; specific offset.  The setback is that there's a limited number of
+; registers, and you'll not find out until link time whether you
+; should have compiled with -mno-base-addresses.
+mbase-addresses
+Target Report RejectNegative Mask(BASE_ADDRESSES)
+Use addresses that allocate global registers
+
+mno-base-addresses
+Target Report RejectNegative InverseMask(BASE_ADDRESSES)
+Do not use addresses that allocate global registers
+
+msingle-exit
+Target Report RejectNegative InverseMask(USE_RETURN_INSN)
+Generate a single exit point for each function
+
+mno-single-exit
+Target Report RejectNegative Mask(USE_RETURN_INSN)
+Do not generate a single exit point for each function
+
+mset-program-start=
+Target Report RejectNegative Joined
+Set start-address of the program
+
+mset-data-start=
+Target Report RejectNegative Joined
+Set start-address of data

brgds, H-P


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