* system.h (ROUND_UP): New macro definition.
(ROUND_DOWN): Ditto.
* ggc-page.c (ROUND_UP): Remove local macro definition.
(PAGE_ALIGN): Implement using ROUND_UP macro.
* config/i386/i386.h (PUSH_ROUNDING): Implement using ROUND_UP macro.
* config/i386/i386.c (function_arg_advance_64): Use ROUND_UP macro
to align values.
(ix86_compute_frame_layout): Ditto.
(ix86_expand_prologue): Ditto.
(ix86_adjust_stack_and_probe): Use ROUND_DOWN macro
to round down values.
(expand_set_or_movmem_via_rep): Ditto.
From-SVN: r228410
+2015-10-02 Uros Bizjak <ubizjak@gmail.com>
+
+ * system.h (ROUND_UP): New macro definition.
+ (ROUND_DOWN): Ditto.
+ * ggc-page.c (ROUND_UP): Remove local macro definition.
+ (PAGE_ALIGN): Implement using ROUND_UP macro.
+
+ * config/i386/i386.h (PUSH_ROUNDING): Implement using ROUND_UP macro.
+ * config/i386/i386.c (function_arg_advance_64): Use ROUND_UP macro
+ to align values.
+ (ix86_compute_frame_layout): Ditto.
+ (ix86_expand_prologue): Ditto.
+ (ix86_adjust_stack_and_probe): Use ROUND_DOWN macro
+ to round down values.
+ (expand_set_or_movmem_via_rep): Ditto.
+
2015-10-02 Marek Polacek <polacek@redhat.com>
* genemit.c (gen_exp): Remove -Wduplicated-cond hack.
PR tree-optimization/67754
* graphite-scop-detection.c (stmt_has_simple_data_refs_p): Call
scev analysis on the same loop nest as analyze_drs_in_stmts.
- * graphite-sese-to-poly.c (outermost_loop_in_sese_1): Moved and renamed...
+ * graphite-sese-to-poly.c (outermost_loop_in_sese_1): Moved and
+ renamed...
(try_generate_gimple_bb): Call outermost_loop_in_sese.
(analyze_drs_in_stmts): Same.
* sese.c (outermost_loop_in_sese): ...here.
2015-10-01 H.J. Lu <hongjiu.lu@intel.com>
- * config/i386/x86-tune.def (X86_TUNE_USE_BT): Enable for
- Lakemont.
+ * config/i386/x86-tune.def (X86_TUNE_USE_BT): Enable for Lakemont.
(X86_TUNE_ZERO_EXTEND_WITH_AND): Disable for Lakemont.
2015-10-01 James Greenhalgh <james.greenhalgh@arm.com>
* config/i386/intelmic-mkoffload.c (main): Parse "-v" flag.
(generate_target_descr_file, generate_target_offloadend_file)
- (generate_host_descr_file, prepare_target_image, main): Pass it
- on.
+ (generate_host_descr_file, prepare_target_image, main): Pass it on.
* config/nvptx/mkoffload.c (main): Parse "-v" flag.
(compile_native, main): Pass it on.
* lto-wrapper.c (compile_offload_image): Likewise.
2015-09-30 Richard Biener <rguenther@suse.de>
- * builtins.c: Add comment that no new simplifications shouldd
+ * builtins.c: Add comment that no new simplifications should
be added here.
2015-09-30 Marek Polacek <polacek@redhat.com>
* config/i386/t-interix (winnt-stubs.o): Fix compilation rule.
- * config/sh/sh.c (gen_shl_and): Fix undefined left shift
- behaviour.
+ * config/sh/sh.c (gen_shl_and): Fix undefined left shift behaviour.
(gen_shl_sext): Likewise.
* config/sh/sh.md (divsi3): Likewise.
(imm->ext_dest_operand splitter): Likewise.
(define_insn "*<code><mode>3"): ... Into new pattern using
VI12_AVX_AVX512F iterators without masking.
-2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
+2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
* config.gcc: Support "skylake-avx512".
* config/i386/i386-c.c (ix86_target_macros_internal): Handle
(processor_type): Add PROCESSOR_SKYLAKE_AVX512.
* doc/invoke.texi (skylake-avx512): New.
-2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
+2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc/config/i386/i386.md (define_insn "kunpckhi"): Fix
operand in pattern.
(define_insn "kunpcksi"): Ditto.
(define_insn "kunpckdi"): Ditto.
-2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
+2015-09-22 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc/config/i386/i386.md (define_split not/xor SWI1248x): Use
iterator instead of fixed modes.
2015-09-04 Andrey Turetskiy <andrey.turetskiy@intel.com>
Petr Murzin <petr.murzin@intel.com>
- Kirill Yukhin <kirill.yukhin@intel.com>
+ Kirill Yukhin <kirill.yukhin@intel.com>
* config/i386/i386-builtin-types.def
(VOID_PFLOAT_HI_V8DI_V16SF_INT): New.
2015-09-04 Andrey Turetskiy <andrey.turetskiy@intel.com>
Petr Murzin <petr.murzin@intel.com>
- Kirill Yukhin <kirill.yukhin@intel.com>
+ Kirill Yukhin <kirill.yukhin@intel.com>
* doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_SCATTER): New.
* doc/tm.texi: Regenerate.
else
{
int align = ix86_function_arg_boundary (mode, type) / BITS_PER_WORD;
- cum->words = (cum->words + align - 1) & ~(align - 1);
+ cum->words = ROUND_UP (cum->words, align);
cum->words += words;
return 0;
}
16-byte aligned default stack, and thus we don't need to be
within the re-aligned local stack frame to save them. */
gcc_assert (INCOMING_STACK_BOUNDARY >= 128);
- offset = (offset + 16 - 1) & -16;
+ offset = ROUND_UP (offset, 16);
offset += frame->nsseregs * 16;
}
frame->sse_reg_save_offset = offset;
sure that no value happens to be the same before and after, force
the alignment computation below to add a non-zero value. */
if (stack_realign_fp)
- offset = (offset + stack_alignment_needed) & -stack_alignment_needed;
+ offset = ROUND_UP (offset, stack_alignment_needed);
/* Va-arg area */
frame->va_arg_size = ix86_varargs_gpr_size + ix86_varargs_fpr_size;
|| !crtl->is_leaf
|| cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor)
- offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed;
+ offset = ROUND_UP (offset, stack_alignment_needed);
/* Frame pointer points here. */
frame->frame_pointer_offset = offset;
or using alloca. */
if (!crtl->is_leaf || cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor)
- offset = (offset + preferred_alignment - 1) & -preferred_alignment;
+ offset = ROUND_UP (offset, preferred_alignment);
/* We've reached end of stack frame. */
frame->stack_pointer_offset = offset;
/* 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. */
/* 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. */
pointer is no longer valid. As for the value of sp_offset,
see ix86_compute_frame_layout, which we need to match in order
to pass verification of stack_pointer_offset at the end. */
- m->fs.sp_offset = (m->fs.sp_offset + align_bytes) & -align_bytes;
+ m->fs.sp_offset = ROUND_UP (m->fs.sp_offset, align_bytes);
m->fs.sp_valid = false;
}
destexp = gen_rtx_PLUS (Pmode, destptr, countreg);
if ((!issetmem || orig_value == const0_rtx) && CONST_INT_P (count))
{
- rounded_count = (INTVAL (count)
- & ~((HOST_WIDE_INT) GET_MODE_SIZE (mode) - 1));
+ rounded_count
+ = ROUND_DOWN (INTVAL (count), (HOST_WIDE_INT) GET_MODE_SIZE (mode));
destmem = shallow_copy_rtx (destmem);
set_mem_size (destmem, rounded_count);
}
srcexp = gen_rtx_PLUS (Pmode, srcptr, countreg);
if (CONST_INT_P (count))
{
- rounded_count = (INTVAL (count)
- & ~((HOST_WIDE_INT) GET_MODE_SIZE (mode) - 1));
+ rounded_count
+ = ROUND_DOWN (INTVAL (count), (HOST_WIDE_INT) GET_MODE_SIZE (mode));
srcmem = shallow_copy_rtx (srcmem);
set_mem_size (srcmem, rounded_count);
}
and -8 for 64bit targets, we need to make sure all stack pointer adjustments
are in multiple of 4 for 32bit targets and 8 for 64bit targets. */
-#define PUSH_ROUNDING(BYTES) \
- (((BYTES) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD)
+#define PUSH_ROUNDING(BYTES) ROUND_UP (BYTES, UNITS_PER_WORD)
/* If defined, the maximum amount of space required for outgoing arguments
will be computed and placed into the variable `crtl->outgoing_args_size'.
#define ROUND_UP_VALUE(x, f) ((f) - 1 - ((f) - 1 + (x)) % (f))
-/* Compute the smallest multiple of F that is >= X. */
-
-#define ROUND_UP(x, f) (CEIL (x, f) * (f))
-
/* Round X to next multiple of the page size */
-#define PAGE_ALIGN(x) (((x) + G.pagesize - 1) & ~(G.pagesize - 1))
+#define PAGE_ALIGN(x) ROUND_UP ((x), G.pagesize)
/* The Ith entry is the number of objects on a page or order I. */
/* Returns the least number N such that N * Y >= X. */
#define CEIL(x,y) (((x) + (y) - 1) / (y))
+/* This macro rounds x up to the y boundary. */
+#define ROUND_UP(x,y) (((x) + (y) - 1) & ~((y) - 1))
+
+/* This macro rounds x down to the y boundary. */
+#define ROUND_DOWN(x,y) ((x) & ~((y) - 1))
+
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif