diff options
author | Jakub Jelinek <jakub@redhat.com> | 1999-12-06 20:53:38 +0100 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 1999-12-06 11:53:38 -0800 |
commit | 730f02076462ea347ce60278f16191cf42960fe0 (patch) | |
tree | db905cb4135f9d1215bcb7207dee5111b1b313cb | |
parent | 1ba305b54cffb88c726e046e72ccbc6c09c6e4b8 (diff) | |
download | gcc-730f02076462ea347ce60278f16191cf42960fe0.zip gcc-730f02076462ea347ce60278f16191cf42960fe0.tar.gz gcc-730f02076462ea347ce60278f16191cf42960fe0.tar.bz2 |
sparc.h (ASM_DECLARE_REGISTER_GLOBAL): Document .register declaration.
* config/sparc/sparc.h (ASM_DECLARE_REGISTER_GLOBAL): Document
.register declaration. Don't use variables with __ prefixes.
From-SVN: r30810
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 33 |
2 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 119a1db..2932e8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -23,6 +23,9 @@ information after SUBREGs are eliminated by optimizations in this pass if PROMOTE_FUNCTION_RETURN. + * config/sparc/sparc.h (ASM_DECLARE_REGISTER_GLOBAL): Document + .register declaration. Don't use variables with __ prefixes. + Mon Dec 6 12:24:52 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * fold-const.c (optimize_bit_field_compare): Only use one mode diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 28371f4..ade328a 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1834,25 +1834,38 @@ do { \ } while (0) /* Output the special assembly code needed to tell the assembler some - register is used as global register variable. */ + register is used as global register variable. + + SPARC 64bit psABI declares registers %g2 and %g3 as application + registers and %g6 and %g7 as OS registers. Any object using them + should declare (for %g2/%g3 has to, for %g6/%g7 can) that it uses them + and how they are used (scratch or some global variable). + Linker will then refuse to link together objects which use those + registers incompatibly. + + Unless the registers are used for scratch, two different global + registers cannot be declared to the same name, so in the unlikely + case of a global register variable occupying more than one register + we prefix the second and following registers with .gnu.part1. etc. */ + +extern char sparc_hard_reg_printed[8]; #ifdef HAVE_AS_REGISTER_PSEUDO_OP #define ASM_DECLARE_REGISTER_GLOBAL(FILE, DECL, REGNO, NAME) \ do { \ if (TARGET_ARCH64) \ { \ - int __end = HARD_REGNO_NREGS ((REGNO), DECL_MODE (decl)) + (REGNO); \ - int __reg; \ - extern char sparc_hard_reg_printed[8]; \ - for (__reg = (REGNO); __reg < 8 && __reg < __end; __reg++) \ - if ((__reg & ~1) == 2 || (__reg & ~1) == 6) \ + int end = HARD_REGNO_NREGS ((REGNO), DECL_MODE (decl)) + (REGNO); \ + int reg; \ + for (reg = (REGNO); reg < 8 && reg < end; reg++) \ + if ((reg & ~1) == 2 || (reg & ~1) == 6) \ { \ - if (__reg == (REGNO)) \ - fprintf ((FILE), "\t.register\t%%g%d, %s\n", __reg, (NAME)); \ + if (reg == (REGNO)) \ + fprintf ((FILE), "\t.register\t%%g%d, %s\n", reg, (NAME)); \ else \ fprintf ((FILE), "\t.register\t%%g%d, .gnu.part%d.%s\n", \ - __reg, __reg - (REGNO), (NAME)); \ - sparc_hard_reg_printed[__reg] = 1; \ + reg, reg - (REGNO), (NAME)); \ + sparc_hard_reg_printed[reg] = 1; \ } \ } \ } while (0) |