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
082730d9
Commit
082730d9
authored
Oct 24, 2006
by
Christian Würdig
Browse files
added new attributes and get/set functions for allowed execution units
parent
70d388f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_new_nodes.c
View file @
082730d9
...
...
@@ -35,6 +35,7 @@
#include
"ia32_nodes_attr.h"
#include
"ia32_new_nodes.h"
#include
"gen_ia32_regalloc_if.h"
#include
"gen_ia32_machine.h"
/**
* Returns the ident of a SymConst.
...
...
@@ -1092,6 +1093,22 @@ arch_irn_flags_t get_ia32_out_flags(const ir_node *node, int pos) {
return
pos
<
(
int
)
attr
->
data
.
n_res
?
attr
->
out_flags
[
pos
]
:
arch_irn_flags_none
;
}
/**
* Set the number of available execution units for this node.
*/
void
set_ia32_n_exec_units
(
ir_node
*
node
,
unsigned
n
)
{
ia32_attr_t
*
attr
=
get_ia32_attr
(
node
);
attr
->
n_exec_units
=
n
;
}
/**
* Get the number of available execution units for this node.
*/
unsigned
get_ia32_n_exec_units
(
const
ir_node
*
node
)
{
ia32_attr_t
*
attr
=
get_ia32_attr
(
node
);
return
attr
->
n_exec_units
;
}
#ifndef NDEBUG
/**
...
...
@@ -1339,18 +1356,30 @@ const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos) {
* Initializes the nodes attributes.
*/
void
init_ia32_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
ia32_register_req_t
**
in_reqs
,
const
ia32_register_req_t
**
out_reqs
,
int
n_res
,
unsigned
latency
)
const
ia32_register_req_t
**
out_reqs
,
const
be_execution_unit_t
**
execution_units
,
int
n_res
,
unsigned
latency
)
{
ia32_attr_t
*
attr
=
get_ia32_attr
(
node
);
ia32_attr_t
*
attr
=
get_ia32_attr
(
node
);
unsigned
i
;
be_execution_unit_t
*
unit
;
set_ia32_flags
(
node
,
flags
);
set_ia32_in_req_all
(
node
,
in_reqs
);
set_ia32_out_req_all
(
node
,
out_reqs
);
set_ia32_latency
(
node
,
latency
);
set_ia32_n_res
(
node
,
n_res
);
if
(
execution_units
)
{
for
(
i
=
0
,
unit
=
execution_units
[
0
];
unit
;
unit
=
execution_units
[
++
i
])
/* do nothing but count number of given units */
;
set_ia32_n_exec_units
(
node
,
i
);
attr
->
exec_units
=
execution_units
;
}
/* else attr is already zero'ed out */
attr
->
out_flags
=
NEW_ARR_D
(
int
,
get_irg_obstack
(
get_irn_irg
(
node
)),
n_res
);
memset
(
attr
->
out_flags
,
0
,
n_res
*
sizeof
(
attr
->
out_flags
[
0
]));
attr
->
data
.
n_res
=
n_res
;
memset
((
void
*
)
attr
->
slots
,
0
,
n_res
*
sizeof
(
attr
->
slots
[
0
]));
}
...
...
ir/be/ia32/ia32_new_nodes.h
View file @
082730d9
...
...
@@ -9,6 +9,7 @@
#include
"firm_config.h"
#include
"ia32_nodes_attr.h"
#include
"gen_ia32_machine.h"
/***************************************************************************************************
* _ _ _ __ _ _ _ _
...
...
@@ -404,6 +405,16 @@ void set_ia32_out_flags(ir_node *node, arch_irn_flags_t flags, int pos);
*/
arch_irn_flags_t
get_ia32_out_flags
(
const
ir_node
*
node
,
int
pos
);
/**
* Set the number of available execution units for this node.
*/
void
set_ia32_n_exec_units
(
ir_node
*
node
,
unsigned
n
);
/**
* Get the number of available execution units for this node.
*/
unsigned
get_ia32_n_exec_units
(
const
ir_node
*
node
);
#ifndef NDEBUG
/**
...
...
@@ -499,7 +510,7 @@ int is_ia32_Cnst(const ir_node *node);
* Initializes the nodes attributes.
*/
void
init_ia32_attributes
(
ir_node
*
node
,
arch_irn_flags_t
flags
,
const
ia32_register_req_t
**
in_reqs
,
\
const
ia32_register_req_t
**
out_reqs
,
int
n_res
,
unsigned
latency
);
const
ia32_register_req_t
**
out_reqs
,
const
be_execution_unit_t
**
execution_units
,
int
n_res
,
unsigned
latency
);
/* Include the generated headers */
#include
"gen_ia32_new_nodes.h"
...
...
ir/be/ia32/ia32_nodes_attr.h
View file @
082730d9
...
...
@@ -13,6 +13,7 @@
#include
"firm_types.h"
#include
"../bearch.h"
#include
"../bemachine.h"
typedef
enum
{
flavour_Div
=
1
,
flavour_Mod
,
flavour_DivMod
}
ia32_op_flavour_t
;
typedef
enum
{
pn_EAX
,
pn_EDX
}
pn_ia32_Register
;
...
...
@@ -128,6 +129,9 @@ typedef struct _ia32_attr_t {
const
char
*
orig_node
;
/**< holds the name of the original ir node for debugging purposes */
#endif
/* NDEBUG */
const
be_execution_unit_t
**
exec_units
;
/**< NULL terminated list of units this operation can be executed on */
unsigned
n_exec_units
;
/**< the number of available execution units for this operation */
const
ia32_register_req_t
**
in_req
;
/**< register requirements for arguments */
const
ia32_register_req_t
**
out_req
;
/**< register requirements for results */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment