aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@avtrex.com>2007-09-11 20:14:51 +0000
committerDavid Daney <daney@gcc.gnu.org>2007-09-11 20:14:51 +0000
commit66471b4708b84db82570b9747fb4e157c23f9804 (patch)
tree14dfcb7d16ebfd463a4f9ecab96e3573379f51d0 /gcc/config/mips/mips.c
parentfa89b6ecba4ce9448b82a21f91b360eacf57bc72 (diff)
downloadgcc-66471b4708b84db82570b9747fb4e157c23f9804.zip
gcc-66471b4708b84db82570b9747fb4e157c23f9804.tar.gz
gcc-66471b4708b84db82570b9747fb4e157c23f9804.tar.bz2
invoke.texi: Document new MIPS -mllsc and -mno-llsc options.
* doc/invoke.texi: Document new MIPS -mllsc and -mno-llsc options. * doc/install.texi: Document new --with-llsc and --without-llsc options. * config.gcc: Handle --with-llsc and --without-llsc configure options. * config/mips/mips.md (sync, memory_barrier): Wrap sync instrunction in %| and %- operand codes. Depend on GENERATE_SYNC instead of ISA_HAS_SYNC. (sync_compare_and_swap<mode>, sync_add<mode>, sync_sub<mode>, sync_old_add<mode>, sync_old_sub<mode>, sync_new_add<mode>, sync_new_sub<mode>, sync_<optab><mode>, sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>, sync_new_nand<mode>, sync_lock_test_and_set<mode>): Depend on GENERATE_LL_SC instead of ISA_HAS_LL_SC. * config/mips/mips.opt (mllsc): New option. * config/mips/mips.c (mips_llsc): Define variable. (mips_handle_option): Handle mllsc option. (override_options): Set mips_print_operand_punct for '|' and '-'. (print_operand): Add new %| and %- operand codes. * config/mips/mips.h (mips_llsc_setting): New enum type. (mips_llsc): Declare. (OPTION_DEFAULT_SPECS): Add llsc handling. (GENERATE_SYNC): New macro. (GENERATE_LL_SC): New macro. (MIPS_COMPARE_AND_SWAP, MIPS_SYNC_OP, MIPS_SYNC_OLD_OP, MIPS_SYNC_NEW_OP, MIPS_SYNC_NAND, MIPS_SYNC_OLD_NAND, MIPS_SYNC_NEW_NAND, MIPS_SYNC_EXCHANGE): Wrap instructions in %| and %- operand codes. From-SVN: r128392
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r--gcc/config/mips/mips.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 289f46e..1a2cc06 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -636,6 +636,9 @@ static GTY(()) int mips16_flipper;
/* The -mtext-loads setting. */
enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES;
+/* The -mllsc setting. */
+enum mips_llsc_setting mips_llsc = LLSC_DEFAULT;
+
/* The architecture selected by -mipsN. */
static const struct mips_cpu_info *mips_isa_info;
@@ -5711,7 +5714,7 @@ mips_set_current_function (tree fndecl ATTRIBUTE_UNUSED)
/* Implement TARGET_HANDLE_OPTION. */
static bool
-mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+mips_handle_option (size_t code, const char *arg, int value)
{
switch (code)
{
@@ -5753,6 +5756,10 @@ mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
return false;
return true;
+ case OPT_mllsc:
+ mips_llsc = value ? LLSC_YES : LLSC_NO;
+ return true;
+
default:
return true;
}
@@ -6015,6 +6022,8 @@ override_options (void)
mips_print_operand_punct['$'] = 1;
mips_print_operand_punct['+'] = 1;
mips_print_operand_punct['~'] = 1;
+ mips_print_operand_punct['|'] = 1;
+ mips_print_operand_punct['-'] = 1;
/* Set up array to map GCC register number to debug register number.
Ignore the special purpose register numbers. */
@@ -6377,7 +6386,10 @@ mips_strip_unspec_address (rtx op)
'^' Print the name of the pic call-through register (t9 or $25).
'$' Print the name of the stack pointer register (sp or $29).
'+' Print the name of the gp register (usually gp or $28).
- '~' Output a branch alignment to LABEL_ALIGN(NULL). */
+ '~' Output a branch alignment to LABEL_ALIGN(NULL).
+ '|' Print .set push; .set mips2 if mips_llsc == LLSC_YES
+ && !ISA_HAS_LL_SC.
+ '-' Print .set pop under the same conditions for '|'. */
void
print_operand (FILE *file, rtx op, int letter)
@@ -6507,6 +6519,16 @@ print_operand (FILE *file, rtx op, int letter)
}
break;
+ case '|':
+ if (!ISA_HAS_LL_SC)
+ fputs (".set\tpush\n\t.set\tmips2\n\t", file);
+ break;
+
+ case '-':
+ if (!ISA_HAS_LL_SC)
+ fputs ("\n\t.set\tpop", file);
+ break;
+
default:
error ("PRINT_OPERAND: unknown punctuation '%c'", letter);
break;