aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2015-10-14 23:52:37 +0200
committerUros Bizjak <uros@gcc.gnu.org>2015-10-14 23:52:37 +0200
commit3a1d601a2ab1aab5977603d8643f298910460f11 (patch)
tree2f08ddb0540104fa9edd3c69a3a9dd051761153b
parent903eccd1d5e371d7a15e86595f7058eb178c0c04 (diff)
downloadgcc-3a1d601a2ab1aab5977603d8643f298910460f11.zip
gcc-3a1d601a2ab1aab5977603d8643f298910460f11.tar.gz
gcc-3a1d601a2ab1aab5977603d8643f298910460f11.tar.bz2
mips.h (MIPS_STACK_ALIGN): Implement using ROUND_UP macro.
* config/mips/mips.h (MIPS_STACK_ALIGN): Implement using ROUND_UP macro. * config/mips/mips.c (mips_setup_incoming_varargs): Use ROUND_DOWN to calculate off. (mips_gimplify_va_arg_expr): Use ROUND_UP to calculate rsize. (mips_emit_probe_stack_range): Use ROUND_DOWN to calculate rounded_size. From-SVN: r228829
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/mips/mips.c6
-rw-r--r--gcc/config/mips/mips.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3b08986..30860c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2015-10-14 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/mips/mips.h (MIPS_STACK_ALIGN): Implement using
+ ROUND_UP macro.
+ * config/mips/mips.c (mips_setup_incoming_varargs): Use
+ ROUND_DOWN to calculate off.
+ (mips_gimplify_va_arg_expr): Use ROUND_UP to calculate rsize.
+ (mips_emit_probe_stack_range): Use ROUND_DOWN to calculate
+ rounded_size.
+
2015-10-14 Eric Botcazou <ebotcazou@adacore.com>
* gimplify.c (gimplify_addr_expr) <MEM_REF>: New case.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index a4bb454..521b587 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6080,7 +6080,7 @@ mips_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
/* Set OFF to the offset from virtual_incoming_args_rtx of
the first float register. The FP save area lies below
the integer one, and is aligned to UNITS_PER_FPVALUE bytes. */
- off = (-gp_saved * UNITS_PER_WORD) & -UNITS_PER_FPVALUE;
+ off = ROUND_DOWN (-gp_saved * UNITS_PER_WORD, UNITS_PER_FPVALUE);
off -= fp_saved * UNITS_PER_FPREG;
mode = TARGET_SINGLE_FLOAT ? SFmode : DFmode;
@@ -6444,7 +6444,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
unshare_expr (valist), f_gtop, NULL_TREE);
off = build3 (COMPONENT_REF, TREE_TYPE (f_goff),
unshare_expr (valist), f_goff, NULL_TREE);
- rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
+ rsize = ROUND_UP (size, UNITS_PER_WORD);
if (rsize > UNITS_PER_WORD)
{
/* [1] Emit code for: off &= -rsize. */
@@ -11320,7 +11320,7 @@ mips_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
/* Step 1: round SIZE to the previous multiple of the interval. */
- rounded_size = size & -PROBE_INTERVAL;
+ rounded_size = ROUND_DOWN (size, PROBE_INTERVAL);
/* Step 2: compute initial and final value of the loop counter. */
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index be86c10..501d283 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2486,7 +2486,7 @@ typedef struct mips_args {
/* Treat LOC as a byte offset from the stack pointer and round it up
to the next fully-aligned offset. */
#define MIPS_STACK_ALIGN(LOC) \
- (TARGET_NEWABI ? ((LOC) + 15) & -16 : ((LOC) + 7) & -8)
+ (TARGET_NEWABI ? ROUND_UP ((LOC), 16) : ROUND_UP ((LOC), 8))
/* Output assembler code to FILE to increment profiler label # LABELNO