aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorDenis Chertykov <chertykov@gmail.com>2014-03-29 09:53:16 +0400
committerDenis Chertykov <chertykov@gmail.com>2014-03-29 09:53:16 +0400
commitaf910977fbd500214e93d0a9b3d61e707df6d93c (patch)
tree139f96cbbb62fbbb04d6c655fd8c04410cbe3c55 /gas/config
parented0251d24b7573e58fe22bea44c04887daedaa32 (diff)
downloadgdb-af910977fbd500214e93d0a9b3d61e707df6d93c.zip
gdb-af910977fbd500214e93d0a9b3d61e707df6d93c.tar.gz
gdb-af910977fbd500214e93d0a9b3d61e707df6d93c.tar.bz2
* config/tc-avr.c: Add specified_mcu variable for selected mcu.
(enum options): add OPTION_RMW_ISA for -mrmw option. (struct option md_longopts): Add mrmw option. (md_show_usage): add -mrmw option description. (md_parse_option): Update isa details if -mrmw option specified. * doc/c-avr.texi: Add doc for new option -mrmw. * gas/avr/avr.exp: Run new tests. * gas/avr/rmw.d: Add test for additional ISA support. * gas/avr/rmw.s: Ditto.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-avr.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index d382fd9..5049d11 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -326,8 +326,10 @@ static struct mcu_type_s mcu_types[] =
{NULL, 0, 0}
};
+
/* Current MCU type. */
static struct mcu_type_s default_mcu = {"avr2", AVR_ISA_AVR2, bfd_mach_avr2};
+static struct mcu_type_s specified_mcu;
static struct mcu_type_s * avr_mcu = & default_mcu;
/* AVR target-specific switches. */
@@ -398,7 +400,8 @@ enum options
{
OPTION_ALL_OPCODES = OPTION_MD_BASE + 1,
OPTION_NO_SKIP_BUG,
- OPTION_NO_WRAP
+ OPTION_NO_WRAP,
+ OPTION_ISA_RMW
};
struct option md_longopts[] =
@@ -407,6 +410,7 @@ struct option md_longopts[] =
{ "mall-opcodes", no_argument, NULL, OPTION_ALL_OPCODES },
{ "mno-skip-bug", no_argument, NULL, OPTION_NO_SKIP_BUG },
{ "mno-wrap", no_argument, NULL, OPTION_NO_WRAP },
+ { "mrmw", no_argument, NULL, OPTION_ISA_RMW },
{ NULL, no_argument, NULL, 0 }
};
@@ -511,7 +515,9 @@ md_show_usage (FILE *stream)
" -mno-skip-bug disable warnings for skipping two-word instructions\n"
" (default for avr4, avr5)\n"
" -mno-wrap reject rjmp/rcall instructions with 8K wrap-around\n"
- " (default for avr3, avr5)\n"));
+ " (default for avr3, avr5)\n"
+ " -mrmw accept Read-Modify-Write instructions\n"
+ ));
show_mcu_list (stream);
}
@@ -558,7 +564,12 @@ md_parse_option (int c, char *arg)
type - this for allows passing -mmcu=... via gcc ASM_SPEC as well
as .arch ... in the asm output at the same time. */
if (avr_mcu == &default_mcu || avr_mcu->mach == mcu_types[i].mach)
- avr_mcu = &mcu_types[i];
+ {
+ specified_mcu.name = mcu_types[i].name;
+ specified_mcu.isa |= mcu_types[i].isa;
+ specified_mcu.mach = mcu_types[i].mach;
+ avr_mcu = &specified_mcu;
+ }
else
as_fatal (_("redefinition of mcu type `%s' to `%s'"),
avr_mcu->name, mcu_types[i].name);
@@ -573,6 +584,9 @@ md_parse_option (int c, char *arg)
case OPTION_NO_WRAP:
avr_opt.no_wrap = 1;
return 1;
+ case OPTION_ISA_RMW:
+ specified_mcu.isa |= AVR_ISA_RMW;
+ return 1;
}
return 0;