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
c5ef87cd
Commit
c5ef87cd
authored
Jan 18, 2006
by
Sebastian Hack
Browse files
Fixed some bugs
parent
818de80b
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/bearch.c
View file @
c5ef87cd
...
...
@@ -92,7 +92,7 @@ int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn,
const
arch_irn_ops_t
*
ops
=
get_irn_ops
(
env
,
irn
);
const
arch_register_req_t
*
req
=
ops
->
get_irn_reg_req
(
ops
,
&
local_req
,
irn
,
pos
);
if
(
arch_register_req_
is
(
req
,
none
)
)
{
if
(
req
->
type
==
arch_register_req_
type_
none
)
{
bitset_clear_all
(
bs
);
return
0
;
}
...
...
@@ -116,28 +116,20 @@ int arch_is_register_operand(const arch_env_t *env,
int
arch_reg_is_allocatable
(
const
arch_env_t
*
env
,
const
ir_node
*
irn
,
int
pos
,
const
arch_register_t
*
reg
)
{
int
res
=
0
;
arch_register_req_t
req
;
arch_get_register_req
(
env
,
&
req
,
irn
,
pos
);
switch
(
req
.
type
)
{
case
arch_register_req_type_normal
:
case
arch_register_req_type_should_be_different
:
case
arch_register_req_type_should_be_same
:
res
=
req
.
cls
==
reg
->
reg_class
;
break
;
case
arch_register_req_type_limited
:
{
bitset_t
*
bs
=
bitset_alloca
(
req
.
cls
->
n_regs
);
req
.
limited
(
irn
,
pos
,
bs
);
res
=
bitset_is_set
(
bs
,
arch_register_get_index
(
reg
));
}
break
;
default:
res
=
0
;
if
(
req
.
type
==
arch_register_req_type_none
)
return
0
;
if
(
arch_register_req_is
(
&
req
,
limited
))
{
bitset_t
*
bs
=
bitset_alloca
(
req
.
cls
->
n_regs
);
req
.
limited
(
irn
,
pos
,
bs
);
return
bitset_is_set
(
bs
,
arch_register_get_index
(
reg
));
}
return
res
;
return
re
q
.
cls
==
reg
->
reg_clas
s
;
}
const
arch_register_class_t
*
...
...
ir/be/benode.c
View file @
c5ef87cd
...
...
@@ -401,15 +401,20 @@ static void *put_in_reg_req(arch_register_req_t *req, const ir_node *irn, int po
static
const
arch_register_req_t
*
be_node_get_irn_reg_req
(
const
arch_irn_ops_t
*
self
,
arch_register_req_t
*
req
,
const
ir_node
*
irn
,
int
pos
)
{
int
out_pos
=
redir_proj
((
const
ir_node
**
)
&
irn
,
pos
)
;
int
out_pos
=
pos
;
if
(
pos
<
0
&&
get_irn_mode
(
irn
)
==
mode_T
)
return
NULL
;
if
(
pos
<
0
)
{
if
(
get_irn_mode
(
irn
)
==
mode_T
)
return
NULL
;
if
(
!
is_be_node
(
irn
))
return
NULL
;
out_pos
=
redir_proj
((
const
ir_node
**
)
&
irn
,
pos
);
assert
(
is_be_node
(
irn
));
return
put_out_reg_req
(
req
,
irn
,
out_pos
);
}
req
=
pos
>=
0
?
put_in_reg_req
(
req
,
irn
,
pos
)
:
put_out_reg_req
(
req
,
irn
,
out_pos
);
else
{
return
is_be_node
(
irn
)
?
put_in_reg_req
(
req
,
irn
,
pos
)
:
NULL
;
}
return
req
;
}
...
...
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