ARM/iwmmxt fix for saving SIMD registers

Richard Earnshaw rearnsha@gcc.gnu.org
Fri Apr 23 10:32:00 GMT 2004


On Thu, 2004-04-22 at 17:15, Daniel Jacobowitz wrote:
> This patch fixes a bug which used to show up in the GCC testsuite, but no
> longer does.  Test coverage on the iwmmxt instructions used to be pretty
> good, but when Paul fixed the ARM shift patterns to prefer not using the
> iwmmxt registers, we went from overenthusiasticly using them to
> underenthusiasticly; as a result, almost nothing in the testsuite generates
> use of iwmmxt instructions or registers.  So I had to write some new tests.
> 
> The bug was that the registers were saved in a different order than they
> were restored in the -mno-apcs-frame case; arm-elf uses -mapcs-frame by
> default but GNU/Linux does not.  Also, the save was PRE_DEC and the
> restoration was pre-increment; that should have been post-increment.
> 
> Tested on arm-linux --with-cpu=iwmmxt.  OK?

It's a minor niggle, but the normal convention on ARM is for the lowest
numbered register in a class to be at the lowest stack pointer offset,
though this is normally because there are store-multiple operations that
work this way.  This patch means that the WMMX registers are stored in a
different order to other classes.

However, that's not a technical reason for rejecting the patch: I'm not
aware that the order matters in any normal code.

> 2004-04-21  Daniel Jacobowitz  <drow@mvista.com>
>
>        * config/arm/arm.c (arm_output_epilogue): Reverse the order of
>        loading iWMMXt registers with a frame pointer.  Use post-increment
>        without a frame pointer.
>        (arm_expand_prologue): Reverse the order of saving iWMMXt registers.
>
> 2004-04-21  Daniel Jacobowitz  <drow@mvista.com>
>
>        * gcc.c-torture/execute/simd-5.c: New test.

OK.



More information about the Gcc-patches mailing list