public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo
@ 2020-02-10 13:33 Mihailo Stojanovic
  2020-02-10 13:35 ` Andrew Pinski
  2020-02-13 16:36 ` Jeff Law
  0 siblings, 2 replies; 3+ messages in thread
From: Mihailo Stojanovic @ 2020-02-10 13:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Mihailo Stojanovic

Similar to the mirror case of allocating an FPR for an integer mode
pseudo, prevent GPRs from being allocated for a floating mode pseudo.

gcc/ChangeLog:

        * gcc/config/mips/mips.c (mips_ira_change_pseudo_allocno_class):
        Limit the allocation of floating mode pseudos to FP_REGS.
---
 gcc/config/mips/mips.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 513fc5f..ffcb14d 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -22492,6 +22492,12 @@ mips_ira_change_pseudo_allocno_class (int regno, reg_class_t allocno_class,
      instructions that say integer mode values must be placed in FPRs.  */
   if (INTEGRAL_MODE_P (PSEUDO_REGNO_MODE (regno)) && allocno_class == ALL_REGS)
     return GR_REGS;
+
+  /* Likewise for the mirror case of floating mode pseudos being allocated in
+     a GPR.  */
+  if (FLOAT_MODE_P (PSEUDO_REGNO_MODE (regno)) && allocno_class == ALL_REGS)
+    return FP_REGS;
+
   return allocno_class;
 }
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo
  2020-02-10 13:33 [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo Mihailo Stojanovic
@ 2020-02-10 13:35 ` Andrew Pinski
  2020-02-13 16:36 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2020-02-10 13:35 UTC (permalink / raw)
  To: Mihailo Stojanovic; +Cc: GCC Patches, Jeff Law

On Mon, Feb 10, 2020 at 5:33 AM Mihailo Stojanovic
<mihailo.stojanovic@rt-rk.com> wrote:
>
> Similar to the mirror case of allocating an FPR for an integer mode
> pseudo, prevent GPRs from being allocated for a floating mode pseudo.

Can you expand on why you want to do this?
Provide benchmarking or a testcase which this improves the code generation?
I can see this producing much worse code for soft-float (which I still
care about).

Thanks,
Andrew Pinski

>
> gcc/ChangeLog:
>
>         * gcc/config/mips/mips.c (mips_ira_change_pseudo_allocno_class):
>         Limit the allocation of floating mode pseudos to FP_REGS.
> ---
>  gcc/config/mips/mips.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
> index 513fc5f..ffcb14d 100644
> --- a/gcc/config/mips/mips.c
> +++ b/gcc/config/mips/mips.c
> @@ -22492,6 +22492,12 @@ mips_ira_change_pseudo_allocno_class (int regno, reg_class_t allocno_class,
>       instructions that say integer mode values must be placed in FPRs.  */
>    if (INTEGRAL_MODE_P (PSEUDO_REGNO_MODE (regno)) && allocno_class == ALL_REGS)
>      return GR_REGS;
> +
> +  /* Likewise for the mirror case of floating mode pseudos being allocated in
> +     a GPR.  */
> +  if (FLOAT_MODE_P (PSEUDO_REGNO_MODE (regno)) && allocno_class == ALL_REGS)
> +    return FP_REGS;
> +
>    return allocno_class;
>  }
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo
  2020-02-10 13:33 [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo Mihailo Stojanovic
  2020-02-10 13:35 ` Andrew Pinski
@ 2020-02-13 16:36 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2020-02-13 16:36 UTC (permalink / raw)
  To: Mihailo Stojanovic, gcc-patches

On Mon, 2020-02-10 at 14:33 +0100, Mihailo Stojanovic wrote:
> Similar to the mirror case of allocating an FPR for an integer mode
> pseudo, prevent GPRs from being allocated for a floating mode pseudo.
> 
> gcc/ChangeLog:
> 
>         * gcc/config/mips/mips.c (mips_ira_change_pseudo_allocno_class):
>         Limit the allocation of floating mode pseudos to FP_REGS.
Per Andrew's concern, would it make sense to make this conditional on
hardware floating point?

jeff
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-13 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 13:33 [PATCH v2] [MIPS] Prevent allocation of a GPR for a floating mode pseudo Mihailo Stojanovic
2020-02-10 13:35 ` Andrew Pinski
2020-02-13 16:36 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).