diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1994-01-31 12:34:58 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1994-01-31 12:34:58 -0800 |
commit | 34ad7aaf78d0d2f95bae96d197d61625abb5d75d (patch) | |
tree | 16be23dbfc27a4e635f45b1fa9cef5bd0cee62f4 | |
parent | 10a78a0a2aa98632bc19607f1c2e52f955d7de80 (diff) | |
download | gcc-34ad7aaf78d0d2f95bae96d197d61625abb5d75d.zip gcc-34ad7aaf78d0d2f95bae96d197d61625abb5d75d.tar.gz gcc-34ad7aaf78d0d2f95bae96d197d61625abb5d75d.tar.bz2 |
(TARGET_APP_REGS): Define.
(TARGET_SWITCHES): Add new options -mapp-regs and -mno-app-regs.
(TARGET_DEFAULT): Add -mapp-regs.
(CONDITIONAL_REGISTER_USAGE): Make %g2, %g3, and %g4 be fixed when
the -mno-app-regs option is used.
From-SVN: r6440
-rw-r--r-- | gcc/config/sparc/sparc.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 06f9ee4..678339e 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -131,6 +131,10 @@ extern int target_flags; that are not yet switchable via command line arguments. */ #define TARGET_FRW_COMPAT (target_flags & 512) +/* Nonzero means use the registers that the Sparc ABI reserves for + application software. This is the default. */ +#define TARGET_APP_REGS (target_flags & 1024) + /* Macro to define tables used to set the flags. This is a list in braces of pairs in braces, each pair being { "NAME", VALUE } @@ -162,10 +166,12 @@ extern int target_flags; {"f930", 128}, \ {"f930", -1}, \ {"f934", 128}, \ + {"app-regs", 1024}, \ + {"no-app-regs", -1024}, \ SUBTARGET_SWITCHES \ { "", TARGET_DEFAULT}} -#define TARGET_DEFAULT 3 +#define TARGET_DEFAULT 1024+3 /* This is meant to be redefined in the host dependent files */ #define SUBTARGET_SWITCHES @@ -317,7 +323,9 @@ extern int target_flags; and are not available for the register allocator. g0 is used for the condition code and not to represent %g0, which is hardwired to 0, so reg 0 is *not* fixed. - g1 through g4 are free to use as temporaries. + g1 is free to use as temporary. + g2-g4 are reserved for applications. Gcc normally uses them as + temporaries, but this can be disabled via the -mno-app-regs option. g5 through g7 are reserved for the operating system. */ #define FIXED_REGISTERS \ {0, 0, 0, 0, 0, 1, 1, 1, \ @@ -359,6 +367,12 @@ do \ for (regno = 32; regno < 64; regno++) \ fixed_regs[regno] = 1; \ } \ + if (! TARGET_APP_REGS) \ + { \ + fixed_regs[2] = 1; \ + fixed_regs[3] = 1; \ + fixed_regs[4] = 1; \ + } \ } \ while (0) |