From: Nathan Sidwell Date: Thu, 12 Feb 2009 08:31:03 +0000 (+0000) Subject: gas/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=872989673f47ba85685648338b2bc55130ecaaf9;p=binutils-gdb.git gas/ * config/tc-m68k.c (mcf51qe_ctrl): Add CPUCR. (mcf52259_ctrl, mcf52277_ctrl, mcf53017_ctrl): New. (mcf5307_ctrl): Add VBR. (no_mac): New variable. (m68k_extensions): Refer to no_mac mask. (m68k_cpus): Add 51, 51ac, 51cn, 51em, 51jm, 52274, 52277, 52252..52259, 53011..53017. (m68k_ip): Process CPUCR. (init_table): Add cpucr entry. (m68k_set_extension): Allow negated mask to refer to a variable. (md_show_usage): Use '%s' to silence fprintf warning. * config/m68k-parse.h (CPUCR): New control register. gas/testsuite/ * m68k/br-isac.d, m68k/br-isac.s: Add stldsr test. opcodes/ * m68k-opc.c (m68k_opcodes): Add stldsr instruction. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 5b1b7ba1e89..bdaf430f9b3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,18 @@ +2009-02-12 Nathan Sidwell + + * config/tc-m68k.c (mcf51qe_ctrl): Add CPUCR. + (mcf52259_ctrl, mcf52277_ctrl, mcf53017_ctrl): New. + (mcf5307_ctrl): Add VBR. + (no_mac): New variable. + (m68k_extensions): Refer to no_mac mask. + (m68k_cpus): Add 51, 51ac, 51cn, 51em, 51jm, 52274, 52277, + 52252..52259, 53011..53017. + (m68k_ip): Process CPUCR. + (init_table): Add cpucr entry. + (m68k_set_extension): Allow negated mask to refer to a variable. + (md_show_usage): Use '%s' to silence fprintf warning. + * config/m68k-parse.h (CPUCR): New control register. + 2009-02-10 Nathan Sidwell * config/tc-ppc.c (ppc_insert_operand, md_assemble): Use '%s' for diff --git a/gas/config/m68k-parse.h b/gas/config/m68k-parse.h index a0578410967..fd0f26ae659 100644 --- a/gas/config/m68k-parse.h +++ b/gas/config/m68k-parse.h @@ -101,6 +101,7 @@ enum m68k_register CACR, VBR, CAAR, + CPUCR, MSP, ITT0, ITT1, diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index eb96d236040..a6aa46d0b3e 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -181,8 +181,8 @@ static const enum m68k_register mcf_ctrl[] = { RAMBAR0, RAMBAR1, RAMBAR, MBAR, 0 }; -static const enum m68k_register mcf51qe_ctrl[] = { - VBR, +static const enum m68k_register mcf51_ctrl[] = { + VBR, CPUCR, 0 }; static const enum m68k_register mcf5206_ctrl[] = { @@ -217,6 +217,14 @@ static const enum m68k_register mcf5225_ctrl[] = { VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, MBAR, RAMBAR1, 0 }; +static const enum m68k_register mcf52259_ctrl[] = { + VBR, FLASHBAR, RAMBAR, RAMBAR1, + 0 +}; +static const enum m68k_register mcf52277_ctrl[] = { + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, + 0 +}; static const enum m68k_register mcf5235_ctrl[] = { VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1, 0 @@ -249,8 +257,12 @@ static const enum m68k_register mcf5282_ctrl[] = { VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1, 0 }; +static const enum m68k_register mcf53017_ctrl[] = { + VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR, + 0 +}; static const enum m68k_register mcf5307_ctrl[] = { - CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR_ALT, MBAR, + VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR_ALT, MBAR, 0 }; static const enum m68k_register mcf5329_ctrl[] = { @@ -525,6 +537,9 @@ static const struct m68k_cpu m68k_archs[] = {0,0,NULL, 0} }; +/* For -mno-mac we want to turn off all types of mac. */ +static const unsigned no_mac = mcfmac | mcfemac; + /* Architecture extensions, here 'alias' -1 for m68k, +1 for cf and 0 for either. */ static const struct m68k_cpu m68k_extensions[] = @@ -537,7 +552,7 @@ static const struct m68k_cpu m68k_extensions[] = {mcfhwdiv, NULL, "div", 1}, {mcfusp, NULL, "usp", 1}, - {mcfmac, NULL, "mac", 1}, + {mcfmac, (void *)&no_mac, "mac", 1}, {mcfemac, NULL, "emac", 1}, {0,NULL,NULL, 0} @@ -579,7 +594,12 @@ static const struct m68k_cpu m68k_cpus[] = {cpu32|m68881, cpu32_ctrl, "68349", 1}, {cpu32|m68881, cpu32_ctrl, "68360", 1}, - {mcfisa_a|mcfisa_c|mcfusp, mcf51qe_ctrl, "51qe", 0}, + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51", 0}, + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51ac", 1}, + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51cn", 1}, + {mcfisa_a|mcfisa_c|mcfusp|mcfmac, mcf51_ctrl, "51em", 1}, + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51jm", 1}, + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51qe", 1}, {mcfisa_a, mcf_ctrl, "5200", 0}, {mcfisa_a, mcf_ctrl, "5202", 1}, @@ -613,6 +633,9 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5224", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5225", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52277_ctrl, "52274", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52277_ctrl, "52277", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5232", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5233", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5234", -1}, @@ -622,7 +645,14 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfhwdiv|mcfemac, mcf5249_ctrl, "5249", 0}, {mcfisa_a|mcfhwdiv|mcfemac, mcf5250_ctrl, "5250", 0}, {mcfisa_a|mcfhwdiv|mcfemac, mcf5253_ctrl, "5253", 0}, - + + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52252", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52254", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52255", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52256", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52258", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52259", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5270", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5271", 0}, @@ -636,6 +666,14 @@ static const struct m68k_cpu m68k_cpus[] = {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "5282", -1}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "528x", 0}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53011", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53012", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53013", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53014", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53015", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53016", -1}, + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53017", 0}, + {mcfisa_a|mcfhwdiv|mcfmac, mcf5307_ctrl, "5307", 0}, {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5329_ctrl, "5327", -1}, @@ -3275,6 +3313,7 @@ m68k_ip (char *instring) tmpreg = 0x801; break; case CAAR: + case CPUCR: tmpreg = 0x802; break; case MSP: @@ -4036,6 +4075,7 @@ static const struct init_entry init_table[] = { "dfcr", DFC }, { "cacr", CACR }, /* Cache Control Register. */ { "caar", CAAR }, /* Cache Address Register. */ + { "cpucr", CPUCR }, /* CPU Control Register. */ { "usp", USP }, /* User Stack Pointer. */ { "vbr", VBR }, /* Vector Base Register. */ @@ -7407,7 +7447,8 @@ m68k_set_extension (char const *name, int allow_m, int silent) } if (negated) - not_current_architecture |= ext->arch; + not_current_architecture |= (ext->control_regs + ? *(unsigned *)ext->control_regs: ext->arch); else current_architecture |= ext->arch; return 1; @@ -7665,7 +7706,7 @@ md_show_usage (FILE *stream) { if (i) fprintf (stream, " | "); - fprintf (stream, m68k_archs[i].name); + fprintf (stream, "%s", m68k_archs[i].name); } fprintf (stream, "\n"); @@ -7674,7 +7715,7 @@ md_show_usage (FILE *stream) { if (i) fprintf (stream, " | "); - fprintf (stream, m68k_cpus[i].name); + fprintf (stream, "%s", m68k_cpus[i].name); } fprintf (stream, _("\n")); } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index b8d4f752f84..9f39a07674f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-02-12 Nathan Sidwell + + * m68k/br-isac.d, m68k/br-isac.s: Add stldsr test. + 2009-02-06 Nick Clifton * gas/mips/beq.d: Make no assumptions about the symbols used as diff --git a/gas/testsuite/gas/m68k/br-isac.d b/gas/testsuite/gas/m68k/br-isac.d index bc927edb880..c876abb0c2e 100644 --- a/gas/testsuite/gas/m68k/br-isac.d +++ b/gas/testsuite/gas/m68k/br-isac.d @@ -18,3 +18,4 @@ Disassembly of section .text: 18: 61ff 0000 0000 bsrl 1a 1a: R_68K_PC32 bar 1e: 4e71 nop + 20: 40e7 46fc 04d2 stldsr #1234 diff --git a/gas/testsuite/gas/m68k/br-isac.s b/gas/testsuite/gas/m68k/br-isac.s index 5db3c076ee5..aee60443c42 100644 --- a/gas/testsuite/gas/m68k/br-isac.s +++ b/gas/testsuite/gas/m68k/br-isac.s @@ -5,3 +5,4 @@ foo: nop jbsr foo jbsr bar nop + stldsr #1234 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 4f14bef89a1..4332d4dbee5 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2009-02-12 Nathan Sidwell + + * m68k-opc.c (m68k_opcodes): Add stldsr instruction. + 2009-02-05 Peter Bergner * ppc-opc.c: Update copyright year. diff --git a/opcodes/m68k-opc.c b/opcodes/m68k-opc.c index 05bceea7eee..ea3455acda1 100644 --- a/opcodes/m68k-opc.c +++ b/opcodes/m68k-opc.c @@ -2025,7 +2025,9 @@ const struct m68k_opcode m68k_opcodes[] = {"sbcd", 2, one(0100400), one(0170770), "DsDd", m68000up }, {"sbcd", 2, one(0100410), one(0170770), "-s-d", m68000up }, - + +{"stldsr", 6, two(0x40e7, 0x46fc), two(0xffff, 0xffff), "#w", mcfisa_c }, + /* Traps have to come before conditional sets, as they have a more specific opcode. */ {"trapcc", 2, one(0052374), one(0177777), "", m68020up | cpu32 | fido_a },