Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
be8b3b02
Commit
be8b3b02
authored
May 23, 2008
by
Matthias Braun
Browse files
- arch_get_irn_ops simplified
- removed arch_irn_handler stuff [r19738]
parent
38efd2ac
Changes
21
Hide whitespace changes
Inline
Side-by-side
include/libfirm/firm_types.h
View file @
be8b3b02
...
...
@@ -66,6 +66,7 @@ typedef struct _ir_extblk ir_extblk, *ir_extblk_ptr;
typedef
struct
ir_exec_freq
ir_exec_freq
,
*
ir_exec_freq_ptr
;
typedef
struct
ir_cdep
ir_cdep
,
*
ir_cdep_ptr
;
typedef
struct
sn_entry
*
seqno_t
;
typedef
struct
arch_irn_ops_t
arch_irn_ops_t
;
typedef
union
ir_initializer_t
ir_initializer_t
,
*
ir_initializer_ptr
;
...
...
include/libfirm/irop.h
View file @
be8b3b02
...
...
@@ -95,10 +95,10 @@ typedef enum {
iro_Pin
,
iro_ASM
,
iro_Anchor
,
/*
las
t middleend node number */
iro_Last
,
/*
first no
t middleend node number */
iro_Last
=
iro_Anchor
,
/* first backend node number */
beo_First
=
iro_Last
,
beo_First
,
/* backend specific nodes */
beo_Spill
=
beo_First
,
beo_Reload
,
...
...
@@ -117,9 +117,9 @@ typedef enum {
beo_Barrier
,
beo_Unwind
,
/* last backend node number */
beo_Last
,
/*
la
st fixed number. Dynamic node numbers start here */
iro_MaxOpcode
=
beo_Last
beo_Last
=
beo_Unwind
,
/*
fir
st
un
fixed number. Dynamic node numbers start here */
iro_MaxOpcode
}
ir_opcode
;
extern
ir_op
*
op_Block
;
ir_op
*
get_op_Block
(
void
);
...
...
@@ -371,6 +371,7 @@ typedef struct {
verify_proj_node_func
verify_proj_node
;
/**< Verify the Proj node. */
dump_node_func
dump_node
;
/**< Dump a node. */
op_func
generic
;
/**< A generic function pointer. */
const
arch_irn_ops_t
*
be_ops
;
/**< callbacks used by the backend. */
}
ir_op_ops
;
/**
...
...
ir/be/TEMPLATE/bearch_TEMPLATE.c
View file @
be8b3b02
...
...
@@ -223,7 +223,7 @@ static int TEMPLATE_get_sp_bias(const void *self, const ir_node *irn) {
/* fill register allocator interface */
static
const
arch_irn_ops_
if_
t
TEMPLATE_irn_ops
_if
=
{
static
const
arch_irn_ops_t
TEMPLATE_irn_ops
=
{
TEMPLATE_get_irn_reg_req
,
TEMPLATE_set_irn_reg
,
TEMPLATE_get_irn_reg
,
...
...
@@ -239,13 +239,6 @@ static const arch_irn_ops_if_t TEMPLATE_irn_ops_if = {
NULL
,
/* perform_memory_operand */
};
TEMPLATE_irn_ops_t
TEMPLATE_irn_ops
=
{
&
TEMPLATE_irn_ops_if
,
NULL
};
/**************************************************
* _ _ __
* | | (_)/ _|
...
...
@@ -350,8 +343,6 @@ static void *TEMPLATE_cg_init(be_irg_t *birg) {
cur_reg_set
=
cg
->
reg_set
;
TEMPLATE_irn_ops
.
cg
=
cg
;
return
(
arch_code_generator_t
*
)
cg
;
}
...
...
@@ -397,7 +388,7 @@ static void *TEMPLATE_init(FILE *outfile) {
be_emit_init
(
outfile
);
TEMPLATE_register_init
();
TEMPLATE_create_opcodes
();
TEMPLATE_create_opcodes
(
&
TEMPLATE_irn_ops
);
return
isa
;
}
...
...
@@ -589,18 +580,6 @@ void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
}
}
static
const
void
*
TEMPLATE_get_irn_ops
(
const
ir_node
*
irn
)
{
(
void
)
irn
;
return
&
TEMPLATE_irn_ops
;
}
arch_get_irn_ops_t
*
TEMPLATE_get_irn_handler
(
const
void
*
self
)
{
(
void
)
self
;
return
&
TEMPLATE_get_irn_ops
;
}
int
TEMPLATE_to_appear_in_schedule
(
void
*
block_env
,
const
ir_node
*
irn
)
{
(
void
)
block_env
;
...
...
@@ -704,7 +683,6 @@ const arch_isa_if_t TEMPLATE_isa_if = {
TEMPLATE_get_reg_class
,
TEMPLATE_get_reg_class_for_mode
,
TEMPLATE_get_call_abi
,
TEMPLATE_get_irn_handler
,
TEMPLATE_get_code_generator_if
,
TEMPLATE_get_list_sched_selector
,
TEMPLATE_get_ilp_sched_selector
,
...
...
ir/be/TEMPLATE/bearch_TEMPLATE_t.h
View file @
be8b3b02
...
...
@@ -34,7 +34,6 @@
typedef
struct
TEMPLATE_isa_t
TEMPLATE_isa_t
;
typedef
struct
TEMPLATE_code_gen_t
TEMPLATE_code_gen_t
;
typedef
struct
TEMPLATE_irn_ops_t
TEMPLATE_irn_ops_t
;
typedef
struct
TEMPLATE_transform_env_t
TEMPLATE_transform_env_t
;
struct
TEMPLATE_code_gen_t
{
...
...
@@ -51,11 +50,6 @@ struct TEMPLATE_isa_t {
arch_isa_t
arch_isa
;
/**< must be derived from arch_isa */
};
struct
TEMPLATE_irn_ops_t
{
const
arch_irn_ops_if_t
*
impl
;
TEMPLATE_code_gen_t
*
cg
;
};
/**
* this is a struct to minimize the number of parameters
* for transformation walker
...
...
ir/be/arm/bearch_arm.c
View file @
be8b3b02
...
...
@@ -263,7 +263,7 @@ static int arm_get_sp_bias(const void *self, const ir_node *irn)
/* fill register allocator interface */
static
const
arch_irn_ops_
if_
t
arm_irn_ops
_if
=
{
static
const
arch_irn_ops_t
arm_irn_ops
=
{
arm_get_irn_reg_req
,
arm_set_irn_reg
,
arm_get_irn_reg
,
...
...
@@ -279,13 +279,6 @@ static const arch_irn_ops_if_t arm_irn_ops_if = {
NULL
,
/* perform_memory_operand */
};
arm_irn_ops_t
arm_irn_ops
=
{
&
arm_irn_ops_if
,
NULL
};
/**************************************************
* _ _ __
* | | (_)/ _|
...
...
@@ -618,8 +611,6 @@ static void *arm_cg_init(be_irg_t *birg) {
cur_reg_set
=
cg
->
reg_set
;
arm_irn_ops
.
cg
=
cg
;
/* enter the current code generator */
isa
->
cg
=
cg
;
...
...
@@ -797,7 +788,7 @@ static void *arm_init(FILE *file_handle) {
isa
->
cg
=
NULL
;
be_emit_init
(
file_handle
);
arm_create_opcodes
();
arm_create_opcodes
(
&
arm_irn_ops
);
arm_handle_intrinsics
();
/* we mark referenced global entities, so we can only emit those which
...
...
@@ -1088,16 +1079,6 @@ void arm_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi
}
}
static
const
void
*
arm_get_irn_ops
(
const
ir_node
*
irn
)
{
(
void
)
irn
;
return
&
arm_irn_ops
;
}
arch_get_irn_ops_t
*
arm_get_irn_handler
(
const
void
*
self
)
{
(
void
)
self
;
return
&
arm_get_irn_ops
;
}
int
arm_to_appear_in_schedule
(
void
*
block_env
,
const
ir_node
*
irn
)
{
(
void
)
block_env
;
if
(
!
is_arm_irn
(
irn
))
...
...
@@ -1268,7 +1249,6 @@ const arch_isa_if_t arm_isa_if = {
arm_get_reg_class
,
arm_get_reg_class_for_mode
,
arm_get_call_abi
,
arm_get_irn_handler
,
arm_get_code_generator_if
,
arm_get_list_sched_selector
,
arm_get_ilp_sched_selector
,
...
...
ir/be/arm/bearch_arm_t.h
View file @
be8b3b02
...
...
@@ -159,11 +159,4 @@ struct _arm_isa_t {
arm_code_gen_t
*
cg
;
/**< current code generator */
};
typedef
struct
_arm_irn_ops_t
{
const
arch_irn_ops_if_t
*
impl
;
arm_code_gen_t
*
cg
;
}
arm_irn_ops_t
;
#endif
ir/be/be_t.h
View file @
be8b3b02
...
...
@@ -79,12 +79,6 @@ struct be_options_t {
char
filtev
[
128
];
/**< filter mask for stat events (regex is supported) */
};
typedef
struct
{
arch_irn_ops_t
irn_ops
;
const
arch_env_t
*
arch_env
;
pmap
*
phi_attrs
;
}
phi_handler_t
;
struct
be_main_env_t
{
arch_env_t
arch_env
;
be_options_t
*
options
;
/**< backend options */
...
...
@@ -94,7 +88,6 @@ struct be_main_env_t {
ir_type
*
pic_trampolines_type
;
/**< Class type containing all trampolines */
pmap
*
ent_pic_symbol_map
;
ir_type
*
pic_symbols_type
;
phi_handler_t
phi_handler
;
};
/**
...
...
ir/be/bearch.c
View file @
be8b3b02
...
...
@@ -50,13 +50,6 @@ arch_env_t *arch_env_init(arch_env_t *env, const arch_isa_if_t *isa_if, FILE *fi
return
env
;
}
void
arch_env_set_irn_handler
(
arch_env_t
*
env
,
arch_get_irn_ops_t
*
handler
)
{
env
->
arch_handler
=
handler
;
}
static
const
arch_irn_ops_t
*
fallback_irn_ops
=
NULL
;
int
arch_register_class_put
(
const
arch_register_class_t
*
cls
,
bitset_t
*
bs
)
{
if
(
bs
)
{
...
...
@@ -77,13 +70,20 @@ int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs)
static
INLINE
const
arch_irn_ops_t
*
get_irn_ops
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
be_node_get_irn_ops
(
irn
);
const
ir_op
*
ops
;
const
arch_irn_ops_t
*
be_ops
;
(
void
)
env
;
if
(
is_Proj
(
irn
))
{
irn
=
get_Proj_pred
(
irn
);
assert
(
!
is_Proj
(
irn
));
}
if
(
ops
)
return
ops
;
ops
=
env
->
arch_handler
(
irn
);
ops
=
get_irn_op
(
irn
);
be_ops
=
get_op_ops
(
ops
)
->
be_ops
;
return
ops
!=
NULL
?
ops
:
fallback_irn_ops
;
assert
(
be_ops
);
return
be_ops
;
}
const
arch_irn_ops_t
*
arch_get_irn_ops
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
...
...
@@ -94,39 +94,39 @@ const arch_register_req_t *arch_get_register_req(const arch_env_t *env,
const
ir_node
*
irn
,
int
pos
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
return
ops
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
}
void
arch_set_frame_offset
(
const
arch_env_t
*
env
,
ir_node
*
irn
,
int
offset
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
ops
->
impl
->
set_frame_offset
(
ops
,
irn
,
offset
);
ops
->
set_frame_offset
(
ops
,
irn
,
offset
);
}
ir_entity
*
arch_get_frame_entity
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
get_frame_entity
(
ops
,
irn
);
return
ops
->
get_frame_entity
(
ops
,
irn
);
}
void
arch_set_frame_entity
(
const
arch_env_t
*
env
,
ir_node
*
irn
,
ir_entity
*
ent
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
ops
->
impl
->
set_frame_entity
(
ops
,
irn
,
ent
);
ops
->
set_frame_entity
(
ops
,
irn
,
ent
);
}
int
arch_get_sp_bias
(
const
arch_env_t
*
env
,
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
get_sp_bias
(
ops
,
irn
);
return
ops
->
get_sp_bias
(
ops
,
irn
);
}
arch_inverse_t
*
arch_get_inverse
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
,
int
i
,
arch_inverse_t
*
inverse
,
struct
obstack
*
obstack
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
if
(
ops
->
impl
->
get_inverse
)
{
return
ops
->
impl
->
get_inverse
(
ops
,
irn
,
i
,
inverse
,
obstack
);
if
(
ops
->
get_inverse
)
{
return
ops
->
get_inverse
(
ops
,
irn
,
i
,
inverse
,
obstack
);
}
else
{
return
NULL
;
}
...
...
@@ -135,8 +135,8 @@ arch_inverse_t *arch_get_inverse(const arch_env_t *env, const ir_node *irn, int
int
arch_possible_memory_operand
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
,
unsigned
int
i
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
if
(
ops
->
impl
->
possible_memory_operand
)
{
return
ops
->
impl
->
possible_memory_operand
(
ops
,
irn
,
i
);
if
(
ops
->
possible_memory_operand
)
{
return
ops
->
possible_memory_operand
(
ops
,
irn
,
i
);
}
else
{
return
0
;
}
...
...
@@ -145,8 +145,8 @@ int arch_possible_memory_operand(const arch_env_t *env, const ir_node *irn, unsi
void
arch_perform_memory_operand
(
const
arch_env_t
*
env
,
ir_node
*
irn
,
ir_node
*
spill
,
unsigned
int
i
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
if
(
ops
->
impl
->
perform_memory_operand
)
{
ops
->
impl
->
perform_memory_operand
(
ops
,
irn
,
spill
,
i
);
if
(
ops
->
perform_memory_operand
)
{
ops
->
perform_memory_operand
(
ops
,
irn
,
spill
,
i
);
}
else
{
return
;
}
...
...
@@ -156,8 +156,8 @@ int arch_get_op_estimated_cost(const arch_env_t *env, const ir_node *irn)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
if
(
ops
->
impl
->
get_op_estimated_cost
)
{
return
ops
->
impl
->
get_op_estimated_cost
(
ops
,
irn
);
if
(
ops
->
get_op_estimated_cost
)
{
return
ops
->
get_op_estimated_cost
(
ops
,
irn
);
}
else
{
return
1
;
}
...
...
@@ -167,8 +167,8 @@ int arch_is_possible_memory_operand(const arch_env_t *env, const ir_node *irn, i
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
if
(
ops
->
impl
->
possible_memory_operand
)
{
return
ops
->
impl
->
possible_memory_operand
(
ops
,
irn
,
i
);
if
(
ops
->
possible_memory_operand
)
{
return
ops
->
possible_memory_operand
(
ops
,
irn
,
i
);
}
else
{
return
0
;
}
...
...
@@ -177,7 +177,7 @@ int arch_is_possible_memory_operand(const arch_env_t *env, const ir_node *irn, i
int
arch_get_allocatable_regs
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
,
int
pos
,
bitset_t
*
bs
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
const
arch_register_req_t
*
req
=
ops
->
impl
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
const
arch_register_req_t
*
req
=
ops
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
if
(
req
->
type
==
arch_register_req_type_none
)
{
bitset_clear_all
(
bs
);
...
...
@@ -224,7 +224,7 @@ int arch_is_register_operand(const arch_env_t *env,
const
ir_node
*
irn
,
int
pos
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
const
arch_register_req_t
*
req
=
ops
->
impl
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
const
arch_register_req_t
*
req
=
ops
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
return
req
!=
NULL
;
}
...
...
@@ -251,7 +251,7 @@ const arch_register_class_t *
arch_get_irn_reg_class
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
,
int
pos
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
const
arch_register_req_t
*
req
=
ops
->
impl
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
const
arch_register_req_t
*
req
=
ops
->
get_irn_reg_req
(
ops
,
irn
,
pos
);
assert
(
req
->
type
!=
arch_register_req_type_none
||
req
->
cls
==
NULL
);
...
...
@@ -262,26 +262,26 @@ extern const arch_register_t *
arch_get_irn_register
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
get_irn_reg
(
ops
,
irn
);
return
ops
->
get_irn_reg
(
ops
,
irn
);
}
extern
void
arch_set_irn_register
(
const
arch_env_t
*
env
,
ir_node
*
irn
,
const
arch_register_t
*
reg
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
ops
->
impl
->
set_irn_reg
(
ops
,
irn
,
reg
);
ops
->
set_irn_reg
(
ops
,
irn
,
reg
);
}
extern
arch_irn_class_t
arch_irn_classify
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
classify
(
ops
,
irn
);
return
ops
->
classify
(
ops
,
irn
);
}
extern
arch_irn_flags_t
arch_irn_get_flags
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
)
{
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
return
ops
->
impl
->
get_flags
(
ops
,
irn
);
return
ops
->
get_flags
(
ops
,
irn
);
}
extern
const
char
*
arch_irn_flag_str
(
arch_irn_flags_t
fl
)
...
...
ir/be/bearch.h
View file @
be8b3b02
...
...
@@ -39,8 +39,6 @@ typedef struct arch_inverse_t arch_inverse_t;
typedef
struct
arch_isa_if_t
arch_isa_if_t
;
typedef
struct
arch_isa_t
arch_isa_t
;
typedef
struct
arch_env_t
arch_env_t
;
typedef
struct
arch_irn_ops_if_t
arch_irn_ops_if_t
;
typedef
struct
arch_irn_ops_t
arch_irn_ops_t
;
typedef
struct
arch_code_generator_t
arch_code_generator_t
;
typedef
struct
arch_code_generator_if_t
arch_code_generator_if_t
;
...
...
@@ -289,14 +287,6 @@ typedef const void *(arch_get_irn_ops_t)(const ir_node *irn);
extern
arch_env_t
*
arch_env_init
(
arch_env_t
*
env
,
const
arch_isa_if_t
*
isa
,
FILE
*
file_handle
,
be_main_env_t
*
main_env
);
/**
* Set the architectural node handler to the environment.
* @param env The environment.
* @param handler The node handler for the selected architecture.
* @return The environment itself.
*/
extern
void
arch_env_set_irn_handler
(
arch_env_t
*
env
,
arch_get_irn_ops_t
*
handler
);
/**
* Register an instruction set architecture
*/
...
...
ir/be/bearch_t.h
View file @
be8b3b02
...
...
@@ -179,7 +179,7 @@ struct arch_inverse_t {
ir_node
**
nodes
;
};
struct
arch_irn_ops_
if_
t
{
struct
arch_irn_ops_t
{
/**
* Get the register requirements for a given operand.
...
...
@@ -311,13 +311,6 @@ struct arch_irn_ops_if_t {
void
(
*
perform_memory_operand
)(
const
void
*
self
,
ir_node
*
irn
,
ir_node
*
spill
,
unsigned
int
i
);
};
/**
* irn_ops base class.
*/
struct
arch_irn_ops_t
{
const
arch_irn_ops_if_t
*
impl
;
};
/**
* The code generator interface.
*/
...
...
@@ -478,13 +471,6 @@ struct arch_isa_if_t {
*/
void
(
*
get_call_abi
)(
const
void
*
self
,
ir_type
*
call_type
,
be_abi_call_t
*
abi
);
/**
* The irn handler for this architecture.
* The irn handler is registered by the Firm back end
* when the architecture is initialized.
*/
arch_get_irn_ops_t
*
(
*
get_irn_handler
)(
const
void
*
self
);
/**
* Get the code generator interface.
* @param self The this pointer.
...
...
@@ -559,7 +545,6 @@ struct arch_isa_if_t {
#define arch_isa_get_n_reg_class(isa) ((isa)->impl->get_n_reg_class(isa))
#define arch_isa_get_reg_class(isa,i) ((isa)->impl->get_reg_class(isa, i))
#define arch_isa_get_irn_handler(isa) ((isa)->impl->get_irn_handler(isa))
#define arch_isa_get_call_abi(isa,tp,abi) ((isa)->impl->get_call_abi((isa), (tp), (abi)))
#define arch_isa_get_reg_class_for_mode(isa,mode) ((isa)->impl->get_reg_class_for_mode((isa), (mode)))
#define arch_isa_make_code_generator(isa,irg) ((isa)->impl->make_code_generator((isa), (irg)))
...
...
@@ -574,8 +559,6 @@ struct arch_isa_if_t {
*/
struct
arch_env_t
{
arch_isa_t
*
isa
;
/**< The isa about which everything is. */
arch_get_irn_ops_t
*
arch_handler
;
/**< The get_irn_ops handler for the selected architecture. */
};
/**
...
...
ir/be/begnuas.c
View file @
be8b3b02
...
...
@@ -223,26 +223,33 @@ static void dump_arith_tarval(tarval *tv, int bytes)
switch
(
bytes
)
{
case
1
:
be_emit_irprintf
(
"0x%02x"
,
get_tarval_sub_bits
(
tv
,
0
));
b
re
ak
;
re
turn
;
case
2
:
be_emit_irprintf
(
"0x%02x%02x"
,
get_tarval_sub_bits
(
tv
,
1
),
get_tarval_sub_bits
(
tv
,
0
));
b
re
ak
;
re
turn
;
case
4
:
be_emit_irprintf
(
"0x%02x%02x%02x%02x"
,
get_tarval_sub_bits
(
tv
,
3
),
get_tarval_sub_bits
(
tv
,
2
),
get_tarval_sub_bits
(
tv
,
1
),
get_tarval_sub_bits
(
tv
,
0
));
b
re
ak
;
re
turn
;
case
8
:
be_emit_irprintf
(
"0x%02x%02x%02x%02x%02x%02x%02x%02x"
,
get_tarval_sub_bits
(
tv
,
7
),
get_tarval_sub_bits
(
tv
,
6
),
get_tarval_sub_bits
(
tv
,
5
),
get_tarval_sub_bits
(
tv
,
4
),
get_tarval_sub_bits
(
tv
,
3
),
get_tarval_sub_bits
(
tv
,
2
),
get_tarval_sub_bits
(
tv
,
1
),
get_tarval_sub_bits
(
tv
,
0
));
b
re
ak
;
re
turn
;
case
10
:
case
12
:
break
;
be_emit_irprintf
(
"0x%02x%02x%02x%02x%02x%02x%02x%02x"
"%02x%02x%02x%02x"
,
get_tarval_sub_bits
(
tv
,
11
),
get_tarval_sub_bits
(
tv
,
10
),
get_tarval_sub_bits
(
tv
,
9
),
get_tarval_sub_bits
(
tv
,
8
),
get_tarval_sub_bits
(
tv
,
7
),
get_tarval_sub_bits
(
tv
,
6
),
get_tarval_sub_bits
(
tv
,
5
),
get_tarval_sub_bits
(
tv
,
4
),
get_tarval_sub_bits
(
tv
,
3
),
get_tarval_sub_bits
(
tv
,
2
),
get_tarval_sub_bits
(
tv
,
1
),
get_tarval_sub_bits
(
tv
,
0
));
return
;
case
16
:
be_emit_irprintf
(
"0x%02x%02x%02x%02x%02x%02x%02x%02x"
...
...
@@ -255,13 +262,10 @@ static void dump_arith_tarval(tarval *tv, int bytes)
get_tarval_sub_bits
(
tv
,
5
),
get_tarval_sub_bits
(
tv
,
4
),
get_tarval_sub_bits
(
tv
,
3
),
get_tarval_sub_bits
(
tv
,
2
),
get_tarval_sub_bits
(
tv
,
1
),
get_tarval_sub_bits
(
tv
,
0
));
break
;
default:
fprintf
(
stderr
,
"Try to dump an tarval with %d bytes
\n
"
,
bytes
);
assert
(
0
);
return
;
}
panic
(
"Can't dump a tarval with %d bytes
\n
"
,
bytes
);
}
/**
...
...
ir/be/bemain.c
View file @
be8b3b02
...
...
@@ -250,8 +250,6 @@ const backend_params *be_init(void)
*/
static
be_main_env_t
*
be_init_env
(
be_main_env_t
*
env
,
FILE
*
file_handle
)
{
arch_get_irn_ops_t
*
handler
;
memset
(
env
,
0
,
sizeof
(
*
env
));
env
->
options
=
&
be_options
;
env
->
ent_trampoline_map
=
pmap_create
();
...
...
@@ -265,10 +263,6 @@ static be_main_env_t *be_init_env(be_main_env_t *env, FILE *file_handle)
arch_env_init
(
&
env
->
arch_env
,
isa_if
,
file_handle
,
env
);
/* Register the irn handler of the architecture */
handler
=
arch_isa_get_irn_handler
(
env
->
arch_env
.
isa
);
arch_env_set_irn_handler
(
&
env
->
arch_env
,
handler
);
be_phi_handler_new
(
env
);
be_dbg_open
();
...
...
@@ -282,7 +276,7 @@ static void be_done_env(be_main_env_t *env)
{
env
->
arch_env
.
isa
->
impl
->
done
(
env
->
arch_env
.
isa
);
be_dbg_close
();
be_phi_handler_free
(
env
);
be_phi_handler_free
();
pmap_destroy
(
env
->
ent_trampoline_map
);
pmap_destroy
(
env
->
ent_pic_symbol_map
);
...
...
@@ -479,7 +473,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_sched_init_phase
(
irg
);
/* reset the phi handler. */
be_phi_handler_reset
(
&
env
);
be_phi_handler_reset
();
stat_ev_ctx_push_fobj
(
"bemain_irg"
,
irg
);
...
...
@@ -530,7 +524,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
stat_ev_ctx_pop
(
"bemain_phase"
);
/* reset the phi handler. */
be_phi_handler_reset
(
&
env
);
be_phi_handler_reset
();
be_do_stat_nodes
(
irg
,
"03 Prepare"
);
...
...
ir/be/benode.c
View file @
be8b3b02
...
...
@@ -64,11 +64,6 @@
#define get_irn_attr(irn) get_irn_generic_attr(irn)
#define get_irn_attr_const(irn) get_irn_generic_attr_const(irn)
static
unsigned
be_node_tag
=
FOURCC
(
'B'
,
'E'
,
'N'
,
'O'
);
/** The current phi handler */
static
const
phi_handler_t
*
curr_phi_handler
;
typedef
struct
{
arch_register_req_t
req
;
arch_irn_flags_t
flags
;
...
...
@@ -289,66 +284,6 @@ static INLINE arch_register_req_t *get_req(const ir_node *node, int pos)
return
&
bereq
->
req
;
}
void
be_node_init
(
void
)
{
static
int
inited
=
0
;
if
(
inited
)
return
;
inited
=
1
;
/* Acquire all needed opcodes. */
op_be_Spill
=
new_ir_op
(
beo_Spill
,
"be_Spill"
,
op_pin_state_pinned
,
N
,
oparity_unary
,
0
,
sizeof
(
be_frame_attr_t
),
&
be_node_op_ops
);
op_be_Reload
=
new_ir_op
(
beo_Reload
,
"be_Reload"
,
op_pin_state_pinned
,
N
,
oparity_zero
,
0
,
sizeof
(
be_frame_attr_t
),
&
be_node_op_ops
);
op_be_Perm
=
new_ir_op
(
beo_Perm
,
"be_Perm"
,
op_pin_state_pinned
,
N
,
oparity_variable
,
0
,
sizeof
(
be_node_attr_t
),
&
be_node_op_ops
);
op_be_MemPerm
=
new_ir_op
(
beo_MemPerm
,
"be_MemPerm"
,
op_pin_state_pinned
,
N
,
oparity_variable
,
0
,
sizeof
(
be_memperm_attr_t
),
&
be_node_op_ops
);
op_be_Copy
=
new_ir_op
(
beo_Copy
,
"be_Copy"
,
op_pin_state_floats
,
N
,
oparity_unary
,
0
,
sizeof
(
be_node_attr_t
),
&
be_node_op_ops
);
op_be_Keep
=
new_ir_op
(
beo_Keep
,
"be_Keep"
,
op_pin_state_pinned
,
K
,
oparity_dynamic
,
0
,
sizeof
(
be_node_attr_t
),
&
be_node_op_ops
);
op_be_CopyKeep
=
new_ir_op
(
beo_CopyKeep
,
"be_CopyKeep"
,
op_pin_state_pinned
,
K
,
oparity_variable
,
0
,
sizeof
(
be_node_attr_t
),
&
be_node_op_ops
);
op_be_Call
=
new_ir_op
(
beo_Call
,
"be_Call"
,
op_pin_state_pinned
,
F
|
M
,
oparity_variable
,
0
,
sizeof
(
be_call_attr_t
),
&
be_node_op_ops
);