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
e109f4dc
Commit
e109f4dc
authored
May 24, 2008
by
Michael Beck
Browse files
- no need to add two custom pointers: the tag is now simply a 32bit number, typically a FOURCC code
[r19748]
parent
2fa18a49
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/scripts/generate_new_opcodes.pl
View file @
e109f4dc
...
...
@@ -584,7 +584,7 @@ foreach my $op (keys(%nodes)) {
$temp
=
"
\t
op_
$op
= new_ir_op(cur_opcode + iro_
$op
,
\"
$op
\"
, op_pin_state_
"
.
$n
{"
state
"}
.
"
,
"
.
$n
{"
op_flags
"};
$temp
.=
"
|M,
"
.
translate_arity
(
$arity
)
.
"
, 0, sizeof(
${attr_type}
), &ops);
\n
";
push
(
@obst_new_irop
,
$temp
);
push
(
@obst_new_irop
,
"
\t
set_op_tag(op_
$op
,
&
$arch
\
_op_tag);
\n
");
push
(
@obst_new_irop
,
"
\t
set_op_tag(op_
$op
,
$arch
\
_op_tag);
\n
");
if
(
defined
(
$default_op_attr_type
))
{
push
(
@obst_new_irop
,
"
\t
attr = (
$default_op_attr_type
*) xmalloc(sizeof(attr[0]));
\n
");
push
(
@obst_new_irop
,
"
\t
memset(attr, 0, sizeof(attr[0]));
\n
");
...
...
@@ -645,7 +645,7 @@ if (length($arch) >= 4) {
print
OUT
<<ENDOFISIRN;
/** A tag for the $arch opcodes. Note that the address is used as a tag value, NOT the FOURCC code. */
static unsig
ne
d
$arch\_op_tag
=
FOURCC('$a', '$b', '$c', '$d')
;
#defi
ne $arch\_op_tag FOURCC('$a', '$b', '$c', '$d')
/** Return the opcode number of the first $arch opcode. */
int get_$arch\_opcode_first(void) {
...
...
@@ -659,7 +659,7 @@ int get_$arch\_opcode_last(void) {
/** Return 1 if the given opcode is a $arch machine op, 0 otherwise */
int is_$arch\_op(const ir_op *op) {
return get_op_tag(op) ==
&
$arch\_op_tag;
return get_op_tag(op) == $arch\_op_tag;
}
/** Return 1 if the given node is a $arch machine node, 0 otherwise */
...
...
ir/ir/irop_t.h
View file @
e109f4dc
...
...
@@ -158,11 +158,11 @@ static INLINE const ir_op_ops *_get_op_ops(const ir_op *op) {
return
&
op
->
ops
;
}
static
INLINE
void
_set_op_tag
(
ir_op
*
op
,
voi
d
*
tag
)
{
static
INLINE
void
_set_op_tag
(
ir_op
*
op
,
unsigne
d
tag
)
{
op
->
tag
=
tag
;
}
static
INLINE
voi
d
*
_get_op_tag
(
const
ir_op
*
op
)
{
static
INLINE
unsigne
d
_get_op_tag
(
const
ir_op
*
op
)
{
return
op
->
tag
;
}
...
...
ir/ir/irtypes.h
View file @
e109f4dc
...
...
@@ -56,7 +56,7 @@ struct ir_op {
op_arity
opar
;
/**< The arity of operator. */
int
op_index
;
/**< The index of the first data operand, 0 for most cases, 1 for Div etc. */
unsigned
flags
;
/**< Flags describing the behavior of the ir_op, a bitmasks of irop_flags. */
voi
d
*
tag
;
/**< Some custom
pointer
the op's creator
can attach stuff
to. */
unsigne
d
tag
;
/**< Some custom
TAG value
the op's creator
set
to. */
void
*
attr
;
/**< custom pointer where op's creator can attach attribute stuff to. */
ir_op_ops
ops
;
/**< The operations of the this op. */
...
...
Write
Preview
Markdown
is supported
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