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
556ee881
Commit
556ee881
authored
Jan 26, 2014
by
Christoph Mallon
Browse files
Rename several symconst to address/callee/entity.
parent
25887e20
Changes
33
Hide whitespace changes
Inline
Side-by-side
ir/be/amd64/amd64_emitter.c
View file @
556ee881
...
...
@@ -184,11 +184,12 @@ ENUM_BITSET(amd64_emit_mod_t)
static
void
amd64_emit_immediate
(
const
amd64_movimm_attr_t
*
const
imm
)
{
if
(
imm
->
symconst
!=
NULL
)
{
be_gas_emit_entity
(
imm
->
symconst
);
ir_entity
*
entity
=
imm
->
entity
;
if
(
entity
!=
NULL
)
{
be_gas_emit_entity
(
entity
);
}
if
(
imm
->
symconst
==
NULL
||
imm
->
offset
!=
0
)
{
if
(
imm
->
symconst
!=
NULL
)
{
if
(
entity
==
NULL
||
imm
->
offset
!=
0
)
{
if
(
entity
!=
NULL
)
{
be_emit_irprintf
(
"%+ld"
,
imm
->
offset
);
}
else
{
be_emit_irprintf
(
"0x%lX"
,
imm
->
offset
);
...
...
@@ -199,7 +200,7 @@ static void amd64_emit_immediate(const amd64_movimm_attr_t *const imm)
static
void
amd64_emit_am
(
const
ir_node
*
const
node
,
const
amd64_am_info_t
*
const
am
)
{
ir_entity
*
entity
=
am
->
symconst
;
ir_entity
*
entity
=
am
->
entity
;
if
(
entity
!=
NULL
)
{
ir_type
*
owner
=
get_entity_owner
(
entity
);
if
(
is_frame_type
(
owner
))
{
...
...
ir/be/amd64/amd64_new_nodes.c
View file @
556ee881
...
...
@@ -161,18 +161,18 @@ static void init_amd64_cc_attributes(ir_node *node, x86_condition_code_t cc)
attr
->
cc
=
cc
;
}
static
void
init_amd64_movimm_attributes
(
ir_node
*
node
,
ir_entity
*
symconst
,
static
void
init_amd64_movimm_attributes
(
ir_node
*
node
,
ir_entity
*
entity
,
int64_t
offset
)
{
amd64_movimm_attr_t
*
attr
=
get_amd64_movimm_attr
(
node
);
attr
->
symconst
=
symconst
;
attr
->
offset
=
offset
;
attr
->
entity
=
entity
;
attr
->
offset
=
offset
;
}
static
int
cmp_am
(
const
amd64_am_info_t
*
const
am0
,
const
amd64_am_info_t
*
const
am1
)
{
return
am0
->
offset
!=
am1
->
offset
||
am0
->
symconst
!=
am1
->
symconst
return
am0
->
offset
!=
am1
->
offset
||
am0
->
entity
!=
am1
->
entity
||
am0
->
base_input
!=
am1
->
base_input
||
am0
->
index_input
!=
am1
->
index_input
||
am0
->
log_scale
!=
am1
->
log_scale
...
...
@@ -197,7 +197,7 @@ static int cmp_amd64_movimm_attr(const ir_node *const a,
return
true
;
const
amd64_movimm_attr_t
*
const
attr_a
=
get_amd64_movimm_attr_const
(
a
);
const
amd64_movimm_attr_t
*
const
attr_b
=
get_amd64_movimm_attr_const
(
b
);
return
attr_a
->
symconst
!=
attr_b
->
symconst
return
attr_a
->
entity
!=
attr_b
->
entity
||
attr_a
->
offset
!=
attr_b
->
offset
;
}
...
...
ir/be/amd64/amd64_nodes_attr.h
View file @
556ee881
...
...
@@ -45,7 +45,7 @@ enum {
typedef
struct
amd64_am_info_t
{
int64_t
offset
;
ir_entity
*
symconst
;
ir_entity
*
entity
;
uint8_t
base_input
;
uint8_t
index_input
;
unsigned
log_scale
:
2
;
/* 0, 1, 2, 3 (giving scale 1, 2, 4, 8) */
...
...
@@ -68,7 +68,7 @@ struct amd64_movimm_attr_t
{
amd64_attr_t
base
;
int64_t
offset
;
ir_entity
*
symconst
;
ir_entity
*
entity
;
};
struct
amd64_cc_attr_t
...
...
ir/be/amd64/amd64_spec.pl
View file @
556ee881
...
...
@@ -55,7 +55,7 @@ $default_copy_attr = "amd64_copy_attr";
.
"
\t
init_amd64_cc_attributes(res, cc);
",
amd64_movimm_attr_t
=>
"
\t
init_amd64_attributes(res, irn_flags_, in_reqs, n_res);
"
.
"
\t
init_amd64_movimm_attributes(res,
symconst
, offset);
",
.
"
\t
init_amd64_movimm_attributes(res,
entity
, offset);
",
);
%compare_attr
=
(
...
...
@@ -271,7 +271,7 @@ Xor0 => {
Const
=>
{
op_flags
=>
[
"
constlike
"
],
attr
=>
"
amd64_insn_mode_t insn_mode, int64_t offset, ir_entity *
symconst
",
attr
=>
"
amd64_insn_mode_t insn_mode, int64_t offset, ir_entity *
entity
",
init_attr
=>
"
attr->base.data.insn_mode = insn_mode;
\n
",
attr_type
=>
"
amd64_movimm_attr_t
",
reg_req
=>
{
out
=>
[
"
gp
"
]
},
...
...
ir/be/amd64/amd64_transform.c
View file @
556ee881
...
...
@@ -168,13 +168,13 @@ static ir_node *gen_SymConst(ir_node *node)
am
.
base_input
=
RIP_INPUT
;
am
.
index_input
=
NO_INPUT
;
if
(
mode
==
REFERENCE_IP_RELATIVE
)
{
am
.
symconst
=
entity
;
am
.
entity
=
entity
;
ir_node
*
lea
=
new_bd_amd64_Lea
(
dbgi
,
block
,
0
,
NULL
,
INSN_MODE_64
,
am
);
return
lea
;
}
else
{
assert
(
mode
==
REFERENCE_GOT
);
am
.
symconst
=
new_got_entry_entity
(
entity
);
am
.
entity
=
new_got_entry_entity
(
entity
);
ir_graph
*
irg
=
get_irn_irg
(
node
);
ir_node
*
in
[]
=
{
get_irg_no_mem
(
irg
)
};
ir_node
*
load
...
...
@@ -342,7 +342,7 @@ static ir_node *gen_Sel(ir_node *const node)
memset
(
&
am
,
0
,
sizeof
(
am
));
am
.
base_input
=
0
;
am
.
index_input
=
NO_INPUT
;
am
.
symconst
=
get_Sel_entity
(
node
);
am
.
entity
=
get_Sel_entity
(
node
);
ir_node
*
in
[]
=
{
base
};
ir_node
*
res
=
new_bd_amd64_Lea
(
dbgi
,
new_block
,
ARRAY_SIZE
(
in
),
in
,
INSN_MODE_64
,
am
);
...
...
@@ -795,7 +795,7 @@ static ir_node *gen_Proj_Proj_Start(ir_node *node)
memset
(
&
am
,
0
,
sizeof
(
am
));
am
.
base_input
=
0
;
am
.
index_input
=
NO_INPUT
;
am
.
symconst
=
param
->
entity
;
am
.
entity
=
param
->
entity
;
ir_node
*
in
[]
=
{
base
,
mem
};
ir_node
*
load
;
ir_node
*
value
;
...
...
ir/be/amd64/bearch_amd64.c
View file @
556ee881
...
...
@@ -51,7 +51,7 @@ static ir_entity *amd64_get_frame_entity(const ir_node *node)
const
amd64_attr_t
*
attr
=
get_amd64_attr_const
(
node
);
if
(
!
attr
->
data
.
has_am_info
)
return
NULL
;
ir_entity
*
entity
=
attr
->
am
.
symconst
;
ir_entity
*
entity
=
attr
->
am
.
entity
;
if
(
entity
==
NULL
)
return
NULL
;
ir_type
*
parent
=
get_entity_owner
(
entity
);
...
...
@@ -167,7 +167,7 @@ static ir_node *create_push(ir_node *node, ir_node *schedpoint, ir_node *sp,
memset
(
&
am
,
0
,
sizeof
(
am
));
am
.
base_input
=
0
;
am
.
index_input
=
NO_INPUT
;
am
.
symconst
=
ent
;
am
.
entity
=
ent
;
ir_node
*
in
[]
=
{
sp
,
frame
,
mem
};
ir_node
*
push
=
new_bd_amd64_PushAM
(
dbgi
,
block
,
ARRAY_SIZE
(
in
),
in
,
INSN_MODE_64
,
am
);
...
...
@@ -187,7 +187,7 @@ static ir_node *create_pop(ir_node *node, ir_node *schedpoint, ir_node *sp, ir_e
memset
(
&
am
,
0
,
sizeof
(
am
));
am
.
base_input
=
0
;
am
.
index_input
=
NO_INPUT
;
am
.
symconst
=
ent
;
am
.
entity
=
ent
;
ir_node
*
in
[]
=
{
sp
,
frame
,
get_irg_no_mem
(
irg
)
};
ir_node
*
pop
=
new_bd_amd64_PopAM
(
dbgi
,
block
,
ARRAY_SIZE
(
in
),
in
,
...
...
@@ -298,7 +298,7 @@ static void amd64_set_frame_entity(ir_node *node, ir_entity *entity)
assert
(
is_amd64_Store
(
node
)
||
is_amd64_LoadZ
(
node
)
||
is_amd64_LoadS
(
node
));
amd64_attr_t
*
attr
=
get_amd64_attr
(
node
);
attr
->
am
.
symconst
=
entity
;
attr
->
am
.
entity
=
entity
;
}
/**
...
...
ir/be/arm/arm_emitter.c
View file @
556ee881
...
...
@@ -41,7 +41,7 @@
DEBUG_ONLY
(
static
firm_dbg_module_t
*
dbg
=
NULL
;)
static
set
*
sym
_or_tv
;
static
set
*
ent
_or_tv
;
static
arm_isa_t
*
isa
;
static
void
arm_emit_register
(
const
arch_register_t
*
reg
)
...
...
@@ -96,10 +96,10 @@ static void arm_emit_float_arithmetic_mode(const ir_node *node)
arm_emit_fpa_postfix
(
attr
->
mode
);
}
static
void
arm_emit_
symconst
(
const
ir_node
*
node
)
static
void
arm_emit_
address
(
const
ir_node
*
node
)
{
const
arm_
SymConst
_attr_t
*
symconst
=
get_arm_
SymConst
_attr_const
(
node
);
ir_entity
*
entity
=
symconst
->
entity
;
const
arm_
Address
_attr_t
*
address
=
get_arm_
Address
_attr_const
(
node
);
ir_entity
*
entity
=
address
->
entity
;
be_gas_emit_entity
(
entity
);
...
...
@@ -207,8 +207,8 @@ static void arm_emit_shifter_operand(const ir_node *node)
panic
(
"Invalid shift_modifier while emitting %+F"
,
node
);
}
/** An entry in the
sym
_or_tv set. */
typedef
struct
sym
_or_tv_t
{
/** An entry in the
ent
_or_tv set. */
typedef
struct
ent
_or_tv_t
{
union
{
ir_entity
*
entity
;
/**< An entity. */
ir_tarval
*
tv
;
/**< A tarval. */
...
...
@@ -216,7 +216,7 @@ typedef struct sym_or_tv_t {
}
u
;
unsigned
label
;
/**< the associated label. */
bool
is_entity
;
/**< true if an entity is stored. */
}
sym
_or_tv_t
;
}
ent
_or_tv_t
;
/**
* Returns a unique label. This number will not be used a second time.
...
...
@@ -227,7 +227,7 @@ static unsigned get_unique_label(void)
return
++
id
;
}
static
void
emit_constant_name
(
const
sym
_or_tv_t
*
entry
)
static
void
emit_constant_name
(
const
ent
_or_tv_t
*
entry
)
{
be_emit_irprintf
(
"%sC%u"
,
be_gas_get_private_prefix
(),
entry
->
label
);
}
...
...
@@ -296,7 +296,7 @@ void arm_emitf(const ir_node *node, const char *format, ...)
}
case
'I'
:
arm_emit_
symconst
(
node
);
arm_emit_
address
(
node
);
break
;
case
'o'
:
...
...
@@ -308,7 +308,7 @@ void arm_emitf(const ir_node *node, const char *format, ...)
break
;
case
'C'
:
{
const
sym
_or_tv_t
*
name
=
va_arg
(
ap
,
const
sym
_or_tv_t
*
);
const
ent
_or_tv_t
*
name
=
va_arg
(
ap
,
const
ent
_or_tv_t
*
);
emit_constant_name
(
name
);
break
;
}
...
...
@@ -377,17 +377,17 @@ unknown:
}
/**
* Emit a
SymConst
.
* Emit a
n Address
.
*/
static
void
emit_arm_
SymConst
(
const
ir_node
*
irn
)
static
void
emit_arm_
Address
(
const
ir_node
*
irn
)
{
const
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr_const
(
irn
);
sym
_or_tv_t
key
,
*
entry
;
const
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr_const
(
irn
);
ent
_or_tv_t
key
,
*
entry
;
key
.
u
.
entity
=
attr
->
entity
;
key
.
is_entity
=
true
;
key
.
label
=
0
;
entry
=
set_insert
(
sym
_or_tv_t
,
sym
_or_tv
,
&
key
,
sizeof
(
key
),
hash_ptr
(
key
.
u
.
generic
));
entry
=
set_insert
(
ent
_or_tv_t
,
ent
_or_tv
,
&
key
,
sizeof
(
key
),
hash_ptr
(
key
.
u
.
generic
));
if
(
entry
->
label
==
0
)
{
/* allocate a label */
entry
->
label
=
get_unique_label
();
...
...
@@ -399,7 +399,7 @@ static void emit_arm_SymConst(const ir_node *irn)
static
void
emit_arm_FrameAddr
(
const
ir_node
*
irn
)
{
const
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr_const
(
irn
);
const
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr_const
(
irn
);
arm_emitf
(
irn
,
"add %D0, %S0, #0x%X"
,
attr
->
fp_offset
);
}
...
...
@@ -408,12 +408,12 @@ static void emit_arm_FrameAddr(const ir_node *irn)
*/
static
void
emit_arm_fConst
(
const
ir_node
*
irn
)
{
sym
_or_tv_t
key
;
ent
_or_tv_t
key
;
key
.
u
.
tv
=
get_fConst_value
(
irn
);
key
.
is_entity
=
false
;
key
.
label
=
0
;
sym
_or_tv_t
*
entry
=
set_insert
(
sym
_or_tv_t
,
sym
_or_tv
,
&
key
,
sizeof
(
key
),
hash_ptr
(
key
.
u
.
generic
));
ent
_or_tv_t
*
entry
=
set_insert
(
ent
_or_tv_t
,
ent
_or_tv
,
&
key
,
sizeof
(
key
),
hash_ptr
(
key
.
u
.
generic
));
if
(
entry
->
label
==
0
)
{
/* allocate a label */
entry
->
label
=
get_unique_label
();
...
...
@@ -719,7 +719,7 @@ static void arm_register_emitters(void)
be_set_emitter
(
op_arm_FrameAddr
,
emit_arm_FrameAddr
);
be_set_emitter
(
op_arm_Jmp
,
emit_arm_Jmp
);
be_set_emitter
(
op_arm_SwitchJmp
,
emit_arm_SwitchJmp
);
be_set_emitter
(
op_arm_
SymConst
,
emit_arm_
SymConst
);
be_set_emitter
(
op_arm_
Address
,
emit_arm_
Address
);
be_set_emitter
(
op_arm_fConst
,
emit_arm_fConst
);
be_set_emitter
(
op_be_Copy
,
emit_be_Copy
);
be_set_emitter
(
op_be_CopyKeep
,
emit_be_Copy
);
...
...
@@ -789,12 +789,12 @@ static void arm_gen_labels(ir_node *block, void *env)
}
/**
* Compare two entries of the
symbol
or tarval set.
* Compare two entries of the
entity
or tarval set.
*/
static
int
cmp_
sym
_or_tv
(
const
void
*
elt
,
const
void
*
key
,
size_t
size
)
static
int
cmp_
ent
_or_tv
(
const
void
*
elt
,
const
void
*
key
,
size_t
size
)
{
const
sym
_or_tv_t
*
p1
=
(
const
sym
_or_tv_t
*
)
elt
;
const
sym
_or_tv_t
*
p2
=
(
const
sym
_or_tv_t
*
)
key
;
const
ent
_or_tv_t
*
p1
=
(
const
ent
_or_tv_t
*
)
elt
;
const
ent
_or_tv_t
*
p2
=
(
const
ent
_or_tv_t
*
)
key
;
(
void
)
size
;
/* as an identifier NEVER can point to a tarval, it's enough
...
...
@@ -811,7 +811,7 @@ void arm_emit_function(ir_graph *irg)
size_t
i
,
n
;
isa
=
(
arm_isa_t
*
)
arch_env
;
sym
_or_tv
=
new_set
(
cmp_
sym
_or_tv
,
8
);
ent
_or_tv
=
new_set
(
cmp_
ent
_or_tv
,
8
);
be_gas_elf_type_char
=
'%'
;
...
...
@@ -838,11 +838,11 @@ void arm_emit_function(ir_graph *irg)
last_block
=
block
;
}
/* emit
SymConst
values */
if
(
set_count
(
sym
_or_tv
)
>
0
)
{
/* emit
entity and tarval
values */
if
(
set_count
(
ent
_or_tv
)
>
0
)
{
be_emit_cstring
(
"
\t
.align 2
\n
"
);
foreach_set
(
sym
_or_tv
,
sym
_or_tv_t
,
entry
)
{
foreach_set
(
ent
_or_tv
,
ent
_or_tv_t
,
entry
)
{
emit_constant_name
(
entry
);
be_emit_cstring
(
":
\n
"
);
be_emit_write_line
();
...
...
@@ -873,7 +873,7 @@ void arm_emit_function(ir_graph *irg)
be_emit_char
(
'\n'
);
be_emit_write_line
();
}
del_set
(
sym
_or_tv
);
del_set
(
ent
_or_tv
);
be_gas_emit_function_epilog
(
entity
);
}
...
...
ir/be/arm/arm_emitter.h
View file @
556ee881
...
...
@@ -30,9 +30,9 @@
* %Sx <node> source register x
* %Dx <node> destination register x
* %O <node> shifter operand
* %I <node>
symconst
immediate
* %I <node>
address
immediate
* %o <node> load/store offset
* %C const
sym
_or_tv_t* constant
* %C const
ent
_or_tv_t* constant
* %t const ir_node* controlflow target
* %m ir_mode* fpa mode postfix
* %s const char* string
...
...
ir/be/arm/arm_new_nodes.c
View file @
556ee881
...
...
@@ -31,9 +31,9 @@
#include "beabi.h"
static
bool
arm_has_
symconst
_attr
(
const
ir_node
*
node
)
static
bool
arm_has_
address
_attr
(
const
ir_node
*
node
)
{
return
is_arm_
SymConst
(
node
)
||
is_arm_FrameAddr
(
node
)
||
is_arm_Bl
(
node
);
return
is_arm_
Address
(
node
)
||
is_arm_FrameAddr
(
node
)
||
is_arm_Bl
(
node
);
}
static
bool
has_load_store_attr
(
const
ir_node
*
node
)
...
...
@@ -73,8 +73,8 @@ static void arm_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
case
dump_node_opcode_txt
:
fprintf
(
F
,
"%s"
,
get_irn_opname
(
n
));
if
(
arm_has_
symconst
_attr
(
n
))
{
const
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr_const
(
n
);
if
(
arm_has_
address
_attr
(
n
))
{
const
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr_const
(
n
);
if
(
attr
->
entity
!=
NULL
)
{
fputc
(
' '
,
F
);
fputs
(
get_entity_name
(
attr
->
entity
),
F
);
...
...
@@ -158,8 +158,8 @@ static void arm_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
}
fputc
(
'\n'
,
F
);
}
if
(
arm_has_
symconst
_attr
(
n
))
{
const
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr_const
(
n
);
if
(
arm_has_
address
_attr
(
n
))
{
const
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr_const
(
n
);
fprintf
(
F
,
"entity = "
);
if
(
attr
->
entity
!=
NULL
)
{
...
...
@@ -190,23 +190,16 @@ const arm_attr_t *get_arm_attr_const(const ir_node *node)
return
(
const
arm_attr_t
*
)
get_irn_generic_attr_const
(
node
);
}
#ifndef NDEBUG
static
bool
has_symconst_attr
(
const
ir_node
*
node
)
arm_Address_attr_t
*
get_arm_Address_attr
(
ir_node
*
node
)
{
return
is_arm_SymConst
(
node
)
||
is_arm_FrameAddr
(
node
)
||
is_arm_Bl
(
node
);
assert
(
arm_has_address_attr
(
node
));
return
(
arm_Address_attr_t
*
)
get_irn_generic_attr
(
node
);
}
#endif
arm_SymConst_attr_t
*
get_arm_SymConst_attr
(
ir_node
*
node
)
const
arm_Address_attr_t
*
get_arm_Address_attr_const
(
const
ir_node
*
node
)
{
assert
(
has_symconst_attr
(
node
));
return
(
arm_SymConst_attr_t
*
)
get_irn_generic_attr
(
node
);
}
const
arm_SymConst_attr_t
*
get_arm_SymConst_attr_const
(
const
ir_node
*
node
)
{
assert
(
has_symconst_attr
(
node
));
return
(
const
arm_SymConst_attr_t
*
)
get_irn_generic_attr_const
(
node
);
assert
(
arm_has_address_attr
(
node
));
return
(
const
arm_Address_attr_t
*
)
get_irn_generic_attr_const
(
node
);
}
static
const
arm_fConst_attr_t
*
get_arm_fConst_attr_const
(
const
ir_node
*
node
)
...
...
@@ -342,12 +335,11 @@ static void init_arm_cmp_attr(ir_node *res, bool ins_permuted, bool is_unsigned)
attr
->
is_unsigned
=
is_unsigned
;
}
static
void
init_arm_SymConst_attributes
(
ir_node
*
res
,
ir_entity
*
entity
,
int
symconst_offset
)
static
void
init_arm_Address_attributes
(
ir_node
*
res
,
ir_entity
*
entity
,
int
offset
)
{
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr
(
res
);
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr
(
res
);
attr
->
entity
=
entity
;
attr
->
fp_offset
=
symconst_
offset
;
attr
->
fp_offset
=
offset
;
}
static
void
init_arm_farith_attributes
(
ir_node
*
res
,
ir_mode
*
mode
)
...
...
@@ -380,16 +372,16 @@ static int cmp_attr_arm(const ir_node *a, const ir_node *b)
return
0
;
}
static
int
cmp_attr_arm_
SymConst
(
const
ir_node
*
a
,
const
ir_node
*
b
)
static
int
cmp_attr_arm_
Address
(
const
ir_node
*
a
,
const
ir_node
*
b
)
{
const
arm_
SymConst
_attr_t
*
attr_a
;
const
arm_
SymConst
_attr_t
*
attr_b
;
const
arm_
Address
_attr_t
*
attr_a
;
const
arm_
Address
_attr_t
*
attr_b
;
if
(
cmp_attr_arm
(
a
,
b
))
return
1
;
attr_a
=
get_arm_
SymConst
_attr_const
(
a
);
attr_b
=
get_arm_
SymConst
_attr_const
(
b
);
attr_a
=
get_arm_
Address
_attr_const
(
a
);
attr_b
=
get_arm_
Address
_attr_const
(
b
);
return
attr_a
->
entity
!=
attr_b
->
entity
||
attr_a
->
fp_offset
!=
attr_b
->
fp_offset
;
}
...
...
ir/be/arm/arm_new_nodes.h
View file @
556ee881
...
...
@@ -20,10 +20,10 @@ arm_attr_t *get_arm_attr(ir_node *node);
const
arm_attr_t
*
get_arm_attr_const
(
const
ir_node
*
node
);
/**
* Returns the attributes of an ARM
SymConst
node.
* Returns the attributes of an ARM
Address
node.
*/
arm_
SymConst
_attr_t
*
get_arm_
SymConst
_attr
(
ir_node
*
node
);
const
arm_
SymConst
_attr_t
*
get_arm_
SymConst
_attr_const
(
const
ir_node
*
node
);
arm_
Address
_attr_t
*
get_arm_
Address
_attr
(
ir_node
*
node
);
const
arm_
Address
_attr_t
*
get_arm_
Address
_attr_const
(
const
ir_node
*
node
);
/**
* Returns the attributes of an ARM CondJmp node.
...
...
ir/be/arm/arm_nodes_attr.h
View file @
556ee881
...
...
@@ -82,12 +82,12 @@ typedef struct arm_load_store_attr_t {
bool
entity_sign
:
1
;
}
arm_load_store_attr_t
;
/** Attributes for a
SymConst
*/
typedef
struct
arm_
SymConst
_attr_t
{
/** Attributes for a
n Address
*/
typedef
struct
arm_
Address
_attr_t
{
arm_attr_t
base
;
ir_entity
*
entity
;
int
fp_offset
;
}
arm_
SymConst
_attr_t
;
}
arm_
Address
_attr_t
;
/** Attributes for a CondJmp */
typedef
struct
arm_CondJmp_attr_t
{
...
...
ir/be/arm/arm_optimize.c
View file @
556ee881
...
...
@@ -171,11 +171,11 @@ static ir_node *gen_ptr_sub(ir_node *node, ir_node *frame, arm_vals *v)
/** fix frame addresses which are too big */
static
void
peephole_arm_FrameAddr
(
ir_node
*
node
)
{
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr
(
node
);
int
offset
=
attr
->
fp_offset
;
arm_vals
v
;
ir_node
*
base
;
ir_node
*
ptr
;
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr
(
node
);
int
offset
=
attr
->
fp_offset
;
arm_vals
v
;
ir_node
*
base
;
ir_node
*
ptr
;
if
(
allowed_arm_immediate
(
offset
,
&
v
))
return
;
...
...
ir/be/arm/arm_spec.pl
View file @
556ee881
...
...
@@ -53,9 +53,9 @@ $default_copy_attr = "arm_copy_attr";
%init_attr
=
(
arm_attr_t
=>
"
\t
init_arm_attributes(res, irn_flags_, in_reqs, n_res);
",
arm_
SymConst
_attr_t
=>
arm_
Address
_attr_t
=>
"
\t
init_arm_attributes(res, irn_flags_, in_reqs, n_res);
\n
"
.
"
\t
init_arm_
SymConst
_attributes(res, entity,
symconst_
offset);
",
"
\t
init_arm_
Address
_attributes(res, entity, offset);
",
arm_CondJmp_attr_t
=>
"
\t
init_arm_attributes(res, irn_flags_, in_reqs, n_res);
",
arm_SwitchJmp_attr_t
=>
"
\t
init_arm_attributes(res, irn_flags_, in_reqs, n_res);
",
arm_fConst_attr_t
=>
"
\t
init_arm_attributes(res, irn_flags_, in_reqs, n_res);
",
...
...
@@ -76,7 +76,7 @@ $default_copy_attr = "arm_copy_attr";
%compare_attr
=
(
arm_attr_t
=>
"
cmp_attr_arm
",
arm_
SymConst
_attr_t
=>
"
cmp_attr_arm_
SymConst
",
arm_
Address
_attr_t
=>
"
cmp_attr_arm_
Address
",
arm_CondJmp_attr_t
=>
"
cmp_attr_arm_CondJmp
",
arm_SwitchJmp_attr_t
=>
"
cmp_attr_arm_SwitchJmp
",
arm_fConst_attr_t
=>
"
cmp_attr_arm_fConst
",
...
...
@@ -313,8 +313,8 @@ Bl => {
irn_flags
=>
[
"
modify_flags
"
],
arity
=>
"
variable
",
out_arity
=>
"
variable
",
attr_type
=>
"
arm_
SymConst
_attr_t
",
attr
=>
"
ir_entity *entity, int
symconst_
offset
",
attr_type
=>
"
arm_
Address
_attr_t
",
attr
=>
"
ir_entity *entity, int offset
",
emit
=>
'
bl %I
',
},
...
...
@@ -340,19 +340,19 @@ CopyB => {
FrameAddr
=>
{
op_flags
=>
[
"
constlike
"
],
irn_flags
=>
[
"
rematerializable
"
],
attr
=>
"
ir_entity *entity, int
symconst_
offset
",
attr
=>
"
ir_entity *entity, int offset
",
reg_req
=>
{
in
=>
[
"
gp
"
],
out
=>
[
"
gp
"
]
},
ins
=>
[
"
base
"
],
attr_type
=>
"
arm_
SymConst
_attr_t
",
attr_type
=>
"
arm_
Address
_attr_t
",
mode
=>
$mode_gp
,
},
SymConst
=>
{
Address
=>
{
op_flags
=>
[
"
constlike
"
],
irn_flags
=>
[
"
rematerializable
"
],
attr
=>
"
ir_entity *entity, int
symconst_
offset
",
attr
=>
"
ir_entity *entity, int offset
",
reg_req
=>
{
out
=>
[
"
gp
"
]
},
attr_type
=>
"
arm_
SymConst
_attr_t
",
attr_type
=>
"
arm_
Address
_attr_t
",
mode
=>
$mode_gp
,
},
...
...
ir/be/arm/arm_transform.c
View file @
556ee881
...
...
@@ -1033,7 +1033,7 @@ static ir_node *gen_SymConst(ir_node *node)
dbg_info
*
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
new_node
;
new_node
=
new_bd_arm_
SymConst
(
dbgi
,
block
,
entity
,
0
);
new_node
=
new_bd_arm_
Address
(
dbgi
,
block
,
entity
,
0
);
return
new_node
;
}
...
...
@@ -1725,7 +1725,7 @@ static ir_node *gen_Call(ir_node *node)
in
[
mem_pos
]
=
new_rd_Sync
(
NULL
,
new_block
,
sync_arity
,
sync_ins
);
}
/* TODO: use a generic
symconst
matcher here */
/* TODO: use a generic
address
matcher here */
if
(
is_SymConst
(
callee
))
{
entity
=
get_SymConst_entity
(
callee
);
}
else
{
...
...
@@ -1742,7 +1742,7 @@ static ir_node *gen_Call(ir_node *node)
out_arity
=
1
+
n_caller_saves
;
if
(
entity
!=
NULL
)
{
/* TODO: use a generic
symconst
matcher here
/* TODO: use a generic
address
matcher here
* so we can also handle entity+offset, etc. */
res
=
new_bd_arm_Bl
(
dbgi
,
new_block
,
in_arity
,
in
,
out_arity
,
entity
,
0
);
}
else
{
...
...
ir/be/arm/bearch_arm.c
View file @
556ee881
...
...
@@ -53,7 +53,7 @@ static ir_entity *arm_get_frame_entity(const ir_node *irn)
const
arm_attr_t
*
attr
=
get_arm_attr_const
(
irn
);
if
(
is_arm_FrameAddr
(
irn
))
{
const
arm_
SymConst
_attr_t
*
frame_attr
=
get_arm_
SymConst
_attr_const
(
irn
);
const
arm_
Address
_attr_t
*
frame_attr
=
get_arm_
Address
_attr_const
(
irn
);
return
frame_attr
->
entity
;
}
if
(
attr
->
is_load_store
)
{
...
...
@@ -73,7 +73,7 @@ static ir_entity *arm_get_frame_entity(const ir_node *irn)
static
void
arm_set_stack_bias
(
ir_node
*
irn
,
int
bias
)
{
if
(
is_arm_FrameAddr
(
irn
))
{
arm_
SymConst
_attr_t
*
attr
=
get_arm_
SymConst
_attr
(
irn
);
arm_
Address
_attr_t
*
attr
=
get_arm_
Address
_attr
(
irn
);
attr
->
fp_offset
+=
bias
;
}
else
{
arm_load_store_attr_t
*
attr
=
get_arm_load_store_attr
(
irn
);
...
...
ir/be/ia32/bearch_ia32.c
View file @
556ee881
...
...
@@ -471,7 +471,7 @@ ir_node *ia32_turn_back_am(ir_node *node)
set_irn_n
(
node
,
n_ia32_base
,
noreg
);
set_irn_n
(
node
,
n_ia32_index
,
noreg
);
set_ia32_am_offs_int
(
node
,
0
);
set_ia32_am_
sc
(
node
,
NULL
);
set_ia32_am_
ent
(
node
,
NULL
);
set_ia32_am_scale
(
node
,
0
);
/* rewire mem-proj */
...
...
ir/be/ia32/ia32_address_mode.c
View file @
556ee881
...
...
@@ -32,13 +32,13 @@ static bitset_t *non_address_mode_nodes;