mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
Added checking of instructions against target cpu.
This commit is contained in:
parent
9bbbb61220
commit
d30a2be45d
@ -1,3 +1,18 @@
|
||||
Mon Sep 15 18:33:06 1997 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* config/tc-v850.c (processor_mask): New variable.
|
||||
(set_machine, md_parse_option): Set processor_mask.
|
||||
(md_assemble): Check that instruction is available to target
|
||||
processor.
|
||||
|
||||
* config/tc-v850.h (TARGET_PROCESSOR): New constant.
|
||||
start-sanitize-v850e
|
||||
(TARGET_PROCESSOR): New constant.
|
||||
end-sanitize-v850e
|
||||
start-sanitize-v850eq
|
||||
(TARGET_PROCESSOR): New constant.
|
||||
end-sanitize-v850eq
|
||||
|
||||
start-sanitize-tx19
|
||||
Mon Sep 15 17:26:46 1997 Gavin Koch <gavin@cygnus.com>
|
||||
|
||||
|
@ -34,9 +34,12 @@ static bfd_reloc_code_real_type hold_cons_reloc;
|
||||
static boolean warn_signed_overflows = FALSE;
|
||||
static boolean warn_unsigned_overflows = FALSE;
|
||||
|
||||
/* Indicates the target processor type. */
|
||||
/* Indicates the target BFD machine number. */
|
||||
static int machine = TARGET_MACHINE;
|
||||
|
||||
/* Indicates the target processor(s) for the assemble. */
|
||||
static unsigned int processor_mask = TARGET_PROCESSOR;
|
||||
|
||||
|
||||
/* Structure to hold information about predefined registers. */
|
||||
struct reg_name
|
||||
@ -211,6 +214,17 @@ set_machine (int number)
|
||||
{
|
||||
machine = number;
|
||||
bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
|
||||
|
||||
switch (machine)
|
||||
{
|
||||
case 0: processor_mask = PROCESSOR_V850; break;
|
||||
/* start-sanitize-v850e */
|
||||
case bfd_mach_v850e: processor_mask = PROCESSOR_V850E; break;
|
||||
/* end-sanitize-v850e */
|
||||
/* start-sanitize-v850eq */
|
||||
case bfd_mach_v850eq: processor_mask = PROCESSOR_V850EQ; break;
|
||||
/* end-sanitize-v850eq */
|
||||
}
|
||||
}
|
||||
|
||||
/* The target specific pseudo-ops which we support. */
|
||||
@ -821,6 +835,8 @@ md_parse_option (c, arg)
|
||||
else if (strcmp (arg, "v850e") == 0)
|
||||
{
|
||||
machine = bfd_mach_v850e;
|
||||
processor_mask = PROCESSOR_V850 | PROCESSOR_V850E;
|
||||
|
||||
return 1;
|
||||
}
|
||||
/* end-sanitize-v850e */
|
||||
@ -828,6 +844,7 @@ md_parse_option (c, arg)
|
||||
else if (strcmp (arg, "v850eq") == 0)
|
||||
{
|
||||
machine = bfd_mach_v850eq;
|
||||
processor_mask = PROCESSOR_V850EQ;
|
||||
return 1;
|
||||
}
|
||||
/* end-sanitize-v850eq */
|
||||
@ -1133,9 +1150,16 @@ md_assemble (str)
|
||||
{
|
||||
const char * errmsg = NULL;
|
||||
|
||||
match = 0;
|
||||
|
||||
if ((opcode->processors & processor_mask) == 0)
|
||||
{
|
||||
errmsg = "Target processor doe snot support this instruction.";
|
||||
goto error;
|
||||
}
|
||||
|
||||
relaxable = 0;
|
||||
fc = 0;
|
||||
match = 0;
|
||||
next_opindex = 0;
|
||||
insn = opcode->opcode;
|
||||
extra_data_after_insn = false;
|
||||
|
@ -29,8 +29,10 @@
|
||||
/* The target BFD architecture. */
|
||||
#define TARGET_ARCH bfd_arch_v850
|
||||
|
||||
/* The target BFD format. */
|
||||
#define TARGET_FORMAT "elf32-v850"
|
||||
|
||||
/* The target BFD machine number. */
|
||||
#define TARGET_MACHINE 0
|
||||
/* start-sanitize-v850e */
|
||||
#undef TARGET_MACHINE
|
||||
@ -41,6 +43,18 @@
|
||||
#define TARGET_MACHINE bfd_mach_v850eq
|
||||
/* end-sanitize-v850eq */
|
||||
|
||||
/* The target processor mask. */
|
||||
#define TARGET_PROCESSOR PROCESSOR_V850
|
||||
/* start-sanitize-v850e */
|
||||
#undef TARGET_PROCESSOR
|
||||
#define TARGET_PROCESSOR PROCESSOR_V850E
|
||||
/* end-sanitize-v850e */
|
||||
/* start-sanitize-v850eq */
|
||||
#undef TARGET_PROCESSOR
|
||||
#define TARGET_PROCESSOR PROCESSOR_V850EQ
|
||||
/* end-sanitize-v850eq */
|
||||
|
||||
|
||||
#define MD_APPLY_FIX3
|
||||
#define md_operand(x)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user