summaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-06-15 13:07:47 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-06-15 13:07:47 +0200
commit079c527f5e7593f8563e3415ad04cf1f0e5d9269 (patch)
tree5c72c952d5e64996ab124de5c892988b2985f3d4 /gcc/expr.h
parentc55224dc4d22bbb0536f2386371f362fe066527e (diff)
downloadgcc-079c527f5e7593f8563e3415ad04cf1f0e5d9269.tar.gz
re PR tree-optimization/51581 (Integer division by constant is not vectorized)
PR tree-optimization/51581 * expr.h (choose_multiplier): New prototype. * expmed.c (choose_multiplier): No longer static. Change multiplier_ptr from rtx * to UHWI *. (expand_divmod): Adjust callers. * tree-vect-patterns.c (vect_recog_sdivmod_pow2_pattern): Renamed to... (vect_recog_divmod_pattern): ... this. Pass bb_vinfo as last argument to new_stmt_vec_info. Attempt to optimize also divisions by non-pow2 constants if integer vector division isn't supported. * tree-vect-stmts.c (vect_analyze_stmt): If node != NULL, don't look at pattern stmts and sequences. * gcc.c-torture/execute/pr51581-1.c: New test. * gcc.c-torture/execute/pr51581-2.c: New test. * gcc.dg/vect/pr51581-1.c: New test. * gcc.dg/vect/pr51581-2.c: New test. * gcc.dg/vect/pr51581-3.c: New test. * gcc.target/i386/avx-pr51581-1.c: New test. * gcc.target/i386/avx-pr51581-2.c: New test. * gcc.target/i386/avx2-pr51581-1.c: New test. * gcc.target/i386/avx2-pr51581-2.c: New test. * gcc.dg/vect/slp-26.c (main1): Divide by 0x8031 instead of 3. From-SVN: r188656
Diffstat (limited to 'gcc/expr.h')
-rw-r--r--gcc/expr.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index 0096367a727..7444baf166d 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -243,6 +243,13 @@ extern rtx emit_store_flag (rtx, enum rtx_code, rtx, rtx, enum machine_mode,
/* Like emit_store_flag, but always succeeds. */
extern rtx emit_store_flag_force (rtx, enum rtx_code, rtx, rtx,
enum machine_mode, int, int);
+
+/* Choose a minimal N + 1 bit approximation to 1/D that can be used to
+ replace division by D, and put the least significant N bits of the result
+ in *MULTIPLIER_PTR and return the most significant bit. */
+extern unsigned HOST_WIDE_INT choose_multiplier (unsigned HOST_WIDE_INT, int,
+ int, unsigned HOST_WIDE_INT *,
+ int *, int *);
/* Functions from builtins.c: */
extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);