aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2002-03-22 09:30:35 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2002-03-22 09:30:35 +0000
commite6f884cdac3ca7194b8cf8113702251aac072fa9 (patch)
tree5a3c6aa6225c22878ad8e4f435be0b551102a481 /gcc
parent6e115568690347d12b59d4111f08dd01bbb9f776 (diff)
downloadgcc-e6f884cdac3ca7194b8cf8113702251aac072fa9.zip
gcc-e6f884cdac3ca7194b8cf8113702251aac072fa9.tar.gz
gcc-e6f884cdac3ca7194b8cf8113702251aac072fa9.tar.bz2
mips.h (FUNCTION_ARG_REGNO_P): Simplify.
* config/mips/mips.h (FUNCTION_ARG_REGNO_P): Simplify. (CLASS_UNITS): Undefine. (CLASS_MAX_NREGS): Use FP_INC. * config/mips/mips.c (compute_frame_size): Likewise. (override_options): Use FP_INC and UNITS_PER_FPVALUE. From-SVN: r51166
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/mips/mips.c30
-rw-r--r--gcc/config/mips/mips.h17
3 files changed, 21 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 58d40e4..74fe74a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-03-22 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.h (FUNCTION_ARG_REGNO_P): Simplify.
+ (CLASS_UNITS): Undefine.
+ (CLASS_MAX_NREGS): Use FP_INC.
+ * config/mips/mips.c (compute_frame_size): Likewise.
+ (override_options): Use FP_INC and UNITS_PER_FPVALUE.
+
2002-03-22 Neil Booth <neil@daikokuya.demon.co.uk>
* cpplex.c (parse_identifier_slow): Rename parse_slow, adjust
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 4a44b75..535012c 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -5257,7 +5257,7 @@ override_options ()
temp = ((regno & 1) == 0 || size <= UNITS_PER_WORD);
else if (FP_REG_P (regno))
- temp = ((TARGET_FLOAT64 || ((regno & 1) == 0)
+ temp = (((regno % FP_INC) == 0
/* I think this change is OK regardless of abi, but
I'm being cautions untill I can test this more.
HARD_REGNO_MODE_OK is about whether or not you
@@ -5268,7 +5268,7 @@ override_options ()
&& (class == MODE_FLOAT
|| class == MODE_COMPLEX_FLOAT
|| (TARGET_DEBUG_H_MODE && class == MODE_INT))
- && (! TARGET_SINGLE_FLOAT || size <= 4));
+ && size <= UNITS_PER_FPVALUE);
else if (MD_REG_P (regno))
temp = (class == MODE_INT
@@ -6415,8 +6415,6 @@ compute_frame_size (size)
HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */
long mask; /* mask of saved gp registers */
long fmask; /* mask of saved fp registers */
- int fp_inc; /* 1 or 2 depending on the size of fp regs */
- long fp_bits; /* bitmask to use for each fp register */
tree return_type;
gp_reg_size = 0;
@@ -6488,28 +6486,16 @@ compute_frame_size (size)
}
}
- /* Calculate space needed for fp registers. */
- if (TARGET_FLOAT64 || TARGET_SINGLE_FLOAT)
- {
- fp_inc = 1;
- fp_bits = 1;
- }
- else
- {
- fp_inc = 2;
- fp_bits = 3;
- }
-
/* This loop must iterate over the same space as its companion in
save_restore_insns. */
- for (regno = (FP_REG_LAST - fp_inc + 1);
+ for (regno = (FP_REG_LAST - FP_INC + 1);
regno >= FP_REG_FIRST;
- regno -= fp_inc)
+ regno -= FP_INC)
{
if (regs_ever_live[regno] && !call_used_regs[regno])
{
- fp_reg_size += fp_inc * UNITS_PER_FPREG;
- fmask |= fp_bits << (regno - FP_REG_FIRST);
+ fp_reg_size += FP_INC * UNITS_PER_FPREG;
+ fmask |= ((1 << FP_INC) - 1) << (regno - FP_REG_FIRST);
}
}
@@ -6555,7 +6541,7 @@ compute_frame_size (size)
current_frame_info.fmask = fmask;
current_frame_info.initialized = reload_completed;
current_frame_info.num_gp = gp_reg_size / UNITS_PER_WORD;
- current_frame_info.num_fp = fp_reg_size / (fp_inc * UNITS_PER_FPREG);
+ current_frame_info.num_fp = fp_reg_size / (FP_INC * UNITS_PER_FPREG);
if (mask)
{
@@ -6582,7 +6568,7 @@ compute_frame_size (size)
{
unsigned long offset = (args_size + extra_size + var_size
+ gp_reg_rounded + fp_reg_size
- - fp_inc * UNITS_PER_FPREG);
+ - FP_INC * UNITS_PER_FPREG);
current_frame_info.fp_sp_offset = offset;
current_frame_info.fp_save_offset = offset - total_size;
}
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 536ef51..0a8238d 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2331,15 +2331,10 @@ extern enum reg_class mips_char_to_class[256];
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
-#define CLASS_UNITS(mode, size) \
- ((GET_MODE_SIZE (mode) + (size) - 1) / (size))
-
#define CLASS_MAX_NREGS(CLASS, MODE) \
((CLASS) == FP_REGS \
- ? (TARGET_FLOAT64 \
- ? CLASS_UNITS (MODE, 8) \
- : 2 * CLASS_UNITS (MODE, 8)) \
- : CLASS_UNITS (MODE, UNITS_PER_WORD))
+ ? FP_INC \
+ : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
/* If defined, gives a class of registers that cannot be used as the
operand of a SUBREG that changes the mode of the object illegally.
@@ -2718,11 +2713,9 @@ extern struct mips_frame_info current_frame_info;
are 32 bits, we can't directly reference the odd numbered ones. */
#define FUNCTION_ARG_REGNO_P(N) \
- (((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST) \
- || ((! TARGET_SOFT_FLOAT \
- && ((N) >= FP_ARG_FIRST && (N) <= FP_ARG_LAST) \
- && (TARGET_FLOAT64 || (0 == (N) % 2))) \
- && ! fixed_regs[N]))
+ ((((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST) \
+ || ((N) >= FP_ARG_FIRST && (N) <= FP_ARG_LAST)) \
+ && !fixed_regs[N])
/* A C expression which can inhibit the returning of certain function
values in registers, based on the type of value. A nonzero value says