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
044ec2b3
Commit
044ec2b3
authored
Aug 19, 2010
by
Matthias Braun
Browse files
sparc: no need for is_load_store attribute anymore
[r27949]
parent
2e451cd6
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/be/sparc/bearch_sparc.c
View file @
044ec2b3
...
...
@@ -74,14 +74,12 @@ static arch_irn_class_t sparc_classify(const ir_node *irn)
static
ir_entity
*
sparc_get_frame_entity
(
const
ir_node
*
irn
)
{
const
sparc_attr_t
*
attr
=
get_sparc_attr_const
(
irn
);
if
(
is_sparc_FrameAddr
(
irn
))
{
const
sparc_symconst_attr_t
*
attr
=
get_irn_generic_attr_const
(
irn
);
return
attr
->
entity
;
}
if
(
attr
->
i
s_load_store
)
{
if
(
sparc_ha
s_load_store
_attr
(
irn
)
)
{
const
sparc_load_store_attr_t
*
load_store_attr
=
get_sparc_load_store_attr_const
(
irn
);
if
(
load_store_attr
->
is_frame_entity
)
{
return
load_store_attr
->
entity
;
...
...
@@ -102,7 +100,7 @@ static void sparc_set_frame_offset(ir_node *irn, int offset)
attr
->
fp_offset
+=
offset
;
}
else
{
sparc_load_store_attr_t
*
attr
=
get_sparc_load_store_attr
(
irn
);
assert
(
attr
->
base
.
i
s_load_store
);
assert
(
sparc_ha
s_load_store
_attr
(
irn
)
);
attr
->
offset
+=
offset
;
}
}
...
...
ir/be/sparc/sparc_new_nodes.c
View file @
044ec2b3
...
...
@@ -49,7 +49,7 @@ static bool has_symconst_attr(const ir_node *node)
return
is_sparc_SymConst
(
node
)
||
is_sparc_FrameAddr
(
node
);
}
static
bool
has_load_store_attr
(
const
ir_node
*
node
)
bool
sparc_
has_load_store_attr
(
const
ir_node
*
node
)
{
return
is_sparc_Ld
(
node
)
||
is_sparc_St
(
node
)
||
is_sparc_Ldf
(
node
)
||
is_sparc_Stf
(
node
);
...
...
@@ -110,7 +110,7 @@ static void sparc_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
ir_fprintf
(
F
,
"entity: %+F
\n
"
,
attr
->
entity
);
fprintf
(
F
,
"fp_offset: %d
\n
"
,
attr
->
fp_offset
);
}
if
(
has_load_store_attr
(
n
))
{
if
(
sparc_
has_load_store_attr
(
n
))
{
const
sparc_load_store_attr_t
*
attr
=
get_sparc_load_store_attr_const
(
n
);
ir_fprintf
(
F
,
"load store mode: %+F
\n
"
,
attr
->
load_store_mode
);
ir_fprintf
(
F
,
"entity: (sign %d) %+F
\n
"
,
attr
->
entity_sign
,
...
...
@@ -200,13 +200,13 @@ const sparc_attr_t *get_sparc_attr_const(const ir_node *node)
sparc_load_store_attr_t
*
get_sparc_load_store_attr
(
ir_node
*
node
)
{
assert
(
has_load_store_attr
(
node
));
assert
(
sparc_
has_load_store_attr
(
node
));
return
(
sparc_load_store_attr_t
*
)
get_irn_generic_attr_const
(
node
);
}
const
sparc_load_store_attr_t
*
get_sparc_load_store_attr_const
(
const
ir_node
*
node
)
{
assert
(
has_load_store_attr
(
node
));
assert
(
sparc_
has_load_store_attr
(
node
));
return
(
const
sparc_load_store_attr_t
*
)
get_irn_generic_attr_const
(
node
);
}
...
...
@@ -330,8 +330,7 @@ static void init_sparc_attributes(ir_node *node, arch_irn_flags_t flags,
(
void
)
execution_units
;
arch_irn_set_flags
(
node
,
flags
);
attr
->
in_req
=
in_reqs
;
attr
->
is_load_store
=
false
;
attr
->
in_req
=
in_reqs
;
info
=
be_get_info
(
node
);
info
->
out_infos
=
NEW_ARR_D
(
reg_out_info_t
,
obst
,
n_res
);
...
...
@@ -349,7 +348,6 @@ static void init_sparc_load_store_attributes(ir_node *res, ir_mode *ls_mode,
attr
->
entity_sign
=
entity_sign
;
attr
->
is_frame_entity
=
is_frame_entity
;
attr
->
offset
=
offset
;
attr
->
base
.
is_load_store
=
true
;
}
static
void
init_sparc_symconst_attributes
(
ir_node
*
res
,
ir_entity
*
entity
)
...
...
@@ -407,7 +405,7 @@ static int cmp_attr_sparc(ir_node *a, ir_node *b)
const
sparc_attr_t
*
attr_b
=
get_sparc_attr_const
(
b
);
return
attr_a
->
immediate_value
!=
attr_b
->
immediate_value
||
attr_a
->
i
s_load_store
!=
attr_b
->
is_load_store
;
||
attr_a
->
i
mmediate_value_entity
!=
attr_b
->
immediate_value_entity
;
}
static
int
cmp_attr_sparc_load_store
(
ir_node
*
a
,
ir_node
*
b
)
...
...
ir/be/sparc/sparc_new_nodes.h
View file @
044ec2b3
...
...
@@ -25,6 +25,7 @@
#ifndef FIRM_BE_SPARC_SPARC_NEW_NODES_H
#define FIRM_BE_SPARC_SPARC_NEW_NODES_H
#include
<stdbool.h>
#include
"sparc_nodes_attr.h"
/**
...
...
@@ -33,6 +34,7 @@
sparc_attr_t
*
get_sparc_attr
(
ir_node
*
node
);
const
sparc_attr_t
*
get_sparc_attr_const
(
const
ir_node
*
node
);
bool
sparc_has_load_store_attr
(
const
ir_node
*
node
);
sparc_load_store_attr_t
*
get_sparc_load_store_attr
(
ir_node
*
node
);
const
sparc_load_store_attr_t
*
get_sparc_load_store_attr_const
(
const
ir_node
*
node
);
...
...
ir/be/sparc/sparc_nodes_attr.h
View file @
044ec2b3
...
...
@@ -38,8 +38,6 @@ struct sparc_attr_t
except_attr
exc
;
/**< the exception attribute. MUST be the first one. */
const
arch_register_req_t
**
in_req
;
/**< register requirements for arguments */
int32_t
immediate_value
;
/* immediate values */
bool
is_load_store
;
ir_entity
*
immediate_value_entity
;
/* hack for now */
};
...
...
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