From 6ff59fe717a9fcc8b4a645bc142531ecf4fb4751 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 2 May 2005 21:17:37 +0000 Subject: [PATCH] mmix.opt: New file. * 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. From-SVN: r99122 --- gcc/ChangeLog | 18 +++++++ gcc/config/mmix/mmix.c | 7 +-- gcc/config/mmix/mmix.h | 83 +------------------------------- gcc/config/mmix/mmix.opt | 100 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 87 deletions(-) create mode 100644 gcc/config/mmix/mmix.opt diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4183ec0f5df..f0a7f151e45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2005-05-02 Hans-Peter Nilsson + + * 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. + 2005-05-02 Joseph S. Myers PR c/15698 diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index f53c9b07177..7ee39cd6f1e 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -107,11 +107,6 @@ Boston, MA 02111-1307, USA. */ 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. */ @@ -209,6 +204,8 @@ static bool mmix_pass_by_reference (const CUMULATIVE_ARGS *, #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; diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 627231747e8..52aa98cfc25 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -124,15 +124,6 @@ struct machine_function GTY(()) %{!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" @@ -156,80 +147,8 @@ extern const char *mmix_cc1_ignored_option; 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, ""}} + (MASK_BRANCH_PREDICT | MASK_BASE_ADDRESSES | MASK_USE_RETURN_INSN) /* Unfortunately, this must not reference anything in "mmix.c". */ #define TARGET_VERSION \ diff --git a/gcc/config/mmix/mmix.opt b/gcc/config/mmix/mmix.opt new file mode 100644 index 00000000000..5bbad5fcbb1 --- /dev/null +++ b/gcc/config/mmix/mmix.opt @@ -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