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
543a4b68
Commit
543a4b68
authored
Jan 11, 2016
by
Christoph Mallon
Browse files
amd64: Simplify input requirement selection in gen_compare_swap().
parent
0791264b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/amd64/amd64_transform.c
View file @
543a4b68
...
...
@@ -2950,26 +2950,20 @@ static ir_node *gen_compare_swap(ir_node *const node)
int
arity
=
0
;
amd64_addr_t
addr
;
perform_address_matching
(
ptr
,
&
arity
,
in
,
&
addr
);
static
arch_register_req_t
const
**
const
am_rax_reg_mem_reqs
[]
=
{
rax_reg_mem_reqs
,
reg_rax_reg_mem_reqs
,
reg_reg_rax_reg_mem_reqs
,
};
assert
((
size_t
)
arity
<
ARRAY_SIZE
(
am_rax_reg_mem_reqs
));
arch_register_req_t
const
**
const
reqs
=
am_rax_reg_mem_reqs
[
arity
];
in
[
arity
++
]
=
new_old
;
int
new_input
=
arity
;
in
[
arity
++
]
=
new_new
;
in
[
arity
++
]
=
new_mem
;
arch_register_req_t
const
**
reqs
;
switch
(
arity
)
{
case
3
:
reqs
=
rax_reg_mem_reqs
;
break
;
case
4
:
reqs
=
reg_rax_reg_mem_reqs
;
break
;
case
5
:
reqs
=
reg_reg_rax_reg_mem_reqs
;
break
;
default:
panic
(
"gen_compare_swap: Unexpected arity %d"
,
arity
);
}
amd64_binop_addr_attr_t
const
attr
=
{
.
base
=
{
.
base
=
{
...
...
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