Commit e7ba741c authored by Michael Beck's avatar Michael Beck
Browse files

renamed structures containing settings to ir_settings_*_t and place them in firm_types.h

[r14980]
parent 5f4a7559
......@@ -26,7 +26,6 @@
#ifndef FIRM_BE_MAIN_H
#define FIRM_BE_MAIN_H
#include <stdio.h>
#include "irarch.h"
#include "archop.h"
#include "lowering.h"
......@@ -50,7 +49,7 @@ typedef struct backend_params {
const arch_ops_info *arch_op_settings;
/** Settings for architecture dependent optimizations */
const arch_dep_params_t *dep_param;
const ir_settings_arch_dep_t *dep_param;
/** the architecture specific intrinsic function creator */
create_intrinsic_fkt *arch_create_intrinsic_fkt;
......@@ -59,7 +58,7 @@ typedef struct backend_params {
void *create_intrinsic_ctx;
/** backend settings for if-conversion */
const opt_if_conv_info_t *if_conv_info;
const ir_settings_if_conv_t *if_conv_info;
} backend_params;
/**
......
......@@ -65,8 +65,11 @@ typedef struct _ir_extblk ir_extblk, *ir_extblk_ptr;
typedef struct ir_exec_freq ir_exec_freq, *ir_exec_freq_ptr;
typedef struct sn_entry *seqno_t;
typedef void irg_walk_func(ir_node *, void *);
typedef void irg_reg_walk_func(ir_region *, void *);
/* settings */
typedef struct ir_settings_arch_dep_t ir_settings_arch_dep_t;
typedef struct ir_settings_if_conv_t ir_settings_if_conv_t;
#endif
......@@ -33,40 +33,40 @@
* A parameter structure that drives the machine dependent Firm
* optimizations.
*/
typedef struct {
/* Mul optimization */
unsigned also_use_subs : 1; /**< Use also Subs when resolving Muls to shifts */
int maximum_shifts; /**< The maximum number of shifts that shall be inserted for a mul. */
unsigned highest_shift_amount; /**< The highest shift amount you want to
tolerate. Muls which would require a higher
shift constant are left. */
struct ir_settings_arch_dep_t {
/* Mul optimization */
unsigned also_use_subs : 1; /**< Use also Subs when resolving Muls to shifts */
int maximum_shifts; /**< The maximum number of shifts that shall be inserted for a mul. */
unsigned highest_shift_amount; /**< The highest shift amount you want to
tolerate. Muls which would require a higher
shift constant are left. */
/* Div/Mod optimization */
unsigned allow_mulhs : 1; /**< Use the Mulhs operation for division by constant */
unsigned allow_mulhu : 1; /**< Use the Mulhu operation for division by constant */
int max_bits_for_mulh; /**< Maximum number of bits the Mulh operation can take.
Modes with higher amount of bits will use Mulh */
} arch_dep_params_t;
/* Div/Mod optimization */
unsigned allow_mulhs : 1; /**< Use the Mulhs operation for division by constant */
unsigned allow_mulhu : 1; /**< Use the Mulhu operation for division by constant */
int max_bits_for_mulh; /**< Maximum number of bits the Mulh operation can take.
Modes with higher amount of bits will use Mulh */
};
/**
* A factory function, that provides architecture parameters for
* machine dependent optimizations.
*/
typedef const arch_dep_params_t *(*arch_dep_params_factory_t)(void);
typedef const ir_settings_arch_dep_t *(*arch_dep_params_factory_t)(void);
/**
* A default parameter factory for testing purposes.
*/
const arch_dep_params_t *arch_dep_default_factory(void);
const ir_settings_arch_dep_t *arch_dep_default_factory(void);
/**
* Optimization flags.
*/
typedef enum {
arch_dep_none = 0,
arch_dep_mul_to_shift = 1, /**< optimize Mul into Shift/Add/Sub */
arch_dep_div_by_const = 2, /**< optimize Div into Shift/Add/Mulh */
arch_dep_mod_by_const = 4 /**< optimize Mod into Shift/Add/Mulh */
arch_dep_none = 0,
arch_dep_mul_to_shift = 1, /**< optimize Mul into Shift/Add/Sub */
arch_dep_div_by_const = 2, /**< optimize Div into Shift/Add/Mulh */
arch_dep_mod_by_const = 4 /**< optimize Mod into Shift/Add/Mulh */
} arch_dep_opts_t;
/**
......
......@@ -171,13 +171,13 @@ typedef int (*arch_allow_ifconv_func)(ir_node *sel, ir_node* phi_list, int i, in
/**
* The parameters structure.
*/
typedef struct _opt_if_conv_info_t {
int max_depth; /**< The maximum depth up to which expressions
are examined when it has to be decided if they
can be placed into another block. */
arch_allow_ifconv_func allow_ifconv; /**< Evaluator function, if not set all possible Psi
nodes will be created. */
} opt_if_conv_info_t;
struct ir_settings_if_conv_t {
int max_depth; /**< The maximum depth up to which expressions
are examined when it has to be decided if they
can be placed into another block. */
arch_allow_ifconv_func allow_ifconv; /**< Evaluator function, if not set all possible Psi
nodes will be created. */
};
/**
* Perform If conversion on a graph.
......@@ -188,7 +188,7 @@ typedef struct _opt_if_conv_info_t {
* Cannot handle blocks with Bad control predecessors, so call it after control
* flow optimization.
*/
void opt_if_conv(ir_graph *irg, const opt_if_conv_info_t *params);
void opt_if_conv(ir_graph *irg, const ir_settings_if_conv_t *params);
void opt_ldst2(ir_graph *irg);
......
......@@ -661,7 +661,7 @@ static int TEMPLATE_get_reg_class_alignment(const void *self,
* Returns the libFirm configuration parameter for this backend.
*/
static const backend_params *TEMPLATE_get_backend_params(void) {
static arch_dep_params_t ad = {
static ir_settings_arch_dep_t ad = {
1, /* allow subs */
0, /* Muls are fast enough on Firm */
31, /* shift would be ok */
......
......@@ -1209,11 +1209,11 @@ static int arm_is_psi_allowed(ir_node *sel, ir_node *phi_list, int i, int j) {
* Returns the libFirm configuration parameter for this backend.
*/
static const backend_params *arm_get_libfirm_params(void) {
static const opt_if_conv_info_t ifconv = {
static const ir_settings_if_conv_t ifconv = {
4, /* maxdepth, doesn't matter for Psi-conversion */
arm_is_psi_allowed /* allows or disallows Psi creation for given selector */
};
static arch_dep_params_t ad = {
static ir_settings_arch_dep_t ad = {
1, /* allow subs */
1, /* Muls are fast enough on ARM but ... */
31, /* ... one shift would be possible better */
......
......@@ -1014,7 +1014,7 @@ static ir_graph **mips_get_irg_list(const void *self, ir_graph ***irg_list)
* Returns the libFirm configuration parameter for this backend.
*/
static const backend_params *mips_get_libfirm_params(void) {
static arch_dep_params_t ad = {
static ir_settings_arch_dep_t ad = {
1, /* allow subs */
0, /* Muls are fast enough on Mips */
31, /* shift would be ok */
......
......@@ -933,7 +933,7 @@ static ir_graph **ppc32_get_irg_list(const void *self, ir_graph ***irg_list) {
* Returns the libFirm configuration parameter for this backend.
*/
static const backend_params *ppc32_get_libfirm_params(void) {
static arch_dep_params_t ad = {
static ir_settings_arch_dep_t ad = {
1, /* allow subs */
0, /* Muls are fast enough on ARM */
31, /* shift would be ok */
......
This diff is collapsed.
......@@ -61,7 +61,7 @@ static int default_allow_ifconv(ir_node *sel, ir_node* phi_list, int i, int j)
/**
* Default options.
*/
static const opt_if_conv_info_t default_info = {
static const ir_settings_if_conv_t default_info = {
0, /* doesn't matter for Psi */
default_allow_ifconv
};
......@@ -263,7 +263,7 @@ static void prepare_path(ir_node* block, int i, const ir_node* dependency)
static void if_conv_walker(ir_node* block, void* env)
{
opt_if_conv_info_t* opt_info = env;
ir_settings_if_conv_t* opt_info = env;
int arity;
int i;
......@@ -539,10 +539,10 @@ static void optimise_psis_1(ir_node* psi, void* env)
}
void opt_if_conv(ir_graph *irg, const opt_if_conv_info_t *params)
void opt_if_conv(ir_graph *irg, const ir_settings_if_conv_t *params)
{
struct obstack obst;
opt_if_conv_info_t p;
ir_settings_if_conv_t p;
/* get the parameters */
p = (params != NULL ? *params : default_info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment