Commit c860fe8c by Joseph Myers Committed by Joseph Myers

opt-functions.awk (var_type_struct): Handle Enum options.

	* opt-functions.awk (var_type_struct): Handle Enum options.
	* optc-gen.awk: Don't check range of variables of character type.
	* config/rs6000/rs6000.c (rs6000_sched_insert_nops_str,
	rs6000_sched_costly_dep_str, rs6000_recip_name, rs6000_abi_name,
	rs6000_sdata_name, rs6000_explicit_options): Remove.
	(rs6000_option_override_internal): Check for -malign-power here.
	Use global_options_set instead of rs6000_explicit_options.
	(rs6000_parse_fpu_option): Remove.
	(rs6000_handle_option): Access variables via opts and opts_set
	pointers.  Use error_at and warning_at.  Add fall-through
	comments.  Don't handle OPT_mcmodel_, OPT_maix_struct_return,
	OPT_msvr4_struct_return, OPT_mvrsave, OPT_mspe, OPT_mcall_,
	OPT_msdata_, OPT_mtls_size_, OPT_mtraceback_, OPT_mfloat_gprs_,
	OPT_msched_costly_dep_, OPT_malign_ or OPT_mrecip_ explicitly
	here.  Don't use rs6000_parse_fpu_option.
	* config/rs6000/rs6000.h (fpu_type): Remove declaration.
	* config/rs6000/rs6000.opt (rs6000_long_double_type_size,
	rs6000_spe, rs6000_float_gprs): Remove TargetVariable entries.
	(mrecip=): Use Var.
	(mspe): Use Var and Save.
	(mtraceback=): Use Enum and Var.
	(rs6000_traceback_type): New Enum and EnumValue entries.
	(mfloat-gprs=): Use Enum, Var and Save.
	(rs6000_float_gprs): New Enum and EnumValue entries.
	(mlong-double-): use Var and Save.
	(msched-costly-dep=, minsert-sched-nops=): Use Var.
	(malign-): Use Enum and Var.
	(rs6000_alignment_flags): New Enum and EnumValue entries.
	(mfpu=): Use Enum.
	(fpu_type_t): New Enum and EnumValue entries.
	* config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/e500-double.h (SUB3TARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	(RS6000_DEFAULT_LONG_DOUBLE_SIZE): Remove commented-out
	definition.
	* config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/linux64.opt (mcmodel=): Use Enum and Var.
	(rs6000_cmodel): New Enum and EnumValue entries.
	* config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
	global_options_set instead of rs6000_explicit_options.
	* config/rs6000/sysv4.opt (mcall-, msdata=): Use Var.
	(mtls-size=): Use Enum and Var.
	(rs6000_tls_size): New Enum and EnumValue entries.

From-SVN: r173434
parent e3edeff4
2011-05-05 Joseph Myers <joseph@codesourcery.com>
* opt-functions.awk (var_type_struct): Handle Enum options.
* optc-gen.awk: Don't check range of variables of character type.
* config/rs6000/rs6000.c (rs6000_sched_insert_nops_str,
rs6000_sched_costly_dep_str, rs6000_recip_name, rs6000_abi_name,
rs6000_sdata_name, rs6000_explicit_options): Remove.
(rs6000_option_override_internal): Check for -malign-power here.
Use global_options_set instead of rs6000_explicit_options.
(rs6000_parse_fpu_option): Remove.
(rs6000_handle_option): Access variables via opts and opts_set
pointers. Use error_at and warning_at. Add fall-through
comments. Don't handle OPT_mcmodel_, OPT_maix_struct_return,
OPT_msvr4_struct_return, OPT_mvrsave, OPT_mspe, OPT_mcall_,
OPT_msdata_, OPT_mtls_size_, OPT_mtraceback_, OPT_mfloat_gprs_,
OPT_msched_costly_dep_, OPT_malign_ or OPT_mrecip_ explicitly
here. Don't use rs6000_parse_fpu_option.
* config/rs6000/rs6000.h (fpu_type): Remove declaration.
* config/rs6000/rs6000.opt (rs6000_long_double_type_size,
rs6000_spe, rs6000_float_gprs): Remove TargetVariable entries.
(mrecip=): Use Var.
(mspe): Use Var and Save.
(mtraceback=): Use Enum and Var.
(rs6000_traceback_type): New Enum and EnumValue entries.
(mfloat-gprs=): Use Enum, Var and Save.
(rs6000_float_gprs): New Enum and EnumValue entries.
(mlong-double-): use Var and Save.
(msched-costly-dep=, minsert-sched-nops=): Use Var.
(malign-): Use Enum and Var.
(rs6000_alignment_flags): New Enum and EnumValue entries.
(mfpu=): Use Enum.
(fpu_type_t): New Enum and EnumValue entries.
* config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/e500-double.h (SUB3TARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
(RS6000_DEFAULT_LONG_DOUBLE_SIZE): Remove commented-out
definition.
* config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/linux64.opt (mcmodel=): Use Enum and Var.
(rs6000_cmodel): New Enum and EnumValue entries.
* config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use
global_options_set instead of rs6000_explicit_options.
* config/rs6000/sysv4.opt (mcall-, msdata=): Use Var.
(mtls-size=): Use Enum and Var.
(rs6000_tls_size): New Enum and EnumValue entries.
2011-05-05 Michael Matz <matz@suse.de>
* config/alpha/elf.h (ENDFILE_SPEC): Add Ofast.
......
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX version 4.3.
Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
2007, 2009, 2010 Free Software Foundation, Inc.
2007, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org).
This file is part of GCC.
......@@ -39,7 +39,7 @@ do { \
if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \
{ \
rs6000_long_double_type_size = 64; \
if (rs6000_explicit_options.long_double) \
if (global_options_set.x_rs6000_long_double_type_size) \
warning (0, "soft-float and long-double-128 are incompatible"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
......
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX V5.2.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org).
......@@ -39,7 +39,7 @@ do { \
if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \
{ \
rs6000_long_double_type_size = 64; \
if (rs6000_explicit_options.long_double) \
if (global_options_set.x_rs6000_long_double_type_size) \
warning (0, "soft-float and long-double-128 are incompatible"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
......
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX V5.3.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org).
......@@ -39,7 +39,7 @@ do { \
if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \
{ \
rs6000_long_double_type_size = 64; \
if (rs6000_explicit_options.long_double) \
if (global_options_set.x_rs6000_long_double_type_size) \
warning (0, "soft-float and long-double-128 are incompatible"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
......
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX V6.1.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by David Edelsohn (edelsohn@gnu.org).
......@@ -39,7 +39,7 @@ do { \
if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \
{ \
rs6000_long_double_type_size = 64; \
if (rs6000_explicit_options.long_double) \
if (global_options_set.x_rs6000_long_double_type_size) \
warning (0, "soft-float and long-double-128 are incompatible"); \
} \
if (TARGET_POWERPC64 && ! TARGET_64BIT) \
......
/* Target definitions for E500 with double precision FP.
Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 2004, 2006, 2007, 2011 Free Software Foundation, Inc.
Contributed by Aldy Hernandez (aldyh@redhat.com).
This file is part of GCC.
......@@ -20,5 +20,5 @@
#undef SUB3TARGET_OVERRIDE_OPTIONS
#define SUB3TARGET_OVERRIDE_OPTIONS \
if (!rs6000_explicit_options.float_gprs) \
if (!global_options_set.x_rs6000_float_gprs) \
rs6000_float_gprs = 2;
......@@ -28,24 +28,14 @@
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
if (rs6000_select[1].string == NULL) \
rs6000_cpu = PROCESSOR_PPC8540; \
if (!rs6000_explicit_options.spe_abi) \
if (!global_options_set.x_rs6000_spe_abi) \
rs6000_spe_abi = 1; \
if (!rs6000_explicit_options.float_gprs) \
if (!global_options_set.x_rs6000_float_gprs) \
rs6000_float_gprs = 1; \
if (!rs6000_explicit_options.spe) \
if (!global_options_set.x_rs6000_spe) \
rs6000_spe = 1; \
if (target_flags & MASK_64BIT) \
error ("-m64 not supported in this configuration")
/* The e500 ABI says that either long doubles are 128 bits, or if
implemented in any other size, the compiler/linker should error out.
We have no emulation libraries for 128 bit long doubles, and I hate
the dozens of failures on the regression suite. So I'm breaking ABI
specifications, until I properly fix the emulation.
Enable these later.
#define RS6000_DEFAULT_LONG_DOUBLE_SIZE (TARGET_SPE ? 128 : 64)
*/
#undef ASM_DEFAULT_SPEC
#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
......@@ -93,7 +93,7 @@ extern int dot_symbols;
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
do \
{ \
if (!rs6000_explicit_options.alignment) \
if (!global_options_set.x_rs6000_alignment_flags) \
rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
if (TARGET_64BIT) \
{ \
......@@ -125,14 +125,14 @@ extern int dot_symbols;
} \
if ((target_flags_explicit & MASK_MINIMAL_TOC) != 0) \
{ \
if (rs6000_explicit_options.cmodel \
if (global_options_set.x_rs6000_current_cmodel \
&& rs6000_current_cmodel != CMODEL_SMALL) \
error ("-mcmodel incompatible with other toc options"); \
SET_CMODEL (CMODEL_SMALL); \
} \
else \
{ \
if (!rs6000_explicit_options.cmodel) \
if (!global_options_set.x_rs6000_current_cmodel) \
SET_CMODEL (CMODEL_MEDIUM); \
if (rs6000_current_cmodel != CMODEL_SMALL) \
{ \
......@@ -150,7 +150,7 @@ extern int dot_symbols;
TARGET_PROFILE_KERNEL = 0; \
error (INVALID_32BIT, "profile-kernel"); \
} \
if (rs6000_explicit_options.cmodel) \
if (global_options_set.x_rs6000_current_cmodel) \
{ \
SET_CMODEL (CMODEL_SMALL); \
error (INVALID_32BIT, "cmodel"); \
......
; Options for 64-bit PowerPC Linux.
;
; Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
;
; This file is part of GCC.
......@@ -24,5 +24,19 @@ Target Report Var(profile_kernel) Save
Call mcount for profiling before a function prologue
mcmodel=
Target RejectNegative Joined
Target RejectNegative Joined Enum(rs6000_cmodel) Var(rs6000_current_cmodel)
Select code model
Enum
Name(rs6000_cmodel) Type(enum rs6000_cmodel)
Known code models (for use with the -mcmodel= option):
EnumValue
Enum(rs6000_cmodel) String(small) Value(CMODEL_SMALL)
EnumValue
Enum(rs6000_cmodel) String(medium) Value(CMODEL_MEDIUM)
EnumValue
Enum(rs6000_cmodel) String(large) Value(CMODEL_LARGE)
......@@ -28,11 +28,11 @@
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
if (rs6000_select[1].string == NULL) \
rs6000_cpu = PROCESSOR_PPC8540; \
if (!rs6000_explicit_options.spe_abi) \
if (!global_options_set.x_rs6000_spe_abi) \
rs6000_spe_abi = 1; \
if (!rs6000_explicit_options.float_gprs) \
if (!global_options_set.x_rs6000_float_gprs) \
rs6000_float_gprs = 1; \
if (!rs6000_explicit_options.spe) \
if (!global_options_set.x_rs6000_spe) \
rs6000_spe = 1; \
if (target_flags & MASK_64BIT) \
error ("-m64 not supported in this configuration")
......
......@@ -354,8 +354,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#define PROCESSOR_DEFAULT PROCESSOR_RIOS1
#define PROCESSOR_DEFAULT64 PROCESSOR_RS64A
extern enum fpu_type_t fpu_type;
/* Specify the dialect of assembler to use. New mnemonics is dialect one
and the old mnemonics are dialect zero. */
#define ASSEMBLER_DIALECT (TARGET_NEW_MNEMONICS ? 1 : 0)
......
......@@ -47,10 +47,6 @@ enum rs6000_dependence_cost rs6000_sched_costly_dep = no_dep_costly
TargetVariable
enum rs6000_nop_insertion rs6000_sched_insert_nops = sched_finish_none
;; Size of long double.
TargetVariable
unsigned char rs6000_long_double_type_size
;; IEEE quad extended precision long double.
TargetVariable
unsigned char rs6000_ieeequad
......@@ -59,18 +55,10 @@ unsigned char rs6000_ieeequad
TargetVariable
unsigned char rs6000_altivec_abi
;; Nonzero if we want SPE SIMD instructions.
TargetVariable
int rs6000_spe
;; Nonzero if we want SPE ABI extensions.
TargetVariable
unsigned char rs6000_spe_abi
;; Nonzero if floating point operations are done in the GPRs.
TargetVariable
unsigned char rs6000_float_gprs
;; Nonzero if we want Darwin's struct-by-value-in-regs ABI.
TargetVariable
unsigned char rs6000_darwin64_abi
......@@ -311,7 +299,7 @@ Target Report
Generate software reciprocal divide and square root for better throughput.
mrecip=
Target Report RejectNegative Joined
Target Report RejectNegative Joined Var(rs6000_recip_name)
Generate software reciprocal divide and square root for better throughput.
mrecip-precision
......@@ -378,7 +366,7 @@ Target RejectNegative Alias(misel)
Deprecated option. Use -misel instead
mspe
Target
Target Var(rs6000_spe) Save
Generate SPE SIMD instructions on E500
mpaired
......@@ -410,9 +398,21 @@ Target RejectNegative Joined
-mtune= Schedule code for given CPU
mtraceback=
Target RejectNegative Joined
Target RejectNegative Joined Enum(rs6000_traceback_type) Var(rs6000_traceback)
-mtraceback= Select full, part, or no traceback table
Enum
Name(rs6000_traceback_type) Type(enum rs6000_traceback_type)
EnumValue
Enum(rs6000_traceback_type) String(full) Value(traceback_full)
EnumValue
Enum(rs6000_traceback_type) String(part) Value(traceback_part)
EnumValue
Enum(rs6000_traceback_type) String(no) Value(traceback_none)
mlongcall
Target Report Var(rs6000_default_long_calls) Save
Avoid all range limits on call instructions
......@@ -430,25 +430,51 @@ Target Var(rs6000_warn_altivec_long) Init(1) Save
Warn about deprecated 'vector long ...' AltiVec type usage
mfloat-gprs=
Target RejectNegative Joined
Target RejectNegative Joined Enum(rs6000_float_gprs) Var(rs6000_float_gprs) Save
-mfloat-gprs= Select GPR floating point method
Enum
Name(rs6000_float_gprs) Type(unsigned char)
Valid arguments to -mfloat-gprs=:
EnumValue
Enum(rs6000_float_gprs) String(yes) Value(1)
EnumValue
Enum(rs6000_float_gprs) String(single) Value(1)
EnumValue
Enum(rs6000_float_gprs) String(double) Value(2)
EnumValue
Enum(rs6000_float_gprs) String(no) Value(0)
mlong-double-
Target RejectNegative Joined UInteger
Target RejectNegative Joined UInteger Var(rs6000_long_double_type_size) Save
-mlong-double-<n> Specify size of long double (64 or 128 bits)
msched-costly-dep=
Target RejectNegative Joined
Target RejectNegative Joined Var(rs6000_sched_costly_dep_str)
Determine which dependences between insns are considered costly
minsert-sched-nops=
Target RejectNegative Joined
Target RejectNegative Joined Var(rs6000_sched_insert_nops_str)
Specify which post scheduling nop insertion scheme to apply
malign-
Target RejectNegative Joined
Target RejectNegative Joined Enum(rs6000_alignment_flags) Var(rs6000_alignment_flags)
Specify alignment of structure fields default/natural
Enum
Name(rs6000_alignment_flags) Type(unsigned char)
Valid arguments to -malign-:
EnumValue
Enum(rs6000_alignment_flags) String(power) Value(MASK_ALIGN_POWER)
EnumValue
Enum(rs6000_alignment_flags) String(natural) Value(MASK_ALIGN_NATURAL)
mprioritize-restricted-insns=
Target RejectNegative Joined UInteger Var(rs6000_sched_restricted_insns_priority) Save
Specify scheduling priority for dispatch slot restricted insns
......@@ -466,9 +492,27 @@ Target RejectNegative Var(rs6000_simple_fpu) Save
Floating point unit does not support divide & sqrt
mfpu=
Target RejectNegative Joined
Target RejectNegative Joined Enum(fpu_type_t)
-mfpu= Specify FP (sp, dp, sp-lite, dp-lite) (implies -mxilinx-fpu)
Enum
Name(fpu_type_t) Type(enum fpu_type_t)
EnumValue
Enum(fpu_type_t) String(none) Value(FPU_NONE)
EnumValue
Enum(fpu_type_t) String(sp_lite) Value(FPU_SF_LITE)
EnumValue
Enum(fpu_type_t) String(dp_lite) Value(FPU_DF_LITE)
EnumValue
Enum(fpu_type_t) String(sp_full) Value(FPU_SF_FULL)
EnumValue
Enum(fpu_type_t) String(dp_full) Value(FPU_DF_FULL)
mxilinx-fpu
Target Var(rs6000_xilinx_fpu) Save
Specify Xilinx FPU.
......
; SYSV4 options for PPC port.
;
; Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
; Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
; Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
;
; This file is part of GCC.
......@@ -20,17 +21,29 @@
; <http://www.gnu.org/licenses/>.
mcall-
Target RejectNegative Joined
Target RejectNegative Joined Var(rs6000_abi_name)
Select ABI calling convention
msdata=
Target RejectNegative Joined
Target RejectNegative Joined Var(rs6000_sdata_name)
Select method for sdata handling
mtls-size=
Target RejectNegative Joined
Target RejectNegative Joined Var(rs6000_tls_size) Enum(rs6000_tls_size)
Specify bit size of immediate TLS offsets
Enum
Name(rs6000_tls_size) Type(int)
EnumValue
Enum(rs6000_tls_size) String(16) Value(16)
EnumValue
Enum(rs6000_tls_size) String(32) Value(32)
EnumValue
Enum(rs6000_tls_size) String(64) Value(64)
mbit-align
Target Report Var(TARGET_NO_BITFIELD_TYPE) Save
Align to the base type of the bit-field
......
......@@ -192,6 +192,10 @@ function var_type_struct(flags)
{
if (flag_set_p("UInteger", flags))
return "int "
else if (flag_set_p("Enum.*", flags)) {
en = opt_args("Enum", flags);
return enum_type[en] " "
}
else if (!flag_set_p("Joined.*", flags) && !flag_set_p("Separate", flags)) {
if (flag_set_p(".*Mask.*", flags))
return "int "
......
......@@ -629,6 +629,8 @@ if (have_save) {
var_target_range[name] = "0, 255"
else if (otype ~ "^signed +char *$")
var_target_range[name] = "-128, 127"
if (otype == var_type(flags[i]))
var_target_range[name] = ""
}
else
var_target_other[n_target_other++] = name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment