aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1998-06-26 17:24:34 +0000
committerJeff Law <law@redhat.com>1998-06-26 17:24:34 +0000
commit3be26805cc67ff981ffb85ad669c861b92b56fbc (patch)
tree4354bc8bc1363f29c47cef9f1830d147ebe90d56 /gas
parent5760b825aa347a3c160b88e3443bb2409a665ebd (diff)
downloadgdb-3be26805cc67ff981ffb85ad669c861b92b56fbc.zip
gdb-3be26805cc67ff981ffb85ad669c861b92b56fbc.tar.gz
gdb-3be26805cc67ff981ffb85ad669c861b92b56fbc.tar.bz2
* config/tc-mn10300.c (set_arch_mach): New function.
(md_pseudo_table): Add pseudo-ops to set the current machine type. (md_begin): Default to mn10300 mode. (md_assemble): Only accept instructions for the core mn10300 chip and the active machine type.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-mn10300.c33
2 files changed, 40 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5648ee0..0c2f900 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+Fri Jun 26 11:21:11 1998 Jeffrey A Law (law@cygnus.com)
+
+ * config/tc-mn10300.c (set_arch_mach): New function.
+ (md_pseudo_table): Add pseudo-ops to set the current machine type.
+ (md_begin): Default to mn10300 mode.
+ (md_assemble): Only accept instructions for the core mn10300
+ chip and the active machine type.
+
Wed Jun 24 19:06:04 1998 Ian Lance Taylor <ian@cygnus.com>
* subsegs.h (segment_info_type): Give the struct a name.
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index ab59b76..c317a17 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -91,7 +91,9 @@ static int reg_name_search PARAMS ((const struct reg_name *, int, const char *))
static boolean data_register_name PARAMS ((expressionS *expressionP));
static boolean address_register_name PARAMS ((expressionS *expressionP));
static boolean other_register_name PARAMS ((expressionS *expressionP));
+static void set_arch_mach PARAMS ((int));
+static int current_machine;
/* fixups */
#define MAX_INSN_FIXUPS (5)
@@ -113,7 +115,12 @@ size_t md_longopts_size = sizeof(md_longopts);
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] =
{
- { NULL, NULL, 0 }
+ { "am30", set_arch_mach, 300 },
+ /* start-sanitize-am33 */
+ { "am33", set_arch_mach, 330 },
+ /* end-sanitize-am33 */
+ { "mn10300", set_arch_mach, 300 },
+ {NULL, 0, 0}
};
/* Opcode hash table. */
@@ -867,6 +874,12 @@ md_begin ()
and support for future optimizations (branch shortening and similar
stuff in the linker. */
linkrelax = 1;
+
+ /* Set the default machine type. */
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_mn10300, 300))
+ as_warn (_("could not set architecture and machine"));
+
+ current_machine = 300;
}
void
@@ -910,12 +923,20 @@ md_assemble (str)
char *hold;
int extra_shift = 0;
+
relaxable = 0;
fc = 0;
match = 0;
next_opindex = 0;
insn = opcode->opcode;
extension = 0;
+
+ /* If the instruction is not available on the current machine
+ then it can not possibly match. */
+ if (opcode->machine
+ && (opcode->machine != current_machine))
+ goto error;
+
for (op_idx = 1, opindex_ptr = opcode->operands;
*opindex_ptr != 0;
opindex_ptr++, op_idx++)
@@ -1930,3 +1951,13 @@ check_operand (insn, operand, val)
}
return 1;
}
+
+static void
+set_arch_mach (mach)
+ int mach;
+{
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_mn10300, mach))
+ as_warn (_("could not set architecture and machine"));
+
+ current_machine = mach;
+}