aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-01-03 00:03:28 +0000
committerIan Lance Taylor <ian@airs.com>1997-01-03 00:03:28 +0000
commit924160b0d61c9b6b4774c830356e17db27d48540 (patch)
tree7cf52752173650806a6466222ba27ae2a6780aa3
parentb4d51f3dd442a7125d0cb07ab2d32755f195dcb1 (diff)
downloadgdb-924160b0d61c9b6b4774c830356e17db27d48540.zip
gdb-924160b0d61c9b6b4774c830356e17db27d48540.tar.gz
gdb-924160b0d61c9b6b4774c830356e17db27d48540.tar.bz2
Based on patch from Ronald F. Guilmette <rfg@monkeys.com>:
* config/tc-m68k.c (m68k_rel32_from_cmdline): New static variable. (md_begin): Check m68k_rel32_from_cmdline before setting m68k_rel32. (m68k_mri_mode_change): Likewise. (md_longopts): Add --disp-size-default-16 and --disp-size-default-32. (md_parse_option): Handle new options. (md_show_usage): Mention new options. * doc/c-m68k.texi (M68K-Opts): Document new options.
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-m68k.c30
2 files changed, 38 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b96e4f5..1e4a048 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,6 +1,18 @@
Thu Jan 2 13:37:29 1997 Ian Lance Taylor <ian@cygnus.com>
Based on patch from Ronald F. Guilmette <rfg@monkeys.com>:
+ * config/tc-m68k.c (m68k_rel32_from_cmdline): New static
+ variable.
+ (md_begin): Check m68k_rel32_from_cmdline before setting
+ m68k_rel32.
+ (m68k_mri_mode_change): Likewise.
+ (md_longopts): Add --disp-size-default-16 and
+ --disp-size-default-32.
+ (md_parse_option): Handle new options.
+ (md_show_usage): Mention new options.
+ * doc/c-m68k.texi (M68K-Opts): Document new options.
+
+ Based on patch from Ronald F. Guilmette <rfg@monkeys.com>:
* config/tc-m68k.c (m68k_index_width_default): New static
variable.
(m68k_ip): Use m68k_index_width_default to set the size of a base
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 70a4d70..27ace69 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -96,6 +96,9 @@ static int m68k_quick = 1;
be 32 bits. */
static int m68k_rel32 = 1;
+/* This is non-zero if m68k_rel32 was set from the command line. */
+static int m68k_rel32_from_cmdline;
+
/* The default width to use for an index register when using a base
displacement. */
static enum m68k_size m68k_index_width_default = SIZE_LONG;
@@ -3443,7 +3446,8 @@ md_begin ()
{
flag_reg_prefix_optional = 1;
m68k_abspcadd = 1;
- m68k_rel32 = 0;
+ if (! m68k_rel32_from_cmdline)
+ m68k_rel32 = 0;
}
op_hash = hash_new ();
@@ -3723,7 +3727,8 @@ m68k_mri_mode_change (on)
#endif
}
m68k_abspcadd = 1;
- m68k_rel32 = 0;
+ if (! m68k_rel32_from_cmdline)
+ m68k_rel32 = 0;
}
else
{
@@ -3739,7 +3744,8 @@ m68k_mri_mode_change (on)
#endif
}
m68k_abspcadd = 0;
- m68k_rel32 = 1;
+ if (! m68k_rel32_from_cmdline)
+ m68k_rel32 = 1;
}
}
@@ -6366,6 +6372,10 @@ struct option md_longopts[] = {
{"base-size-default-16", no_argument, NULL, OPTION_BASE_SIZE_DEFAULT_16},
#define OPTION_BASE_SIZE_DEFAULT_32 (OPTION_MD_BASE + 4)
{"base-size-default-32", no_argument, NULL, OPTION_BASE_SIZE_DEFAULT_32},
+#define OPTION_DISP_SIZE_DEFAULT_16 (OPTION_MD_BASE + 5)
+ {"disp-size-default-16", no_argument, NULL, OPTION_DISP_SIZE_DEFAULT_16},
+#define OPTION_DISP_SIZE_DEFAULT_32 (OPTION_MD_BASE + 6)
+ {"disp-size-default-32", no_argument, NULL, OPTION_DISP_SIZE_DEFAULT_32},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
@@ -6506,6 +6516,16 @@ md_parse_option (c, arg)
m68k_index_width_default = SIZE_LONG;
break;
+ case OPTION_DISP_SIZE_DEFAULT_16:
+ m68k_rel32 = 0;
+ m68k_rel32_from_cmdline = 1;
+ break;
+
+ case OPTION_DISP_SIZE_DEFAULT_32:
+ m68k_rel32 = 1;
+ m68k_rel32_from_cmdline = 1;
+ break;
+
default:
return 0;
}
@@ -6538,7 +6558,9 @@ md_show_usage (stream)
--bitwise-or do not treat `|' as a comment character\n");
fprintf (stream, "\
--base-size-default-16 base reg without size is 16 bits\n\
---base-size-default-32 base reg without size is 32 bits (default)\n");
+--base-size-default-32 base reg without size is 32 bits (default)\n\
+--disp-size-default-16 displacement with unknown size is 16 bits\n\
+--disp-size-default-32 displacement with unknown size is 32 bits (default)\n");
}
#ifdef TEST2