summaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:54:08 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:54:08 +0000
commit6ebe4c6978847bb027afb24b03e91aa4a850056e (patch)
treebbd31df3f0f8e6de8d0b1dc923fc0b8c2395a5ce /gcc/expmed.c
parent5f00384a2df620694cde858c379b6fa5060f3692 (diff)
downloadgcc-6ebe4c6978847bb027afb24b03e91aa4a850056e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162094 138bc75d-0d04-0410-961f-82ee72b054a4
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 479adbc13d3..c10d52ec8c4 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)
{