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
203ba1fe
Commit
203ba1fe
authored
May 02, 2016
by
Christoph Mallon
Browse files
ia32: Replace 'match_upconv' by explicit 'match_sign_ext' and 'match_zero_ext'.
parent
143836e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_nodes_attr.h
View file @
203ba1fe
...
...
@@ -49,13 +49,9 @@ typedef enum match_flags_t {
/** for 8/16 bit modes, zero_ext operations can be emulated by their
* 32bit equivalents, however the upper bits must be zero extended. */
match_zero_ext
=
1
<<
8
,
/** for 8/16 bit modes, upconv operations can be emulated by their
* 32bit equivalents, however the upper bits have to sign/zero extended
* based on the operations mode. */
match_upconv
=
1
<<
9
,
match_try_am
=
1
<<
10
,
/**< only try to produce AM node, don't
match_try_am
=
1
<<
9
,
/**< only try to produce AM node, don't
do anything if AM isn't possible */
match_two_users
=
1
<<
1
1
,
/**< the instruction uses a load two times ... */
match_two_users
=
1
<<
1
0
,
/**< the instruction uses a load two times ... */
}
match_flags_t
;
ENUM_BITSET
(
match_flags_t
)
...
...
ir/be/ia32/ia32_transform.c
View file @
203ba1fe
...
...
@@ -1075,8 +1075,8 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block,
if
(
size
==
X86_SIZE_32
||
flags
&
match_mode_neutral
)
{
transform
=
&
be_transform_node
;
size
=
X86_SIZE_32
;
}
else
if
(
flags
&
match_
upconv
)
{
transform
=
&
transform_
upconv
;
}
else
if
(
flags
&
match_
sign_ext
)
{
transform
=
&
transform_
sext
;
size
=
X86_SIZE_32
;
}
else
if
(
flags
&
match_zero_ext
)
{
transform
=
&
transform_zext
;
...
...
@@ -1841,7 +1841,9 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con
ia32_address_mode_t
am
;
ir_node
*
const
mem_pin_skip
=
skip_Pin
(
mem
);
ir_node
*
const
old_block
=
get_nodes_block
(
node
);
match_arguments
(
&
am
,
old_block
,
op1
,
op2
,
mem_pin_skip
,
match_am
|
match_upconv
);
bool
const
is_signed
=
mode_is_signed
(
mode
);
match_flags_t
const
flags
=
match_am
|
(
is_signed
?
match_sign_ext
:
match_zero_ext
);
match_arguments
(
&
am
,
old_block
,
op1
,
op2
,
mem_pin_skip
,
flags
);
/* Beware: We don't need a Sync, if the memory predecessor of the Div node
* is the memory of the consumed address. We can have only the second op as
...
...
@@ -1853,7 +1855,7 @@ static ir_node *create_Div(ir_node *const node, ir_node *const op1, ir_node *con
dbg_info
*
const
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
ext
;
ir_node
*
(
*
cons
)(
dbg_info
*
db
,
ir_node
*
block
,
ir_node
*
base
,
ir_node
*
index
,
ir_node
*
mem
,
ir_node
*
op1
,
ir_node
*
op2
,
ir_node
*
ext
,
x86_insn_size_t
size
);
if
(
mode_
is_signed
(
mode
)
)
{
if
(
is_signed
)
{
ext
=
create_sex_32_64
(
dbgi
,
block
,
am
.
new_op1
);
cons
=
new_bd_ia32_IDiv
;
}
else
{
...
...
@@ -3817,7 +3819,7 @@ static void store_gp(dbg_info *dbgi, ia32_address_mode_t *am, ir_node *block,
return
;
}
else
if
(
possible_int_mode_for_fp
(
mode
))
{
match_arguments
(
am
,
block
,
NULL
,
value
,
NULL
,
match_am
|
match_try_am
|
match_
upconv
|
match_16bit_am
);
match_am
|
match_try_am
|
match_
sign_ext
|
match_16bit_am
);
if
(
am
->
op_type
==
ia32_AddrModeS
)
return
;
}
...
...
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