diff options
Diffstat (limited to 'gcc/config/mmix/mmix.c')
-rw-r--r-- | gcc/config/mmix/mmix.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 67b1b23..9e94279 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -135,6 +135,9 @@ static void mmix_file_start (void); static void mmix_file_end (void); static bool mmix_rtx_costs (rtx, int, int, int *, bool); static rtx mmix_struct_value_rtx (tree, int); +static enum machine_mode mmix_promote_function_mode (const_tree, + enum machine_mode, + int *, const_tree, int); static bool mmix_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static bool mmix_frame_pointer_required (void); @@ -188,14 +191,9 @@ static bool mmix_frame_pointer_required (void); #undef TARGET_MACHINE_DEPENDENT_REORG #define TARGET_MACHINE_DEPENDENT_REORG mmix_reorg -#undef TARGET_PROMOTE_FUNCTION_ARGS -#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_const_tree_true -#if 0 -/* Apparently not doing TRT if int < register-size. FIXME: Perhaps - FUNCTION_VALUE and LIBCALL_VALUE needs tweaking as some ports say. */ -#undef TARGET_PROMOTE_FUNCTION_RETURN -#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true -#endif +#undef TARGET_PROMOTE_FUNCTION_MODE +#define TARGET_PROMOTE_FUNCTION_MODE mmix_promote_function_mode + #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX mmix_struct_value_rtx @@ -2692,6 +2690,28 @@ mmix_intval (rtx x) fatal_insn ("MMIX Internal: This is not a constant:", x); } +/* Worker function for TARGET_PROMOTE_FUNCTION_MODE. */ + +enum machine_mode +mmix_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, + enum machine_mode mode, + int *punsignedp ATTRIBUTE_UNUSED, + const_tree fntype ATTRIBUTE_UNUSED, + int for_return) +{ + /* Apparently not doing TRT if int < register-size. FIXME: Perhaps + FUNCTION_VALUE and LIBCALL_VALUE needs tweaking as some ports say. */ + if (for_return) + return mode; + + /* Promotion of modes currently generates slow code, extending before + operation, so we do it only for arguments. */ + if (GET_MODE_CLASS (mode) == MODE_INT + && GET_MODE_SIZE (mode) < 8) + return DImode; + else + return mode; +} /* Worker function for TARGET_STRUCT_VALUE_RTX. */ static rtx |