aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-12 18:54:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-12 18:54:08 +0000
commit462f85cedc8375e893fd1179f5ecab498085c78d (patch)
treebbd31df3f0f8e6de8d0b1dc923fc0b8c2395a5ce /gcc/expmed.c
parentd474db84488c71868483429070d545811adbc677 (diff)
downloadgcc-462f85cedc8375e893fd1179f5ecab498085c78d.zip
gcc-462f85cedc8375e893fd1179f5ecab498085c78d.tar.gz
gcc-462f85cedc8375e893fd1179f5ecab498085c78d.tar.bz2
Makefile.in (expmed.o, [...]): Depend on expmed.h.
gcc/ * Makefile.in (expmed.o, target-globals.o): Depend on expmed.h. * expmed.h: New file. * expmed.c (default_target_costs): New variable. (this_target_costs): New conditional variable. (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost, neg_cost) (shift_cost, shiftadd_cost, shiftsub0_cost, shiftsub1_cost, mul_cost) (sdiv_cost, udiv_cost, mul_widen_cost, mul_highpart_cost): Delete. * target-globals.h (this_target_expmed): Declare. (target_globals): Add a expmed field. (restore_target_globals): Copy the expmed field to this_target_expmed. * target-globals.c: Include expmed.h. (default_target_globals): Initialize the expmed field. (save_target_globals): Likewise. From-SVN: r162094
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 479adbc..c10d52e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -38,6 +38,12 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "df.h"
#include "target.h"
+#include "expmed.h"
+
+struct target_expmed default_target_expmed;
+#if SWITCHABLE_TARGET
+struct target_expmed *this_target_expmed = &default_target_expmed;
+#endif
static void store_fixed_bit_field (rtx, unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT,
@@ -59,14 +65,6 @@ static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT);
/* Test whether a value is zero of a power of two. */
#define EXACT_POWER_OF_2_OR_ZERO_P(x) (((x) & ((x) - 1)) == 0)
-/* Nonzero means divides or modulus operations are relatively cheap for
- powers of two, so don't use branches; emit the operation instead.
- Usually, this will mean that the MD file will emit non-branch
- sequences. */
-
-static bool sdiv_pow2_cheap[2][NUM_MACHINE_MODES];
-static bool smod_pow2_cheap[2][NUM_MACHINE_MODES];
-
#ifndef SLOW_UNALIGNED_ACCESS
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
#endif
@@ -96,21 +94,6 @@ static bool smod_pow2_cheap[2][NUM_MACHINE_MODES];
#define gen_extzv(a,b,c,d) NULL_RTX
#endif
-/* Cost of various pieces of RTL. Note that some of these are indexed by
- shift count and some by mode. */
-static int zero_cost[2];
-static int add_cost[2][NUM_MACHINE_MODES];
-static int neg_cost[2][NUM_MACHINE_MODES];
-static int shift_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftadd_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftsub0_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int shiftsub1_cost[2][NUM_MACHINE_MODES][MAX_BITS_PER_WORD];
-static int mul_cost[2][NUM_MACHINE_MODES];
-static int sdiv_cost[2][NUM_MACHINE_MODES];
-static int udiv_cost[2][NUM_MACHINE_MODES];
-static int mul_widen_cost[2][NUM_MACHINE_MODES];
-static int mul_highpart_cost[2][NUM_MACHINE_MODES];
-
void
init_expmed (void)
{