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
bb7f61c1
Commit
bb7f61c1
authored
Sep 22, 2009
by
Christoph Mallon
Browse files
Simplify and correct bemit_binop_2(): test with sourceAM generated wrong opcode.
[r26615]
parent
10be92df
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_emitter.c
View file @
bb7f61c1
...
...
@@ -2577,26 +2577,14 @@ static void bemit_binop_with_imm(
*/
static
void
bemit_binop_2
(
const
ir_node
*
node
,
unsigned
code
)
{
const
arch_register_t
*
out
=
get_in_reg
(
node
,
n_ia32_binary_left
);
ia32_op_type_t
am_type
=
get_ia32_op_type
(
node
);
unsigned
char
d
=
0
;
const
arch_register_t
*
op2
;
switch
(
am_type
)
{
case
ia32_AddrModeS
:
d
=
2
;
/* FALLTHROUGH */
case
ia32_AddrModeD
:
bemit8
(
code
|
d
);
const
arch_register_t
*
out
=
get_in_reg
(
node
,
n_ia32_binary_left
);
bemit8
(
code
);
if
(
get_ia32_op_type
(
node
)
==
ia32_Normal
)
{
const
arch_register_t
*
op2
=
get_in_reg
(
node
,
n_ia32_binary_right
);
bemit_modrr
(
op2
,
out
);
}
else
{
bemit_mod_am
(
reg_gp_map
[
out
->
index
],
node
);
return
;
case
ia32_Normal
:
bemit8
(
code
);
op2
=
get_in_reg
(
node
,
n_ia32_binary_right
);
bemit_modrr
(
out
,
op2
);
return
;
}
panic
(
"invalid address mode"
);
}
/**
...
...
@@ -2722,14 +2710,14 @@ static void bemit_ ## op(const ir_node *node) { \
}
/* insn def eax,imm imm */
BINOP
(
add
,
0x0
1
,
0x05
,
0x81
,
0
)
BINOP
(
or
,
0x0
9
,
0x0D
,
0x81
,
1
)
BINOP
(
adc
,
0x1
1
,
0x15
,
0x81
,
2
)
BINOP
(
sbb
,
0x1
9
,
0x1D
,
0x81
,
3
)
BINOP
(
and
,
0x2
1
,
0x25
,
0x81
,
4
)
BINOP
(
sub
,
0x2
9
,
0x2D
,
0x81
,
5
)
BINOP
(
xor
,
0x3
1
,
0x35
,
0x81
,
6
)
BINOP
(
cmp
,
0x3
9
,
0x3D
,
0x81
,
7
)
BINOP
(
add
,
0x0
3
,
0x05
,
0x81
,
0
)
BINOP
(
or
,
0x0
B
,
0x0D
,
0x81
,
1
)
BINOP
(
adc
,
0x1
3
,
0x15
,
0x81
,
2
)
BINOP
(
sbb
,
0x1
B
,
0x1D
,
0x81
,
3
)
BINOP
(
and
,
0x2
3
,
0x25
,
0x81
,
4
)
BINOP
(
sub
,
0x2
B
,
0x2D
,
0x81
,
5
)
BINOP
(
xor
,
0x3
3
,
0x35
,
0x81
,
6
)
BINOP
(
cmp
,
0x3
B
,
0x3D
,
0x81
,
7
)
BINOP
(
test
,
0x85
,
0xA9
,
0xF7
,
0
)
#define BINOPMEM(op, ext) \
...
...
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