Include new file config.h.

Handle some m683XX processor ids.
This commit is contained in:
Ken Raeburn
1993-03-12 02:39:03 +00:00
parent f3ec63c251
commit e284846a8d

View File

@ -23,9 +23,21 @@
#define NO_RELOC 0 #define NO_RELOC 0
#include "as.h" #include "as.h"
/* need TARGET_CPU */
#include "config.h"
#include "obstack.h" #include "obstack.h"
/* note that this file includes real declarations and thus can only be included by one source file per executable. */ /* The opcode table is too big for gcc, which (currently) requires
exponential space at compile time for initialized arrays. */
#ifdef __GNUC__
#define DO_BREAK_UP_BIG_DECL
#define BREAK_UP_BIG_DECL }; struct m68k_opcode m68k_opcodes_2[] = {
#define AND_OTHER_PART sizeof (m68k_opcodes_2)
#endif
/* Note that this file includes real declarations and thus can only be
included by one source file per executable. */
#include "opcode/m68k.h" #include "opcode/m68k.h"
#ifdef TE_SUN #ifdef TE_SUN
@ -560,7 +572,7 @@ const pseudo_typeS mote_pseudo_table[] =
#define issword(x) ((x)>=-32768 && (x)<=32767) #define issword(x) ((x)>=-32768 && (x)<=32767)
#define isuword(x) ((x)>=0 && (x)<=65535) #define isuword(x) ((x)>=0 && (x)<=65535)
#define isbyte(x) ((x)>=-128 && (x)<=255) #define isbyte(x) ((x)>= -255 && (x)<=255)
#define isword(x) ((x)>=-32768 && (x)<=65535) #define isword(x) ((x)>=-32768 && (x)<=65535)
#define islong(x) (1) #define islong(x) (1)
@ -3495,10 +3507,8 @@ md_assemble (str)
{ {
int cpu_type; int cpu_type;
#ifndef TARGET_CPU if (strcmp (TARGET_CPU, "m68000") == 0
cpu_type = m68020; || strcmp (TARGET_CPU, "m68302") == 0)
#else
if (strcmp (TARGET_CPU, "m68000") == 0)
cpu_type = m68000; cpu_type = m68000;
else if (strcmp (TARGET_CPU, "m68010") == 0) else if (strcmp (TARGET_CPU, "m68010") == 0)
cpu_type = m68010; cpu_type = m68010;
@ -3509,11 +3519,14 @@ md_assemble (str)
cpu_type = m68030; cpu_type = m68030;
else if (strcmp (TARGET_CPU, "m68040") == 0) else if (strcmp (TARGET_CPU, "m68040") == 0)
cpu_type = m68040; cpu_type = m68040;
else if (strcmp (TARGET_CPU, "cpu32") == 0) else if (strcmp (TARGET_CPU, "cpu32") == 0
|| strcmp (TARGET_CPU, "m68331") == 0
|| strcmp (TARGET_CPU, "m68332") == 0
|| strcmp (TARGET_CPU, "m68333") == 0
|| strcmp (TARGET_CPU, "m68340") == 0)
cpu_type = cpu32; cpu_type = cpu32;
else else
cpu_type = m68020; cpu_type = m68020;
#endif
current_architecture |= cpu_type; current_architecture |= cpu_type;
} }
@ -3550,7 +3563,7 @@ md_assemble (str)
done_first_time = 1; done_first_time = 1;
} }
memset ((char *) (&the_ins), '\0', sizeof (the_ins)); /* JF for paranoia sake */ memset ((char *) (&the_ins), '\0', sizeof (the_ins));
m68k_ip (str); m68k_ip (str);
er = the_ins.error; er = the_ins.error;
if (!er) if (!er)
@ -3693,7 +3706,18 @@ md_assemble (str)
} }
} }
/* See BREAK_UP_BIG_DECL definition, above. */
static struct m68k_opcode *
opcode_ptr (i)
int i;
{
#ifdef DO_BREAK_UP_BIG_DECL
int lim1 = sizeof (m68k_opcodes) / sizeof (m68k_opcodes[0]);
if (i >= lim1)
return m68k_opcodes_2 + (i - lim1);
#endif
return m68k_opcodes + i;
}
void void
md_begin () md_begin ()
@ -3719,24 +3743,25 @@ md_begin ()
as_fatal ("Virtual memory exhausted"); as_fatal ("Virtual memory exhausted");
obstack_begin (&robyn, 4000); obstack_begin (&robyn, 4000);
for (ins = m68k_opcodes; ins < endop; ins++) for (i = 0; i < numopcodes; i++)
{ {
hack = slak = (struct m68k_incant *) obstack_alloc (&robyn, sizeof (struct m68k_incant)); hack = slak = (struct m68k_incant *) obstack_alloc (&robyn, sizeof (struct m68k_incant));
do do
{ {
/* we *could* ignore insns that don't match our ins = opcode_ptr (i);
arch here but just leaving them out of the /* We *could* ignore insns that don't match our arch here
hash. */ but just leaving them out of the hash. */
slak->m_operands = ins->args; slak->m_operands = ins->args;
slak->m_opnum = strlen (slak->m_operands) / 2; slak->m_opnum = strlen (slak->m_operands) / 2;
slak->m_arch = ins->arch; slak->m_arch = ins->arch;
slak->m_opcode = ins->opcode; slak->m_opcode = ins->opcode;
/* This is kludgey */ /* This is kludgey */
slak->m_codenum = ((ins->match) & 0xffffL) ? 2 : 1; slak->m_codenum = ((ins->match) & 0xffffL) ? 2 : 1;
if ((ins + 1) != endop && !strcmp (ins->name, (ins + 1)->name)) if (i + 1 != numopcodes
&& !strcmp (ins->name, opcode_ptr (i + 1)->name))
{ {
slak->m_next = (struct m68k_incant *) obstack_alloc (&robyn, sizeof (struct m68k_incant)); slak->m_next = (struct m68k_incant *) obstack_alloc (&robyn, sizeof (struct m68k_incant));
ins++; i++;
} }
else else
slak->m_next = 0; slak->m_next = 0;
@ -4771,7 +4796,8 @@ md_parse_option (argP, cntP, vecP)
rather than 16 bit one */ rather than 16 bit one */
break; break;
case 'S': /* -S means that jbsr's always turn into jsr's. */ case 'S': /* -S means that jbsr's always turn into
jsr's. */
break; break;
case 'A': case 'A':
@ -4786,7 +4812,8 @@ md_parse_option (argP, cntP, vecP)
} /* allow an optional "c" */ } /* allow an optional "c" */
if (!strcmp (*argP, "68000") if (!strcmp (*argP, "68000")
|| !strcmp (*argP, "68008")) || !strcmp (*argP, "68008")
|| !strcmp (*argP, "68302"))
{ {
current_architecture |= m68000; current_architecture |= m68000;
} }
@ -4808,8 +4835,8 @@ md_parse_option (argP, cntP, vecP)
else if (!strcmp (*argP, "68040")) else if (!strcmp (*argP, "68040"))
{ {
current_architecture |= m68040 | MAYBE_FLOAT_TOO; current_architecture |= m68040 | MAYBE_FLOAT_TOO;
#ifndef NO_68881
} }
#ifndef NO_68881
else if (!strcmp (*argP, "68881")) else if (!strcmp (*argP, "68881"))
{ {
current_architecture |= m68881; current_architecture |= m68881;
@ -4817,28 +4844,32 @@ md_parse_option (argP, cntP, vecP)
else if (!strcmp (*argP, "68882")) else if (!strcmp (*argP, "68882"))
{ {
current_architecture |= m68882; current_architecture |= m68882;
}
#endif /* NO_68881 */ #endif /* NO_68881 */
/* Even if we aren't configured to support the processor, /* Even if we aren't configured to support the processor,
it should still be possible to assert that the user it should still be possible to assert that the user
doesn't have it... */ doesn't have it... */
}
else if (!strcmp (*argP, "no-68881") else if (!strcmp (*argP, "no-68881")
|| !strcmp (*argP, "no-68882")) || !strcmp (*argP, "no-68882"))
{ {
no_68881 = 1; no_68881 = 1;
#ifndef NO_68851
} }
#ifndef NO_68851
else if (!strcmp (*argP, "68851")) else if (!strcmp (*argP, "68851"))
{ {
current_architecture |= m68851; current_architecture |= m68851;
#endif /* NO_68851 */
} }
#endif /* NO_68851 */
else if (!strcmp (*argP, "no-68851")) else if (!strcmp (*argP, "no-68851"))
{ {
no_68851 = 1; no_68851 = 1;
} }
else if (!strcmp (*argP, "pu32")) else if (!strcmp (*argP, "pu32") /* "cpu32" minus 'c' */
{ /* "-mcpu32" */ || !strcmp (*argP, "68331")
|| !strcmp (*argP, "68332")
|| !strcmp (*argP, "68333")
|| !strcmp (*argP, "68340"))
{
current_architecture |= cpu32; current_architecture |= cpu32;
} }
else else
@ -4859,7 +4890,7 @@ md_parse_option (argP, cntP, vecP)
} }
else else
{ {
return (0); return 0;
} /* pic or not */ } /* pic or not */
default: default: