[PATCH] Fix lea_general patterns (take 3)

Jakub Jelinek jakub@redhat.com
Mon Aug 21 06:53:00 GMT 2000


On Thu, Aug 03, 2000 at 09:56:40AM -0600, Jeffrey A Law wrote:
>   In message < 20000802212635.Q26939@sunsite.ms.mff.cuni.cz >you write:
>   > On Wed, Aug 02, 2000 at 01:17:31PM +0200, Jan Hubicka wrote:
>  > You're right, that's enough.
>   > This patch bootstrapped, no testsuite regressions, built hundreds of MB of
>   > sources (note to Jan, I'm using SImode, not PImode, because lea_0 pattern
>   > uses SImode for the result, not Pmode. So it will need some thinking for
>   > sledgehammer).
>   > Ok to commit?
>   > 
>   > 2000-08-02  Jakub Jelinek  <jakub@redhat.com>
>   > 
>   > 	* config/i386/i386.md (lea_general_1): Only split
>   > 	if not already SImode.
>   > 	(lea_general_2, lea_general_3): Likewise.
> I would much rather see the split condition match (to the extent possible) the
> condition for the pattern.

Ouch, just noticed it is still not fixed in CVS.
Is this acceptable?

2000-08-21  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386.md (lea_general_1): Copy insn condition
	to split condition.
	(lea_general_2, lea_general_3): Likewise.

--- gcc/config/i386/i386.md.jj	Mon Aug  7 15:08:56 2000
+++ gcc/config/i386/i386.md	Mon Aug 21 15:36:05 2000
@@ -3755,7 +3755,13 @@
    && (GET_MODE (operands[0]) == GET_MODE (operands[3])
        || GET_MODE (operands[3]) == VOIDmode)"
   "#"
-  "reload_completed"
+  "reload_completed
+   && (GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode)
+   && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+   && GET_MODE (operands[0]) == GET_MODE (operands[1])
+   && GET_MODE (operands[0]) == GET_MODE (operands[2])
+   && (GET_MODE (operands[0]) == GET_MODE (operands[3])
+       || GET_MODE (operands[3]) == VOIDmode)"
   [(const_int 0)]
   "
 {
@@ -3785,7 +3791,12 @@
    && (GET_MODE (operands[0]) == GET_MODE (operands[3])
        || GET_MODE (operands[3]) == VOIDmode)"
   "#"
-  "reload_completed"
+  "reload_completed
+   && (GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode)
+   && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+   && GET_MODE (operands[0]) == GET_MODE (operands[1])
+   && (GET_MODE (operands[0]) == GET_MODE (operands[3])
+       || GET_MODE (operands[3]) == VOIDmode)"
   [(const_int 0)]
   "
 {
@@ -3814,7 +3825,11 @@
    && GET_MODE (operands[0]) == GET_MODE (operands[1])
    && GET_MODE (operands[0]) == GET_MODE (operands[3])"
   "#"
-  "reload_completed"
+  "reload_completed
+   && (GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode)
+   && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+   && GET_MODE (operands[0]) == GET_MODE (operands[1])
+   && GET_MODE (operands[0]) == GET_MODE (operands[3])"
   [(const_int 0)]
   "
 {

	Jakub


More information about the Gcc-patches mailing list