diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2006-03-06 13:42:05 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2006-03-06 13:42:05 +0000 |
commit | 0b2e31dc3b568d10386bcfc3e2c75e21a72be568 (patch) | |
tree | 8b39c845b03c3b998c7b31093d2fce685a007099 /gas | |
parent | d8d1c398ee0a95ea474cf14697328196c289eac7 (diff) | |
download | gdb-0b2e31dc3b568d10386bcfc3e2c75e21a72be568.zip gdb-0b2e31dc3b568d10386bcfc3e2c75e21a72be568.tar.gz gdb-0b2e31dc3b568d10386bcfc3e2c75e21a72be568.tar.bz2 |
bfd:
* archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
New. Adjust other variants.
(bfd_default_scan): Update.
* bfd-in2.h: Rebuilt.
* cpu-m68k.c: Adjust.
(bfd_m68k_compatible): New. Use it for architectures.
* elf32-m68k.c (elf32_m68k_object_p): Adjust.
(elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b
mismatch.
(elf32_m68k_print_private_bfd_data): Adjust.
* ieee.c (ieee_write_processor): Adjust.
binutils:
* readelf.c (get_machine_flags): Adjust.
gas:
* config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k
and cf.
(m68k_ip): <case 'J'> Check we have some control regs.
(md_parse_option): Allow raw arch switch.
(m68k_init_arch): Better detection of arch/cpu mismatch. Detect
whether 68881 or cfloat was meant by -mfloat.
(md_show_usage): Adjust extension display.
(m68k_elf_final_processing): Adjust.
gas/testsuite:
* gas/m68k/arch-cpu-1.s: Tweak.
* gas/m68k/arch-cpu-1.d: Tweak.
include/elf:
* m68k.h (EF_M68K_ISA_MASK, EF_M68K_ISA_A,
EF_M68K_ISA_A_PLUS, EF_M68K_ISA_B, EF_M68K_ISA_C): Adjust.
(EF_M68K_ISA_A_NODIV, EF_M68K_ISA_B_NOUSP): New.
(EF_M68K_HW_DIV, EF_M68K_USP): Remove.
(EF_M68K_MAC, EF_M68K_EMAC, EF_M68K_FLOAT): Adjust.
(EF_M68K_EMAC_B): New.
ld/testsuite:
* ld-m68k: New tests.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 11 | ||||
-rw-r--r-- | gas/config/tc-m68k.c | 165 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/m68k/arch-cpu-1.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/m68k/arch-cpu-1.s | 2 |
5 files changed, 126 insertions, 59 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 1347fae..709e66b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2006-03-06 Nathan Sidwell <nathan@codesourcery.com> + + * config/tc-m68k.c (m68k_extensions): Allow 'float' on both m68k + and cf. + (m68k_ip): <case 'J'> Check we have some control regs. + (md_parse_option): Allow raw arch switch. + (m68k_init_arch): Better detection of arch/cpu mismatch. Detect + whether 68881 or cfloat was meant by -mfloat. + (md_show_usage): Adjust extension display. + (m68k_elf_final_processing): Adjust. + 2006-03-03 Bjoern Haase <bjoern.m.haase@web.de> * config/tc-avr.c (avr_mod_hash_value): New function. diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index b7fb25c..8b11263 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -368,7 +368,11 @@ struct m68k_cpu unsigned long arch; /* Architecture features. */ unsigned long chip; /* Specific chip */ const char *name; /* Name */ - unsigned alias; + int alias; /* Alias for a cannonical name. If 1, then + succeeds canonical name, if -1 then + succeeds canonical name, if <-1 ||>1 this is a + deprecated name, and the next/previous name + should be used. */ }; /* We hold flags for features explicitly enabled and explicitly @@ -391,23 +395,25 @@ static const struct m68k_cpu m68k_archs[] = {m68060, cpu_m68060, "68060", 0}, {cpu32|m68881, cpu_cpu32, "cpu32", 0}, {mcfisa_a|mcfhwdiv, 0, "isaa", 0}, - {mcfisa_a|mcfhwdiv|mcfisa_aa, 0, "isaaplus", 0}, - {mcfisa_a|mcfhwdiv|mcfisa_b, 0, "isab", 0}, + {mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp, 0, "isaaplus", 0}, + {mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp, 0, "isab", 0}, {mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, cpu_cf547x, "cfv4e", 0}, {0,0,NULL, 0} }; -/* Architecture extensions. */ +/* Architecture extensions, here 'alias' -1 for m68k, +1 for cf and 0 + for either. */ static const struct m68k_cpu m68k_extensions[] = { - {m68851, 0, "68851", 0}, - {m68881, 0, "68881", 0}, - {m68881, 0, "68882", 0}, + {m68851, 0, "68851", -1}, + {m68881, 0, "68881", -1}, + {m68881, 0, "68882", -1}, + + {cfloat|m68881, 0, "float", 0}, {mcfhwdiv, 0, "div", 1}, {mcfusp, 0, "usp", 1}, - {cfloat, 0, "float", 1}, {mcfmac, 0, "mac", 1}, {mcfemac, 0, "emac", 1}, @@ -426,13 +432,13 @@ static const struct m68k_cpu m68k_cpus[] = { cpu32|m68881, cpu_cpu32, "cpu32", 0}, { mcfisa_a, cpu_cf5200, "5200", 0}, { mcfisa_a|mcfhwdiv|mcfmac, cpu_cf5206e, "5206e", 0}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac, cpu_cf5208, "5208", 0}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac, cpu_cf5213, "5213", 0}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, cpu_cf5208, "5208", 0}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, cpu_cf5213, "5213", 0}, { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,cpu_cf521x, "521x", 0}, { mcfisa_a|mcfhwdiv|mcfemac, cpu_cf5249, "5249", 0}, { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp,cpu_cf528x, "528x", 0}, { mcfisa_a|mcfhwdiv|mcfmac, cpu_cf5307, "5307", 0}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf5329, "5329", 0}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf5329, "5329", 0}, { mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac, cpu_cf5407, "5407",0}, { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, cpu_cf547x, "547x", 0}, @@ -467,16 +473,16 @@ static const struct m68k_cpu m68k_cpus[] = { mcfisa_a, cpu_cf5200, "5202", 1}, { mcfisa_a, cpu_cf5200, "5204", 1}, { mcfisa_a, cpu_cf5200, "5206", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac, cpu_cf5208, "5207", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac, cpu_cf5213, "5211", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac, cpu_cf5213, "5212", 1}, - { mcfisa_a|mcfhwdiv|mcfisa_aa|mcfemac, cpu_cf521x, "5214", 1}, - { mcfisa_a|mcfhwdiv|mcfisa_aa|mcfemac, cpu_cf521x, "5216", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf5329, "5327", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf5329, "5328", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf528x, "5280", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf528x, "5281", 1}, - { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac, cpu_cf528x, "5282", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, cpu_cf5208, "5207", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, cpu_cf5213, "5211", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, cpu_cf5213, "5212", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf521x, "5214", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf521x, "5216", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf5329, "5327", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf5329, "5328", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf528x, "5280", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf528x, "5281", 1}, + { mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, cpu_cf528x, "5282", 1}, { mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac, cpu_cf5407, "cfv4", 1 }, { mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac|mcfusp|cfloat, cpu_cf547x, "cfv4e", 1 }, @@ -1700,11 +1706,13 @@ m68k_ip (char *instring) case 'J': if (opP->mode != CONTROL || opP->reg < USP - || opP->reg > last_movec_reg) + || opP->reg > last_movec_reg + || !control_regs) losing++; else { const enum m68k_register *rp; + for (rp = control_regs; *rp; rp++) if (*rp == opP->reg) break; @@ -7271,6 +7279,8 @@ md_parse_option (int c, char *arg) m68k_set_cpu (arg + 4, 1, 0); else if (m68k_set_extension (arg, 0, 1)) ; + else if (m68k_set_arch (arg, 0, 1)) + ; else if (m68k_set_cpu (arg, 0, 1)) ; else @@ -7289,35 +7299,42 @@ md_parse_option (int c, char *arg) static void m68k_init_arch (void) { - unsigned arch_of_chip = 0; - if (not_current_architecture & current_architecture) { as_bad (_("architecture features both enabled and disabled")); not_current_architecture &= ~current_architecture; } if (selected_arch) + current_architecture |= selected_arch->arch; + else + current_architecture |= selected_cpu->arch; + + current_architecture &= ~not_current_architecture; + + if (selected_cpu) { - arch_of_chip = selected_arch->arch; - current_chip = selected_arch->chip; - if (selected_cpu && (arch_of_chip & ~selected_cpu->arch)) + if (current_architecture & ~selected_cpu->arch) { - as_bad (_("selected processor is not from selected architecture")); - arch_of_chip = selected_cpu->arch; + as_bad (_("selected processor does not have all features of selected architecture")); + current_architecture + = selected_cpu->arch & ~not_current_architecture; } } - else - arch_of_chip = selected_cpu->arch; - if (selected_cpu) - current_chip = selected_cpu->chip; - current_architecture |= arch_of_chip; - current_architecture &= ~not_current_architecture; + if ((current_architecture & (cfloat | m68881)) == (cfloat | m68881)) + { + /* Determine which float is really meant. */ + if (current_architecture & (m68k_mask & ~m68881)) + current_architecture ^= cfloat; + else + current_architecture ^= m68881; + } + if ((current_architecture & m68k_mask) && (current_architecture & ~m68k_mask)) { as_bad (_ ("m68k and cf features both selected")); - if (arch_of_chip & m68k_mask) + if (current_architecture & m68k_mask) current_architecture &= m68k_mask; else current_architecture &= ~m68k_mask; @@ -7375,8 +7392,10 @@ md_show_usage (FILE *stream) "), default_cpu); for (i = 0; m68k_extensions[i].name; i++) fprintf (stream, _("\ --m[no-]%-16s enable/disable %s architecture extension\n\ -"), m68k_extensions[i].name, m68k_extensions[i].alias ? "ColdFire" : "m68k"); +-m[no-]%-16s enable/disable%s architecture extension\n\ +"), m68k_extensions[i].name, + m68k_extensions[i].alias > 0 ? " ColdFire" + : m68k_extensions[i].alias < 0 ? " m68k" : ""); fprintf (stream, _("\ -l use 1 word for refs to undefined symbols [default 2]\n\ @@ -7568,27 +7587,59 @@ m68k_elf_final_processing (void) if (current_architecture & mcfisa_a) { - /* Set coldfire specific elf flags */ - if (current_architecture & mcfisa_b) - flags |= EF_M68K_ISA_B; - else if (current_architecture & mcfisa_aa) - flags |= EF_M68K_ISA_A_PLUS; - else - flags |= EF_M68K_ISA_A; - - if (current_architecture & mcfhwdiv) - flags |= EF_M68K_HW_DIV; - - if (current_architecture & mcfusp) - flags |= EF_M68K_USP; + static const unsigned isa_features[][2] = + { + {EF_M68K_ISA_A_NODIV, mcfisa_a}, + {EF_M68K_ISA_A, mcfisa_a|mcfhwdiv}, + {EF_M68K_ISA_A_PLUS,mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp}, + {EF_M68K_ISA_B_NOUSP,mcfisa_a|mcfisa_b|mcfhwdiv}, + {EF_M68K_ISA_B, mcfisa_a|mcfisa_b|mcfhwdiv|mcfusp}, + {0,0}, + }; + static const unsigned mac_features[][2] = + { + {EF_M68K_MAC, mcfmac}, + {EF_M68K_EMAC, mcfemac}, + {0,0}, + }; + unsigned ix; + unsigned pattern; - if (current_architecture & cfloat) - flags |= EF_M68K_FLOAT; + pattern = (current_architecture + & (mcfisa_a|mcfisa_aa|mcfisa_b|mcfhwdiv|mcfusp)); + for (ix = 0; isa_features[ix][1]; ix++) + { + if (pattern == isa_features[ix][1]) + { + flags |= isa_features[ix][0]; + break; + } + } + if (!isa_features[ix][1]) + { + cf_bad: + as_warn (_("Not a defined coldfire architecture")); + } + else + { + if (current_architecture & cfloat) + flags |= EF_M68K_FLOAT | EF_M68K_CFV4E; - if (current_architecture & mcfmac) - flags |= EF_M68K_MAC; - else if (current_architecture & mcfemac) - flags |= EF_M68K_EMAC; + pattern = current_architecture & (mcfmac|mcfemac); + if (pattern) + { + for (ix = 0; mac_features[ix][1]; ix++) + { + if (pattern == mac_features[ix][1]) + { + flags |= mac_features[ix][0]; + break; + } + } + if (!mac_features[ix][1]) + goto cf_bad; + } + } } elf_elfheader (stdoutput)->e_flags |= flags; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 7f91b24..28adf50 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-03-06 Nathan Sidwell <nathan@codesourcery.com> + + * gas/m68k/arch-cpu-1.s: Tweak. + * gas/m68k/arch-cpu-1.d: Tweak. + 2006-02-28 Jan Beulich <jbeulich@novell.com> * gas/all/altmacro.s: Adjust. diff --git a/gas/testsuite/gas/m68k/arch-cpu-1.d b/gas/testsuite/gas/m68k/arch-cpu-1.d index 4195926..421010d 100644 --- a/gas/testsuite/gas/m68k/arch-cpu-1.d +++ b/gas/testsuite/gas/m68k/arch-cpu-1.d @@ -3,7 +3,7 @@ .*: file format elf32-m68k -private flags = 22: \[isa A\+\] \[emac\] +private flags = 21: \[isa A\] \[nodiv\] \[emac\] Disassembly of section .text: diff --git a/gas/testsuite/gas/m68k/arch-cpu-1.s b/gas/testsuite/gas/m68k/arch-cpu-1.s index e0bfead..48d621b 100644 --- a/gas/testsuite/gas/m68k/arch-cpu-1.s +++ b/gas/testsuite/gas/m68k/arch-cpu-1.s @@ -1,4 +1,4 @@ - .arch isaaplus,no-div,emac + .arch isaa,no-div,emac .cpu 5329 mac.w %d1l,%a1u,<<,%acc0 |