From 5e0bd1769ddea4d4b75770e2b9bced019ecbca2d Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 24 Oct 2005 07:36:40 +0000 Subject: [PATCH] gas/ 2005-10-24 Jan Beulich * config/tc-ia64.c (declare_register): Call symbol_create. (md_begin): Remove local variables total, ar_base, and cr_base. Start loops for registers at their respective first one. Don't update md.regsym for alias names. Generate alias name tp for r13. gas/testsuite/ 2005-10-24 Jan Beulich * gas/ia64/regs.pl: Also check tp alias of r13. * gas/ia64/regs.s: Regenerate. * gas/ia64/regs.d: Adjust. --- gas/ChangeLog | 7 +++++++ gas/config/tc-ia64.c | 36 ++++++++++++---------------------- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/ia64/regs.d | 4 ++-- gas/testsuite/gas/ia64/regs.pl | 2 +- gas/testsuite/gas/ia64/regs.s | 2 +- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 3441f754a40..897c9162986 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2005-10-24 Jan Beulich + + * config/tc-ia64.c (declare_register): Call symbol_create. + (md_begin): Remove local variables total, ar_base, and cr_base. + Start loops for registers at their respective first one. Don't + update md.regsym for alias names. Generate alias name tp for r13. + 2005-10-21 DJ Delorie * config/tc-m32c.c (md_cgen_lookup_reloc): Add more relocs. Print diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 19b57692fb6..5da30987bea 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -5599,7 +5599,7 @@ declare_register (name, regnum) const char *err; symbolS *sym; - sym = symbol_new (name, reg_section, regnum, &zero_address_frag); + sym = symbol_create (name, reg_section, regnum, &zero_address_frag); err = hash_insert (md.reg_hash, S_GET_NAME (sym), (PTR) sym); if (err) @@ -7366,7 +7366,7 @@ extra_goodness (int templ, int slot) void md_begin () { - int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum, ok; + int i, j, k, t, goodness, best, regnum, ok; const char *err; char name[8]; @@ -7541,51 +7541,42 @@ md_begin () md.entry_hash = hash_new (); /* general registers: */ - - total = 128; - for (i = 0; i < total; ++i) + for (i = REG_GR; i < REG_GR + 128; ++i) { sprintf (name, "r%d", i - REG_GR); md.regsym[i] = declare_register (name, i); } /* floating point registers: */ - total += 128; - for (; i < total; ++i) + for (i = REG_FR; i < REG_FR + 128; ++i) { sprintf (name, "f%d", i - REG_FR); md.regsym[i] = declare_register (name, i); } /* application registers: */ - total += 128; - ar_base = i; - for (; i < total; ++i) + for (i = REG_AR; i < REG_AR + 128; ++i) { sprintf (name, "ar%d", i - REG_AR); md.regsym[i] = declare_register (name, i); } /* control registers: */ - total += 128; - cr_base = i; - for (; i < total; ++i) + for (i = REG_CR; i < REG_CR + 128; ++i) { sprintf (name, "cr%d", i - REG_CR); md.regsym[i] = declare_register (name, i); } /* predicate registers: */ - total += 64; - for (; i < total; ++i) + for (i = REG_P; i < REG_P + 64; ++i) { sprintf (name, "p%d", i - REG_P); md.regsym[i] = declare_register (name, i); } /* branch registers: */ - total += 8; - for (; i < total; ++i) + for (i = REG_BR; i < REG_BR + 8; ++i) { sprintf (name, "b%d", i - REG_BR); md.regsym[i] = declare_register (name, i); @@ -7606,17 +7597,16 @@ md_begin () } /* define synonyms for application registers: */ - for (i = REG_AR; i < REG_AR + NELEMS (ar); ++i) - md.regsym[i] = declare_register (ar[i - REG_AR].name, - REG_AR + ar[i - REG_AR].regnum); + for (i = 0; i < NELEMS (ar); ++i) + declare_register (ar[i].name, REG_AR + ar[i].regnum); /* define synonyms for control registers: */ - for (i = REG_CR; i < REG_CR + NELEMS (cr); ++i) - md.regsym[i] = declare_register (cr[i - REG_CR].name, - REG_CR + cr[i - REG_CR].regnum); + for (i = 0; i < NELEMS (cr); ++i) + declare_register (cr[i].name, REG_CR + cr[i].regnum); declare_register ("gp", REG_GR + 1); declare_register ("sp", REG_GR + 12); + declare_register ("tp", REG_GR + 13); declare_register ("rp", REG_BR + 0); /* pseudo-registers used to specify unwind info: */ diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 72608106f7f..53f85f65bb9 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-10-24 Jan Beulich + + * gas/ia64/regs.pl: Also check tp alias of r13. + * gas/ia64/regs.s: Regenerate. + * gas/ia64/regs.d: Adjust. + 2005-10-19 David Ung * gas/mips/mips.exp: Run new test. diff --git a/gas/testsuite/gas/ia64/regs.d b/gas/testsuite/gas/ia64/regs.d index e51c50008ce..1dbd13787a3 100644 --- a/gas/testsuite/gas/ia64/regs.d +++ b/gas/testsuite/gas/ia64/regs.d @@ -1265,8 +1265,8 @@ Disassembly of section \.text: 1a26: 00 00 00 02 00 00 nop\.i 0x0 1a2c: 00 00 04 00 nop\.i 0x0;; 1a30: 01 08 00 00 00 21 \[MII\] mov r1=r0 - 1a36: c0 00 00 00 42 00 mov r12=r0 - 1a3c: 00 00 04 00 nop\.i 0x0;; + 1a36: c0 00 00 00 42 a0 mov r12=r0 + 1a3c: 01 00 00 84 mov r13=r0;; 1a40: 0d 00 00 00 01 00 \[MFI\] nop\.m 0x0 1a46: 20 00 00 20 00 00 mov f2=f0 1a4c: 00 00 04 00 nop\.i 0x0;; diff --git a/gas/testsuite/gas/ia64/regs.pl b/gas/testsuite/gas/ia64/regs.pl index ca51cc036d1..1c7df5c390f 100644 --- a/gas/testsuite/gas/ia64/regs.pl +++ b/gas/testsuite/gas/ia64/regs.pl @@ -38,7 +38,7 @@ print "\n"; print "\t{ .mii;\n"; print "\tmov gp = r0\n"; print "\tmov sp = r0\n"; -print "\tnop.i 0;; }\n\n"; +print "\tmov tp = r0;; }\n\n"; print "// Floating point registers\n"; for ($i = 2; $i < 128; ++$i) { diff --git a/gas/testsuite/gas/ia64/regs.s b/gas/testsuite/gas/ia64/regs.s index 06226a55f74..8e77b0e81c2 100644 --- a/gas/testsuite/gas/ia64/regs.s +++ b/gas/testsuite/gas/ia64/regs.s @@ -437,7 +437,7 @@ _start: { .mii; mov gp = r0 mov sp = r0 - nop.i 0;; } + mov tp = r0;; } // Floating point registers { .mfi; mov f2 = f0 ;; } -- 2.30.2