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
fed87ca4
Commit
fed87ca4
authored
Mar 31, 2014
by
Matthias Braun
Browse files
ia32: small structs are returned in int regs on darwin
parent
1c3acfb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/bearch_ia32.c
View file @
fed87ca4
...
...
@@ -1691,8 +1691,12 @@ static void ia32_lower_for_target(void)
* on the callframe and we can't just use an arbitrary position on the
* stackframe)
*/
lower_calls_with_compounds
(
LF_RETURN_HIDDEN
|
LF_DONT_LOWER_ARGUMENTS
|
LF_RETURN_SMALL_ARRAY_IN_INTS
);
bool
darwin_abi
=
be_gas_object_file_format
==
OBJECT_FILE_FORMAT_MACH_O
;
compound_call_lowering_flags
lower_call_flags
=
LF_RETURN_HIDDEN
|
LF_DONT_LOWER_ARGUMENTS
|
LF_RETURN_SMALL_ARRAY_IN_INTS
|
(
darwin_abi
?
LF_RETURN_SMALL_STRUCT_IN_INTS
:
LF_NONE
);
lower_calls_with_compounds
(
lower_call_flags
);
be_after_irp_transform
(
"lower-calls"
);
/* replace floating point operations by function calls */
...
...
ir/lower/lower_calls.c
View file @
fed87ca4
...
...
@@ -86,10 +86,13 @@ static void remove_compound_param_entities(ir_graph *irg)
static
unsigned
return_in_ints
(
compound_call_lowering_flags
flags
,
ir_type
*
tp
)
{
if
(
!
(
flags
&
LF_RETURN_SMALL_ARRAY_IN_INTS
))
return
0
;
if
(
!
is_Array_type
(
tp
))
if
(
is_Array_type
(
tp
))
{
if
(
!
(
flags
&
LF_RETURN_SMALL_ARRAY_IN_INTS
))
return
0
;
}
else
if
(
!
(
flags
&
LF_RETURN_SMALL_STRUCT_IN_INTS
))
{
assert
(
is_aggregate_type
(
tp
));
return
0
;
}
unsigned
size
=
get_type_size_bytes
(
tp
);
unsigned
n_regs
=
size
/
get_mode_size_bytes
(
int_return_mode
);
if
(
n_regs
>
2
)
...
...
ir/lower/lower_calls.h
View file @
fed87ca4
...
...
@@ -24,6 +24,8 @@ typedef enum compound_call_lowering_flags {
/** Return small arays as integer values instead of storing them into
* memory. */
LF_RETURN_SMALL_ARRAY_IN_INTS
=
1
<<
2
,
/** Return small structs as integer values */
LF_RETURN_SMALL_STRUCT_IN_INTS
=
1
<<
3
,
}
compound_call_lowering_flags
;
ENUM_BITSET
(
compound_call_lowering_flags
)
...
...
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