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
201a260b
Commit
201a260b
authored
Nov 23, 2014
by
Christoph Mallon
Browse files
ia32: Replace repeated code in ia32_create_float_const_entity() by a loop.
parent
84354a35
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_common_transform.c
View file @
201a260b
...
@@ -64,15 +64,15 @@ ir_entity *ia32_create_float_const_entity(ia32_isa_t *isa, ir_tarval *tv,
...
@@ -64,15 +64,15 @@ ir_entity *ia32_create_float_const_entity(ia32_isa_t *isa, ir_tarval *tv,
ir_mode
*
mode
=
get_tarval_mode
(
tv
);
ir_mode
*
mode
=
get_tarval_mode
(
tv
);
if
(
!
ia32_cg_config
.
use_sse2
)
{
if
(
!
ia32_cg_config
.
use_sse2
)
{
/* try to reduce the mode to produce smaller sized entities */
/* try to reduce the mode to produce smaller sized entities */
i
f
(
mode
!=
mode_F
)
{
i
r_mode
*
const
modes
[]
=
{
mode_F
,
mode_D
,
NULL
};
if
(
tarval_ieee754_can_conv_lossless
(
tv
,
mode_F
)
)
{
for
(
ir_mode
*
const
*
i
=
modes
;;
++
i
)
{
mode
=
mode_F
;
ir_
mode
*
const
to
=
*
i
;
tv
=
tarval_convert_to
(
tv
,
mode
)
;
if
(
!
to
||
to
==
mode
)
}
else
if
(
mode
!=
mode_D
)
{
break
;
if
(
tarval_ieee754_can_conv_lossless
(
tv
,
mode_D
))
{
if
(
tarval_ieee754_can_conv_lossless
(
tv
,
to
))
{
mode
=
mode_D
;
tv
=
tarval_convert_to
(
tv
,
to
)
;
tv
=
tarval_convert_to
(
tv
,
mode
)
;
mode
=
to
;
}
break
;
}
}
}
}
}
}
...
...
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