osprey/kg++fe/gnu/expmed.c File Reference

#include "config.h"
#include "system.h"
#include "toplev.h"
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
#include "flags.h"
#include "insn-config.h"
#include "expr.h"
#include "optabs.h"
#include "real.h"
#include "recog.h"
#include "langhooks.h"

Include dependency graph for expmed.c:

Go to the source code of this file.

Data Types

type  algorithm

Defines

#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN)   STRICT_ALIGNMENT
#define MAX_BITS_PER_WORD   BITS_PER_WORD
#define HAVE_insv   0
#define CODE_FOR_insv   CODE_FOR_nothing
#define gen_insv(a, b, c, d)   NULL_RTX
#define HAVE_extv   0
#define CODE_FOR_extv   CODE_FOR_nothing
#define gen_extv(a, b, c, d)   NULL_RTX
#define HAVE_extzv   0
#define CODE_FOR_extzv   CODE_FOR_nothing
#define gen_extzv(a, b, c, d)   NULL_RTX
#define EXACT_POWER_OF_2_OR_ZERO_P(x)   (((x) & ((x) - 1)) == 0)

Enumerations

enum  alg_code {
  alg_zero, alg_m, alg_shift, alg_add_t_m2,
  alg_sub_t_m2, alg_add_factor, alg_sub_factor, alg_add_t2_m,
  alg_sub_t2_m, alg_add, alg_subtract, alg_factor,
  alg_shiftop, alg_zero, alg_m, alg_shift,
  alg_add_t_m2, alg_sub_t_m2, alg_add_factor, alg_sub_factor,
  alg_add_t2_m, alg_sub_t2_m, alg_add, alg_subtract,
  alg_factor, alg_shiftop, alg_unknown, alg_zero,
  alg_m, alg_shift, alg_add_t_m2, alg_sub_t_m2,
  alg_add_factor, alg_sub_factor, alg_add_t2_m, alg_sub_t2_m,
  alg_unknown, alg_zero, alg_m, alg_shift,
  alg_add_t_m2, alg_sub_t_m2, alg_add_factor, alg_sub_factor,
  alg_add_t2_m, alg_sub_t2_m, alg_impossible
}

Functions/Subroutines

static void store_fixed_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx))
static void store_split_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx))
static rtx extract_fixed_bit_field PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx, int))
static rtx mask_rtx PARAMS ((enum machine_mode, int, int, int))
static rtx lshift_value PARAMS ((enum machine_mode, rtx, int, int))
static rtx extract_split_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, int))
static void do_cmp_and_jump PARAMS ((rtx, rtx, enum rtx_code, enum machine_mode, rtx))
void init_expmed ()
rtx negate_rtx (enum machine_mode mode, rtx x)
enum machine_mode mode_for_extraction (enum extraction_pattern pattern, int opno)
rtx store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitnum, enum machine_mode fieldmode, rtx value, HOST_WIDE_INT total_size)
static void store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitpos, rtx value)
static void store_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitpos, rtx value)
rtx extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitnum, int unsignedp, rtx target, enum machine_mode mode, enum machine_mode tmode, HOST_WIDE_INT total_size)
static rtx extract_fixed_bit_field (enum machine_mode tmode, rtx op0, unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitpos, rtx target, int unsignedp)
static rtx mask_rtx (enum machine_mode mode, int bitpos, int bitsize, int complement)
static rtx lshift_value (enum machine_mode mode, rtx value, int bitpos, int bitsize)
static rtx extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitpos, int unsignedp)
void expand_inc (rtx target, rtx inc)
void expand_dec (rtx target, rtx dec)
rtx expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, tree amount, rtx target, int unsignedp)
static void synth_mult PARAMS ((struct algorithm *, unsigned HOST_WIDE_INT, int))
static unsigned HOST_WIDE_INT
choose_multiplier 
PARAMS ((unsigned HOST_WIDE_INT, int, int, unsigned HOST_WIDE_INT *, int *, int *))
static unsigned HOST_WIDE_INT
invert_mod2n 
PARAMS ((unsigned HOST_WIDE_INT, int))
static void synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t, int cost_limit)
rtx expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, int unsignedp)
int ceil_log2 (unsigned HOST_WIDE_INT x)
static unsigned HOST_WIDE_INT choose_multiplier (unsigned HOST_WIDE_INT d, int n, int precision, unsigned HOST_WIDE_INT *multiplier_ptr, int *post_shift_ptr, int *lgup_ptr)
static unsigned HOST_WIDE_INT invert_mod2n (unsigned HOST_WIDE_INT x, int n)
rtx expand_mult_highpart_adjust (enum machine_mode mode, rtx adj_operand, rtx op0, rtx op1, rtx target, int unsignedp)
rtx expand_mult_highpart (enum machine_mode mode, rtx op0, unsigned HOST_WIDE_INT cnst1, rtx target, int unsignedp, int max_cost)
rtx expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx op0, rtx op1, rtx target, int unsignedp)
tree make_tree (tree type, rtx x)
bool const_mult_add_overflow_p (rtx x, rtx mult, rtx add, enum machine_mode mode, int unsignedp)
rtx expand_mult_add (rtx x, rtx target, rtx mult, rtx add, enum machine_mode mode, int unsignedp)
rtx expand_and (enum machine_mode mode, rtx op0, rtx op1, rtx target)
rtx emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1, enum machine_mode mode, int unsignedp, int normalizep)
rtx emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1, enum machine_mode mode, int unsignedp, int normalizep)
static void do_cmp_and_jump (rtx arg1, rtx arg2, enum rtx_code op, enum machine_mode mode, rtx label)

Variables

static int sdiv_pow2_cheap
static int smod_pow2_cheap
static int add_cost
static int negate_cost
static int zero_cost
static int shift_cost [MAX_BITS_PER_WORD]
static int shiftadd_cost [MAX_BITS_PER_WORD]
static int shiftsub_cost [MAX_BITS_PER_WORD]
static int mul_cost [NUM_MACHINE_MODES]
static int div_cost [NUM_MACHINE_MODES]
static int mul_widen_cost [NUM_MACHINE_MODES]
static int mul_highpart_cost [NUM_MACHINE_MODES]


Define Documentation

#define CODE_FOR_extv   CODE_FOR_nothing

Definition at line 88 of file expmed.c.

Referenced by extract_bit_field(), and mode_for_extraction().

#define CODE_FOR_extzv   CODE_FOR_nothing

Definition at line 93 of file expmed.c.

Referenced by extract_bit_field(), and mode_for_extraction().

#define CODE_FOR_insv   CODE_FOR_nothing

Definition at line 83 of file expmed.c.

Referenced by mode_for_extraction(), and store_bit_field().

#define EXACT_POWER_OF_2_OR_ZERO_P (  )     (((x) & ((x) - 1)) == 0)

Definition at line 2948 of file expmed.c.

Referenced by expand_divmod(), and expand_mult().

#define gen_extv ( a,
b,
c,
d   )     NULL_RTX

Definition at line 89 of file expmed.c.

Referenced by extract_bit_field(), and gen_ashrsi3().

#define gen_extzv ( a,
b,
c,
d   )     NULL_RTX

Definition at line 94 of file expmed.c.

Referenced by extract_bit_field(), and gen_lshrsi3().

#define gen_insv ( a,
b,
c,
d   )     NULL_RTX

Definition at line 84 of file expmed.c.

Referenced by emit_move_sequence(), gen_insv(), and store_bit_field().

#define HAVE_extv   0

Definition at line 87 of file expmed.c.

Referenced by extract_bit_field(), and mode_for_extraction().

#define HAVE_extzv   0

Definition at line 92 of file expmed.c.

Referenced by extract_bit_field(), and mode_for_extraction().

#define HAVE_insv   0

Definition at line 82 of file expmed.c.

Referenced by mode_for_extraction(), and store_bit_field().

#define MAX_BITS_PER_WORD   BITS_PER_WORD

Definition at line 77 of file expmed.c.

#define SLOW_UNALIGNED_ACCESS ( MODE,
ALIGN   )     STRICT_ALIGNMENT

Definition at line 69 of file expmed.c.


Enumeration Type Documentation

enum alg_code

Enumerator:
alg_zero 
alg_m 
alg_shift 
alg_add_t_m2 
alg_sub_t_m2 
alg_add_factor 
alg_sub_factor 
alg_add_t2_m 
alg_sub_t2_m 
alg_add 
alg_subtract 
alg_factor 
alg_shiftop 
alg_zero 
alg_m 
alg_shift 
alg_add_t_m2 
alg_sub_t_m2 
alg_add_factor 
alg_sub_factor 
alg_add_t2_m 
alg_sub_t2_m 
alg_add 
alg_subtract 
alg_factor 
alg_shiftop 
alg_unknown 
alg_zero 
alg_m 
alg_shift 
alg_add_t_m2 
alg_sub_t_m2 
alg_add_factor 
alg_sub_factor 
alg_add_t2_m 
alg_sub_t2_m 
alg_unknown 
alg_zero 
alg_m 
alg_shift 
alg_add_t_m2 
alg_sub_t_m2 
alg_add_factor 
alg_sub_factor 
alg_add_t2_m 
alg_sub_t2_m 
alg_impossible 

Definition at line 2047 of file expmed.c.


Function Documentation

int ceil_log2 ( unsigned HOST_WIDE_INT  x  ) 

Definition at line 2579 of file expmed.c.

Referenced by choose_multiplier(), ideal_phi_node_len(), and tree_ssa_dominator_optimize().

static unsigned HOST_WIDE_INT choose_multiplier ( unsigned HOST_WIDE_INT  d,
int  n,
int  precision,
unsigned HOST_WIDE_INT *  multiplier_ptr,
int *  post_shift_ptr,
int *  lgup_ptr 
) [static]

Definition at line 2603 of file expmed.c.

References abort, ceil_log2(), div_and_round_double(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, nl, and pow().

Referenced by expand_divmod().

bool const_mult_add_overflow_p ( rtx  x,
rtx  mult,
rtx  add,
enum machine_mode  mode,
int  unsignedp 
)

Definition at line 4176 of file expmed.c.

Referenced by maybe_eliminate_biv_1().

static void do_cmp_and_jump ( rtx  arg1,
rtx  arg2,
enum rtx_code  op,
enum machine_mode  mode,
rtx  label 
) [static]

rtx emit_store_flag ( rtx  target,
enum rtx_code  code,
rtx  op0,
rtx  op1,
enum machine_mode  mode,
int  unsignedp,
int  normalizep 
)

rtx emit_store_flag_force ( rtx  target,
enum rtx_code  code,
rtx  op0,
rtx  op1,
enum machine_mode  mode,
int  unsignedp,
int  normalizep 
)

Definition at line 4713 of file expmed.c.

Referenced by expand_binop(), and ia64_expand_compare_and_swap().

rtx expand_and ( enum machine_mode  mode,
rtx  op0,
rtx  op1,
rtx  target 
)

void expand_dec ( rtx  target,
rtx  dec 
)

Definition at line 1889 of file expmed.c.

Referenced by expand_divmod().

rtx expand_divmod ( int  rem_flag,
enum tree_code  code,
enum machine_mode  mode,
rtx  op0,
rtx  op1,
rtx  target,
int  unsignedp 
)

void expand_inc ( rtx  target,
rtx  inc 
)

Definition at line 1876 of file expmed.c.

Referenced by check_dbra_loop(), emit_move_sequence(), expand_divmod(), and expand_sdiv_pow2().

rtx expand_mult ( enum machine_mode  mode,
rtx  op0,
rtx  op1,
rtx  target,
int  unsignedp 
)

rtx expand_mult_add ( rtx  x,
rtx  target,
rtx  mult,
rtx  add,
enum machine_mode  mode,
int  unsignedp 
)

Definition at line 4215 of file expmed.c.

Referenced by gen_add_mult(), iv_add_mult_cost(), and maybe_eliminate_biv_1().

rtx expand_mult_highpart ( enum machine_mode  mode,
rtx  op0,
unsigned HOST_WIDE_INT  cnst1,
rtx  target,
int  unsignedp,
int  max_cost 
)

rtx expand_mult_highpart_adjust ( enum machine_mode  mode,
rtx  adj_operand,
rtx  op0,
rtx  op1,
rtx  target,
int  unsignedp 
)

rtx expand_shift ( enum tree_code  code,
enum machine_mode  mode,
rtx  shifted,
tree  amount,
rtx  target,
int  unsignedp 
)

rtx extract_bit_field ( rtx  str_rtx,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitnum,
int  unsignedp,
rtx  target,
enum machine_mode  mode,
enum machine_mode  tmode,
HOST_WIDE_INT  total_size 
)

static rtx extract_fixed_bit_field ( enum machine_mode  tmode,
rtx  op0,
unsigned HOST_WIDE_INT  offset,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitpos,
rtx  target,
int  unsignedp 
) [static]

static rtx extract_split_bit_field ( rtx  op0,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitpos,
int  unsignedp 
) [static]

void init_expmed ( void   ) 

Definition at line 109 of file expmed.c.

Referenced by backend_init().

static unsigned HOST_WIDE_INT invert_mod2n ( unsigned HOST_WIDE_INT  x,
int  n 
) [static]

Definition at line 2700 of file expmed.c.

References HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, and is::y.

Referenced by expand_divmod().

static rtx lshift_value ( enum machine_mode  mode,
rtx  value,
int  bitpos,
int  bitsize 
) [static]

Definition at line 1741 of file expmed.c.

References high, HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, immed_double_const(), INTVAL, and low.

Referenced by store_fixed_bit_field().

tree make_tree ( tree  type,
rtx  x 
)

static rtx mask_rtx ( enum machine_mode  mode,
int  bitpos,
int  bitsize,
int  complement 
) [static]

enum machine_mode mode_for_extraction ( enum extraction_pattern  pattern,
int  opno 
)

rtx negate_rtx ( enum machine_mode  mode,
rtx  x 
)

static unsigned HOST_WIDE_INT invert_mod2n PARAMS ( (unsigned HOST_WIDE_INT, int)   )  [static]

static unsigned HOST_WIDE_INT choose_multiplier PARAMS ( (unsigned HOST_WIDE_INT, int, int, unsigned HOST_WIDE_INT *, int *, int *)   )  [static]

static void synth_mult PARAMS ( (struct algorithm *, unsigned HOST_WIDE_INT, int)   )  [static]

static void do_cmp_and_jump PARAMS ( (rtx, rtx, enum rtx_code, enum machine_mode, rtx  )  [static]

static rtx extract_split_bit_field PARAMS ( (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, int)   )  [static]

static rtx lshift_value PARAMS ( (enum machine_mode, rtx, int, int)   )  [static]

static rtx mask_rtx PARAMS ( (enum machine_mode, int, int, int)   )  [static]

static rtx extract_fixed_bit_field PARAMS ( (enum machine_mode, rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx, int)   )  [static]

static void store_split_bit_field PARAMS ( (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx  )  [static]

static void store_fixed_bit_field PARAMS ( (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx  )  [static]

rtx store_bit_field ( rtx  str_rtx,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitnum,
enum machine_mode  fieldmode,
rtx  value,
HOST_WIDE_INT  total_size 
)

static void store_fixed_bit_field ( rtx  op0,
unsigned HOST_WIDE_INT  offset,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitpos,
rtx  value 
) [static]

static void store_split_bit_field ( rtx  op0,
unsigned HOST_WIDE_INT  bitsize,
unsigned HOST_WIDE_INT  bitpos,
rtx  value 
) [static]

static void synth_mult ( struct algorithm alg_out,
unsigned HOST_WIDE_INT  t,
int  cost_limit 
) [static]


Variable Documentation

int add_cost [static]

int div_cost[NUM_MACHINE_MODES] [static]

Definition at line 104 of file expmed.c.

Referenced by expand_divmod(), and init_expmed().

int mul_cost[NUM_MACHINE_MODES] [static]

Definition at line 103 of file expmed.c.

Referenced by expand_divmod(), expand_mult_highpart_optab(), and init_expmed().

int mul_highpart_cost[NUM_MACHINE_MODES] [static]

Definition at line 106 of file expmed.c.

Referenced by expand_mult_highpart_optab(), and init_expmed().

int mul_widen_cost[NUM_MACHINE_MODES] [static]

Definition at line 105 of file expmed.c.

Referenced by expand_mult_highpart_optab(), and init_expmed().

int negate_cost [static]

Definition at line 99 of file expmed.c.

int sdiv_pow2_cheap [static]

Definition at line 66 of file expmed.c.

Referenced by expand_divmod(), and init_expmed().

int shift_cost[MAX_BITS_PER_WORD] [static]

int shiftadd_cost[MAX_BITS_PER_WORD] [static]

Definition at line 101 of file expmed.c.

Referenced by init_expmed(), and synth_mult().

int shiftsub_cost[MAX_BITS_PER_WORD] [static]

Definition at line 102 of file expmed.c.

Referenced by init_expmed(), and synth_mult().

int smod_pow2_cheap [static]

Definition at line 66 of file expmed.c.

Referenced by expand_divmod(), and init_expmed().

int zero_cost [static]

Definition at line 99 of file expmed.c.

Referenced by init_expmed(), and synth_mult().


Generated on Wed Apr 8 15:32:03 2009 for Open64 by  doxygen 1.5.6