https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90877

--- Comment #1 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Fri Jun 14 15:41:43 2019
New Revision: 272294

URL: https://gcc.gnu.org/viewcvs?rev=272294&root=gcc&view=rev
Log:
i386: Update SSE <-> integer move costs

Since inline_secondary_memory_needed has

  /* ??? This is a lie.  We do have moves between mmx/general, and for
     mmx/sse2.  But by saying we need secondary memory we discourage the
     register allocator from using the mmx registers unless needed.  */
  if (MMX_CLASS_P (class1) != MMX_CLASS_P (class2))
    return true;

moves between MMX and non-MMX units require secondary memory.   There
is no need to check moves between MMX and integer units.

struct processor_costs has:

  const int mmxsse_to_integer;  /* cost of moving mmxsse register to
                                   integer.  */
  const int ssemmx_to_integer;  /* cost of moving integer to mmxsse register.
*/

This patch also renames mmxsse_to_integer to sse_to_integer and
ssemmx_to_integer to integer_to_sse.

Tested on Linux/x86-64.

        PR target/90877
        * config/i386/i386-features.c
        (dimode_scalar_chain::compute_convert_gain): Replace
        mmxsse_to_integer with sse_to_integer.
        * config/i386/i386.c (ix86_register_move_cost): Verify that
        moves between MMX and non-MMX units require secondary memory.
        Correct costs of moves between SSE and integer units.
        * config/i386/i386.h (processor_costs): Rename cost of moving
        SSE register to integer to sse_to_integer.  Rename cost of
        moving integer register to SSE to integer_to_sse.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-features.c
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.h

Reply via email to