public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][MIPS] Don't split shifts by default for MIPS16.
@ 2016-05-24 15:49 Robert Suchanek
  2016-06-09 15:46 ` Maciej W. Rozycki
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Suchanek @ 2016-05-24 15:49 UTC (permalink / raw)
  To: Catherine_Moore, Matthew Fortune; +Cc: gcc-patches

Hi,

The following changes the default behaviour of shift splitting
for MIPS16 e.g. the shifts will be split only when used with
undocumented -mno-debugd option that is now switched on by default.

This appears to enable better optimization in certain cases, and hence,
giving slightly better performance.

Ok to apply?

Regards,
Robert

gcc/
	* config/mips/mips.md (<optab><mode>3): Don't split shifts
	when used with -mdebugd.
	* config/mips/mips.opt (mdebugd): Init to 1 by default.
---
 gcc/config/mips/mips.md  | 1 +
 gcc/config/mips/mips.opt | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 22f4f0b..01d7edd 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -5602,6 +5602,7 @@ (define_expand "<optab><mode>3"
      be careful not to allocate a new register if we've reached the
      reload pass.  */
   if (TARGET_MIPS16
+      && !TARGET_DEBUG_D_MODE
       && optimize
       && CONST_INT_P (operands[2])
       && INTVAL (operands[2]) > 8
diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
index 53feb23..b6c839d 100644
--- a/gcc/config/mips/mips.opt
+++ b/gcc/config/mips/mips.opt
@@ -127,7 +127,7 @@ mdebug
 Target Var(TARGET_DEBUG_MODE) Undocumented
 
 mdebugd
-Target Var(TARGET_DEBUG_D_MODE) Undocumented
+Target Var(TARGET_DEBUG_D_MODE) Undocumented Init(1)
 
 meb
 Target Report RejectNegative Mask(BIG_ENDIAN)
-- 
2.8.2.396.g5fe494

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

* Re: [PATCH][MIPS] Don't split shifts by default for MIPS16.
  2016-05-24 15:49 [PATCH][MIPS] Don't split shifts by default for MIPS16 Robert Suchanek
@ 2016-06-09 15:46 ` Maciej W. Rozycki
  0 siblings, 0 replies; 2+ messages in thread
From: Maciej W. Rozycki @ 2016-06-09 15:46 UTC (permalink / raw)
  To: Robert Suchanek; +Cc: Catherine_Moore, Matthew Fortune, gcc-patches

On Tue, 24 May 2016, Robert Suchanek wrote:

> The following changes the default behaviour of shift splitting
> for MIPS16 e.g. the shifts will be split only when used with
> undocumented -mno-debugd option that is now switched on by default.
> 
> This appears to enable better optimization in certain cases, and hence,
> giving slightly better performance.

 Thank you for your contribution, however I have some issues with your 
proposal.

 First of all since TARGET_DEBUG_D_MODE is used across several places I 
think this really should be split into two separate pieces, independently 
reviewed.

 Then we have two parts:

1. The change to the expander is probably all but obviously correct as it 
   complements a similar one applied to the corresponding splitters eons 
   ago (back in 2001), although I wonder why we need to have both the 
   splitters and instructions split manually in the expander in the first 
   place.  Can you please investigatie it?

2. The other change is far from obvious since it flips the splitting 
   default, which has been there since forever (or the addition of MIPS16 
   support back in 1998).  So I think it needs a justification more 
   elaborate than just "certain cases", and perhaps a proper command-line 
   option defined rather than using an obscure debugging hook.  It may 
   also make sense to set the default dynamically from the CPU tuning 
   selected -- if the "certain cases" change from CPU to CPU, that is.  
   Can you please look into it?

  Maciej

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

end of thread, other threads:[~2016-06-09 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 15:49 [PATCH][MIPS] Don't split shifts by default for MIPS16 Robert Suchanek
2016-06-09 15:46 ` Maciej W. Rozycki

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).