Commit a2db2771 by Janis Johnson Committed by Janis Johnson

re PR target/34526 (no-altivec ABI should be fixed or no longer be the default)

	PR target/34526
	* config/rs6000/rs6000.c (rs6000_altivec_abi): Clarify comment.
	(rs6000_explicit_options): Split abi into spe_abi and altivec_abi,
	add vrsave.
	(rs6000_override_options): Set altivec_abi as default, not override,
	for 64-bit GNU/Linux; for 32-bit GNU/Linux default to altivec_abi for
	TARGET_ALTIVEC; default to TARGET_ALTIVEC_VRSAVE when AltiVec ABI
	is used; use new member spe_abi.
	(rs6000_handle_option): Set rs6000_explicit_options.vrsave; use
	spe_abi and altivec_abi.

From-SVN: r132537
parent b3184fd1
2008-02-21 Janis Johnson <janis187@us.ibm.com>
PR target/34526
* config/rs6000/rs6000.c (rs6000_altivec_abi): Clarify comment.
(rs6000_explicit_options): Split abi into spe_abi and altivec_abi,
add vrsave.
(rs6000_override_options): Set altivec_abi as default, not override,
for 64-bit GNU/Linux; for 32-bit GNU/Linux default to altivec_abi for
TARGET_ALTIVEC; default to TARGET_ALTIVEC_VRSAVE when AltiVec ABI
is used; use new member spe_abi.
(rs6000_handle_option): Set rs6000_explicit_options.vrsave; use
spe_abi and altivec_abi.
2008-02-22 Tomas Bily <tbily@suse.cz> 2008-02-22 Tomas Bily <tbily@suse.cz>
* tree-vectorizer.c (vect_is_simple_reduction): Fix comment typo. * tree-vectorizer.c (vect_is_simple_reduction): Fix comment typo.
......
...@@ -171,7 +171,7 @@ int rs6000_long_double_type_size; ...@@ -171,7 +171,7 @@ int rs6000_long_double_type_size;
/* IEEE quad extended precision long double. */ /* IEEE quad extended precision long double. */
int rs6000_ieeequad; int rs6000_ieeequad;
/* Whether -mabi=altivec has appeared. */ /* Nonzero to use AltiVec ABI. */
int rs6000_altivec_abi; int rs6000_altivec_abi;
/* Nonzero if we want SPE ABI extensions. */ /* Nonzero if we want SPE ABI extensions. */
...@@ -262,12 +262,14 @@ int rs6000_alignment_flags; ...@@ -262,12 +262,14 @@ int rs6000_alignment_flags;
struct { struct {
bool aix_struct_ret; /* True if -maix-struct-ret was used. */ bool aix_struct_ret; /* True if -maix-struct-ret was used. */
bool alignment; /* True if -malign- was used. */ bool alignment; /* True if -malign- was used. */
bool abi; /* True if -mabi=spe/nospe was used. */ bool spe_abi; /* True if -mabi=spe/no-spe was used. */
bool altivec_abi; /* True if -mabi=altivec/no-altivec used. */
bool spe; /* True if -mspe= was used. */ bool spe; /* True if -mspe= was used. */
bool float_gprs; /* True if -mfloat-gprs= was used. */ bool float_gprs; /* True if -mfloat-gprs= was used. */
bool isel; /* True if -misel was used. */ bool isel; /* True if -misel was used. */
bool long_double; /* True if -mlong-double- was used. */ bool long_double; /* True if -mlong-double- was used. */
bool ieee; /* True if -mabi=ieee/ibmlongdouble used. */ bool ieee; /* True if -mabi=ieee/ibmlongdouble used. */
bool vrsave; /* True if -mvrsave was used. */
} rs6000_explicit_options; } rs6000_explicit_options;
struct builtin_description struct builtin_description
...@@ -1590,11 +1592,18 @@ rs6000_override_options (const char *default_cpu) ...@@ -1590,11 +1592,18 @@ rs6000_override_options (const char *default_cpu)
if (TARGET_XCOFF && TARGET_ALTIVEC) if (TARGET_XCOFF && TARGET_ALTIVEC)
rs6000_altivec_abi = 1; rs6000_altivec_abi = 1;
/* Set Altivec ABI as default for PowerPC64 Linux. */ /* The AltiVec ABI is the default for PowerPC-64 GNU/Linux. For
if (TARGET_ELF && TARGET_64BIT) PowerPC-32 GNU/Linux, -maltivec implies the AltiVec ABI. It can
be explicitly overridden in either case. */
if (TARGET_ELF)
{ {
rs6000_altivec_abi = 1; if (!rs6000_explicit_options.altivec_abi
TARGET_ALTIVEC_VRSAVE = 1; && (TARGET_64BIT || TARGET_ALTIVEC))
rs6000_altivec_abi = 1;
/* Enable VRSAVE for AltiVec ABI, unless explicitly overridden. */
if (!rs6000_explicit_options.vrsave)
TARGET_ALTIVEC_VRSAVE = rs6000_altivec_abi;
} }
/* Set the Darwin64 ABI as default for 64-bit Darwin. */ /* Set the Darwin64 ABI as default for 64-bit Darwin. */
...@@ -1638,7 +1647,7 @@ rs6000_override_options (const char *default_cpu) ...@@ -1638,7 +1647,7 @@ rs6000_override_options (const char *default_cpu)
/* For the powerpc-eabispe configuration, we set all these by /* For the powerpc-eabispe configuration, we set all these by
default, so let's unset them if we manually set another default, so let's unset them if we manually set another
CPU that is not the E500. */ CPU that is not the E500. */
if (!rs6000_explicit_options.abi) if (!rs6000_explicit_options.spe_abi)
rs6000_spe_abi = 0; rs6000_spe_abi = 0;
if (!rs6000_explicit_options.spe) if (!rs6000_explicit_options.spe)
rs6000_spe = 0; rs6000_spe = 0;
...@@ -2131,6 +2140,7 @@ rs6000_handle_option (size_t code, const char *arg, int value) ...@@ -2131,6 +2140,7 @@ rs6000_handle_option (size_t code, const char *arg, int value)
break; break;
case OPT_mvrsave_: case OPT_mvrsave_:
rs6000_explicit_options.vrsave = true;
rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE)); rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
break; break;
...@@ -2188,19 +2198,20 @@ rs6000_handle_option (size_t code, const char *arg, int value) ...@@ -2188,19 +2198,20 @@ rs6000_handle_option (size_t code, const char *arg, int value)
case OPT_mabi_: case OPT_mabi_:
if (!strcmp (arg, "altivec")) if (!strcmp (arg, "altivec"))
{ {
rs6000_explicit_options.abi = true; rs6000_explicit_options.altivec_abi = true;
rs6000_altivec_abi = 1; rs6000_altivec_abi = 1;
/* Enabling the AltiVec ABI turns off the SPE ABI. */
rs6000_spe_abi = 0; rs6000_spe_abi = 0;
} }
else if (! strcmp (arg, "no-altivec")) else if (! strcmp (arg, "no-altivec"))
{ {
/* ??? Don't set rs6000_explicit_options.abi here, to allow rs6000_explicit_options.altivec_abi = true;
the default for rs6000_spe_abi to be chosen later. */
rs6000_altivec_abi = 0; rs6000_altivec_abi = 0;
} }
else if (! strcmp (arg, "spe")) else if (! strcmp (arg, "spe"))
{ {
rs6000_explicit_options.abi = true; rs6000_explicit_options.spe_abi = true;
rs6000_spe_abi = 1; rs6000_spe_abi = 1;
rs6000_altivec_abi = 0; rs6000_altivec_abi = 0;
if (!TARGET_SPE_ABI) if (!TARGET_SPE_ABI)
...@@ -2208,7 +2219,7 @@ rs6000_handle_option (size_t code, const char *arg, int value) ...@@ -2208,7 +2219,7 @@ rs6000_handle_option (size_t code, const char *arg, int value)
} }
else if (! strcmp (arg, "no-spe")) else if (! strcmp (arg, "no-spe"))
{ {
rs6000_explicit_options.abi = true; rs6000_explicit_options.spe_abi = true;
rs6000_spe_abi = 0; rs6000_spe_abi = 0;
} }
......
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