On 10 November 2011 18:07, Sameera Deshpande <sameera.deshpa...@arm.com> wrote: > Please find attached the reworked patch.
OK but for a very small bit . I'll note that we need to add support for the iwMMXt registers but the attached patch (untested) should be what is needed to support the iwMMxt registers and this should be something that should be incorporated into your ARM RTL epilogues patch as well. My understanding is that this is all you should need to do as there is a wldrd as a part of *iwmmx*_movdi instruction and therefore this should just work in this form. Xinyu can you help in testing this patch once this is applied along with your other patches to turn on Thumb2 for iwmmxt ? cheers Ramana
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 708142e..1fb86fd 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -264,7 +264,7 @@ static reg_class_t arm_preferred_rename_class (reg_class_t rclass); static unsigned int arm_autovectorize_vector_sizes (void); static int arm_default_branch_cost (bool, bool); static int arm_cortex_a5_branch_cost (bool, bool); - +static void arm_epilogue_restore_iwmmxt_regs (void); /* Table of machine attributes. */ static const struct attribute_spec arm_attribute_table[] = @@ -22563,6 +22563,30 @@ thumb2_expand_return (void) } } +static void +arm_epilogue_restore_iwmmxt_regs (void) +{ + + int reg; + for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) + if (df_regs_ever_live_p (reg) && !call_used_regs[reg]) + { + rtx tmp = gen_rtx_SET (DImode, + gen_rtx_REG (reg, DImode), + gen_frame_mem (DImode, + gen_rtx_POST_INC + (DImode, + stack_pointer_rtx))); + rtx dwarf = alloc_reg_note (REG_CFA_RESTORE, + gen_rtx_REG (reg, DImode), + NULL_RTX); + + RTX_FRAME_RELATED_P (tmp) = 1; + emit_insn (tmp); + } + +} + /* Generate RTL to represent a Thumb-2 epilogue. Note that this RTL does not include the @@ -22652,6 +22676,10 @@ thumb2_expand_epilogue (void) /* iWMMXt is not supported when Thumb-2 in use. If it were, we would want to be restoring the appropriate iWMMXt regs here, in a similar way to arm_output_epilogue. */ + if (TARGET_IWMMXT) + { + arm_epilogue_restore_iwmmxt_regs (); + } /* If there are registers to restore, make it happen. */ if (saved_regs_mask)