aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2007-04-23 07:51:33 +0000
committerNathan Sidwell <nathan@codesourcery.com>2007-04-23 07:51:33 +0000
commit9a2e615a9f06fd8aebee3da95ed551de303719bb (patch)
tree15e8e5a8082c1599f4fade2d368e986e08240d56 /gas
parentd069994d0ed41e8021c53fee1a7087aa8213f705 (diff)
downloadgdb-9a2e615a9f06fd8aebee3da95ed551de303719bb.zip
gdb-9a2e615a9f06fd8aebee3da95ed551de303719bb.tar.gz
gdb-9a2e615a9f06fd8aebee3da95ed551de303719bb.tar.bz2
gas/testsuite/
* gas/m68k/br-isaa.s: New. * gas/m68k/br-isaa.d: New. * gas/m68k/br-isab.s: New. * gas/m68k/br-isab.d: New. * gas/m68k/br-isac.s: New. * gas/m68k/br-isac.d: New. * gas/m68k/all.exp: Adjust. gas/ * config/tc-m68k.c (mcf54455_ctrl): New. (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New. (m68k_archs): Add isac. (m68k_cpus): Add 54455 family. (m68k_ip): Split Bg into Bb, Bs, Bg. (m68k_elf_final_processing): Add ISA_C. * doc/c-m68k.texi (M680x0 Options): Add isac. include/opcode/ * m68k.h (mcfisa_c): New. (mcfusp, mcf_mask): Adjust. bfd/ * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac, bfd_mach_mcf_isa_c_emac): New. * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry, elf_isac_plt_entry, elf_isac_plt_info): New. (elf32_m68k_object_p): Add ISA_C. (elf32_m68k_print_private_bfd_data): Print ISA_C. (elf32_m68k_get_plt_info): Detect ISA_C. * cpu-m68k.c (arch_info): Add ISAC. (m68k_arch_features): Likewise, (bfd_m68k_compatible): ISAs B & C are not compatible. opcodes/ * m68k-opc.c: Mark mcfisa_c instructions.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-m68k.c73
-rw-r--r--gas/doc/c-m68k.texi3
-rw-r--r--gas/testsuite/ChangeLog10
-rw-r--r--gas/testsuite/gas/m68k/all.exp4
-rw-r--r--gas/testsuite/gas/m68k/br-isaa.d15
-rw-r--r--gas/testsuite/gas/m68k/br-isaa.s6
-rw-r--r--gas/testsuite/gas/m68k/br-isab.d16
-rw-r--r--gas/testsuite/gas/m68k/br-isab.s7
-rw-r--r--gas/testsuite/gas/m68k/br-isac.d16
-rw-r--r--gas/testsuite/gas/m68k/br-isac.s7
11 files changed, 150 insertions, 17 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0985ece..98c4d2c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2007-04-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/tc-m68k.c (mcf54455_ctrl): New.
+ (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New.
+ (m68k_archs): Add isac.
+ (m68k_cpus): Add 54455 family.
+ (m68k_ip): Split Bg into Bb, Bs, Bg.
+ (m68k_elf_final_processing): Add ISA_C.
+ * doc/c-m68k.texi (M680x0 Options): Add isac.
+
2007-04-22 Alan Modra <amodra@bigpond.net.au>
* read.c (read_a_source_file): Skip multiple spaces to
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index cce9b55..fedbafc 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -268,6 +268,15 @@ static const enum m68k_register mcfv4e_ctrl[] = {
ROMBAR /* ROMBAR0 */, RAMBAR /* RAMBAR1 */,
0
};
+static const enum m68k_register mcf54455_ctrl[] = {
+ CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR,
+ VBR, PC, RAMBAR1, MBAR,
+ /* Legacy names */
+ TC /* ASID */, BUSCR /* MMUBAR */,
+ ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */,
+ MBAR1 /* MBAR */, RAMBAR /* RAMBAR1 */,
+ 0
+};
static const enum m68k_register mcf5475_ctrl[] = {
CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR,
VBR, PC, RAMBAR0, RAMBAR1, MBAR,
@@ -350,7 +359,14 @@ struct m68k_it
#define arch_coldfire_fpu(x) ((x) & cfloat)
/* Macros for determining if cpu supports a specific addressing mode. */
-#define HAVE_LONG_BRANCH(x) ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b))
+#define HAVE_LONG_DISP(x) \
+ ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c))
+#define HAVE_LONG_CALL(x) \
+ ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c))
+#define HAVE_LONG_COND(x) \
+ ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b|mcfisa_c))
+#define HAVE_LONG_BRANCH(x) \
+ ((x) & (m68020|m68030|m68040|m68060|cpu32|fido_a|mcfisa_b))
static struct m68k_it the_ins; /* The instruction being assembled. */
@@ -484,6 +500,7 @@ static const struct m68k_cpu m68k_archs[] =
{mcfisa_a|mcfhwdiv, NULL, "isaa", 0},
{mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp, NULL, "isaaplus", 0},
{mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp, NULL, "isab", 0},
+ {mcfisa_a|mcfhwdiv|mcfisa_c|mcfusp, NULL, "isac", 0},
{mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac|mcfusp, mcf_ctrl, "cfv4", 0},
{mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, mcfv4e_ctrl, "cfv4e", 0},
{0,0,NULL, 0}
@@ -610,6 +627,13 @@ static const struct m68k_cpu m68k_cpus[] =
{mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5373_ctrl, "537x", 0},
{mcfisa_a|mcfisa_b|mcfhwdiv|mcfmac, mcf_ctrl, "5407",0},
+
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54450", -1},
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54451", -1},
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54452", -1},
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54453", -1},
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54454", -1},
+ {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp, mcf54455_ctrl, "54455", 0},
{mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5470", -1},
{mcfisa_a|mcfisa_b|mcfhwdiv|mcfemac|mcfusp|cfloat, mcf5475_ctrl, "5471", -1},
@@ -2206,6 +2230,8 @@ m68k_ip (char *instring)
for (s = the_ins.args, opP = &the_ins.operands[0]; *s; s += 2, opP++)
{
+ int have_disp = 0;
+
/* This switch is a doozy.
Watch the first step; its a big one! */
switch (s[0])
@@ -2865,6 +2891,7 @@ m68k_ip (char *instring)
case 'B':
tmpreg = get_num (&opP->disp, 90);
+
switch (s[1])
{
case 'B':
@@ -2876,23 +2903,36 @@ m68k_ip (char *instring)
break;
case 'L':
long_branch:
- if (! HAVE_LONG_BRANCH (current_architecture))
- as_warn (_("Can't use long branches on 68000/68010/5200"));
the_ins.opcode[0] |= 0xff;
add_fix ('l', &opP->disp, 1, 0);
addword (0);
addword (0);
break;
- case 'g':
- if (subs (&opP->disp)) /* We can't relax it. */
- goto long_branch;
-
+ case 'g': /* Conditional branch */
+ have_disp = HAVE_LONG_CALL (current_architecture);
+ goto var_branch;
+
+ case 'b': /* Unconditional branch */
+ have_disp = HAVE_LONG_BRANCH (current_architecture);
+ goto var_branch;
+
+ case 's': /* Unconditional subroutine */
+ have_disp = HAVE_LONG_CALL (current_architecture);
+
+ var_branch:
+ if (subs (&opP->disp) /* We can't relax it. */
#ifdef OBJ_ELF
- /* If the displacement needs pic relocation it cannot be
- relaxed. */
- if (opP->disp.pic_reloc != pic_none)
- goto long_branch;
+ /* If the displacement needs pic relocation it cannot be
+ relaxed. */
+ || opP->disp.pic_reloc != pic_none
#endif
+ || 0)
+ {
+ if (!have_disp)
+ as_warn (_("Can't use long branches on this architecture"));
+ goto long_branch;
+ }
+
/* This could either be a symbol, or an absolute
address. If it's an absolute address, turn it into
an absolute jump right here and keep it out of the
@@ -2918,7 +2958,7 @@ m68k_ip (char *instring)
/* Now we know it's going into the relaxer. Now figure
out which mode. We try in this order of preference:
long branch, absolute jump, byte/word branches only. */
- if (HAVE_LONG_BRANCH (current_architecture))
+ if (have_disp)
add_frag (adds (&opP->disp),
SEXT (offs (&opP->disp)),
TAB (BRANCHBWL, SZ_UNDEF));
@@ -2947,7 +2987,7 @@ m68k_ip (char *instring)
jumps. */
if (((the_ins.opcode[0] & 0xf0f8) == 0x50c8)
&& (HAVE_LONG_BRANCH (current_architecture)
- || (! flag_keep_pcrel)))
+ || ! flag_keep_pcrel))
{
if (HAVE_LONG_BRANCH (current_architecture))
add_frag (adds (&opP->disp),
@@ -7612,11 +7652,12 @@ m68k_elf_final_processing (void)
{
static const unsigned isa_features[][2] =
{
- {EF_M68K_CF_ISA_A_NODIV, mcfisa_a},
+ {EF_M68K_CF_ISA_A_NODIV,mcfisa_a},
{EF_M68K_CF_ISA_A, mcfisa_a|mcfhwdiv},
- {EF_M68K_CF_ISA_A_PLUS,mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp},
+ {EF_M68K_CF_ISA_A_PLUS, mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp},
{EF_M68K_CF_ISA_B_NOUSP,mcfisa_a|mcfisa_b|mcfhwdiv},
{EF_M68K_CF_ISA_B, mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp},
+ {EF_M68K_CF_ISA_C, mcfisa_a|mcfisa_c|mcfhwdiv|mcfusp},
{0,0},
};
static const unsigned mac_features[][2] =
@@ -7629,7 +7670,7 @@ m68k_elf_final_processing (void)
unsigned pattern;
pattern = (current_architecture
- & (mcfisa_a|mcfisa_aa|mcfisa_b|mcfhwdiv|mcfusp));
+ & (mcfisa_a|mcfisa_aa|mcfisa_b|mcfisa_c|mcfhwdiv|mcfusp));
for (ix = 0; isa_features[ix][1]; ix++)
{
if (pattern == isa_features[ix][1])
diff --git a/gas/doc/c-m68k.texi b/gas/doc/c-m68k.texi
index 0f8bb78..3176f94 100644
--- a/gas/doc/c-m68k.texi
+++ b/gas/doc/c-m68k.texi
@@ -45,7 +45,8 @@ architectures are recognized:
@code{cpu32},
@code{isaa},
@code{isaaplus},
-@code{isab} and
+@code{isab},
+@code{isac} and
@code{cfv4e}.
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 4ba13fa..3eaea07 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2007-04-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gas/m68k/br-isaa.s: New.
+ * gas/m68k/br-isaa.d: New.
+ * gas/m68k/br-isab.s: New.
+ * gas/m68k/br-isab.d: New.
+ * gas/m68k/br-isac.s: New.
+ * gas/m68k/br-isac.d: New.
+ * gas/m68k/all.exp: Adjust.
+
2007-04-21 Richard Earnshaw <rearnsha@arm.com>
* gas/arm/arch4t.d: Convert to unified syntax.
diff --git a/gas/testsuite/gas/m68k/all.exp b/gas/testsuite/gas/m68k/all.exp
index 62badbc..069d4af 100644
--- a/gas/testsuite/gas/m68k/all.exp
+++ b/gas/testsuite/gas/m68k/all.exp
@@ -52,6 +52,10 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
run_dump_test arch-cpu-1
run_dump_test cpu32
+ run_dump_test br-isaa
+ run_dump_test br-isab
+ run_dump_test br-isac
+
run_dump_test ctrl-1
run_dump_test ctrl-2
diff --git a/gas/testsuite/gas/m68k/br-isaa.d b/gas/testsuite/gas/m68k/br-isaa.d
new file mode 100644
index 0000000..0b49dc2
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isaa.d
@@ -0,0 +1,15 @@
+#name: br-isaa.d
+#objdump: -d
+#as: -march=isaa -pcrel
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <foo>:
+ 0: 4e71 nop
+ 2: 60fc bras 0 <foo>
+ 4: 6000 0000 braw 6 <foo\+0x6>
+ 8: 61f6 bsrs 0 <foo>
+ a: 6100 0000 bsrw c <foo\+0xc>
+ e: 4e71 nop
diff --git a/gas/testsuite/gas/m68k/br-isaa.s b/gas/testsuite/gas/m68k/br-isaa.s
new file mode 100644
index 0000000..d405338
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isaa.s
@@ -0,0 +1,6 @@
+foo: nop
+ jbra foo
+ jbra bar
+ jbsr foo
+ jbsr bar
+ nop
diff --git a/gas/testsuite/gas/m68k/br-isab.d b/gas/testsuite/gas/m68k/br-isab.d
new file mode 100644
index 0000000..7ba48ff
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isab.d
@@ -0,0 +1,16 @@
+#name: br-isaa.d
+#objdump: -d
+#as: -march=isab -pcrel
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <foo>:
+ 0: 4e71 nop
+ 2: 61ff ffff fffc bsrl 0 <foo>
+ 8: 60f6 bras 0 <foo>
+ a: 60ff 0000 0000 bral c <foo\+0xc>
+ 10: 61ee bsrs 0 <foo>
+ 12: 61ff 0000 0000 bsrl 14 <foo\+0x14>
+ 18: 4e71 nop
diff --git a/gas/testsuite/gas/m68k/br-isab.s b/gas/testsuite/gas/m68k/br-isab.s
new file mode 100644
index 0000000..5db3c07
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isab.s
@@ -0,0 +1,7 @@
+foo: nop
+ bsr.l foo
+ jbra foo
+ jbra bar
+ jbsr foo
+ jbsr bar
+ nop
diff --git a/gas/testsuite/gas/m68k/br-isac.d b/gas/testsuite/gas/m68k/br-isac.d
new file mode 100644
index 0000000..4a420ea
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isac.d
@@ -0,0 +1,16 @@
+#name: br-isaa.d
+#objdump: -d
+#as: -march=isac -pcrel
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <foo>:
+ 0: 4e71 nop
+ 2: 61ff ffff fffc bsrl 0 <foo>
+ 8: 60f6 bras 0 <foo>
+ a: 6000 0000 braw c <foo\+0xc>
+ e: 61f0 bsrs 0 <foo>
+ 10: 61ff 0000 0000 bsrl 12 <foo\+0x12>
+ 16: 4e71 nop
diff --git a/gas/testsuite/gas/m68k/br-isac.s b/gas/testsuite/gas/m68k/br-isac.s
new file mode 100644
index 0000000..5db3c07
--- /dev/null
+++ b/gas/testsuite/gas/m68k/br-isac.s
@@ -0,0 +1,7 @@
+foo: nop
+ bsr.l foo
+ jbra foo
+ jbra bar
+ jbsr foo
+ jbsr bar
+ nop