This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Re: PATCH: fix for problem in i386.md ashlqi3_1_lea pattern


On Wed, Aug 02, 2000 at 12:52:46PM +0200, Jan Hubicka wrote:
> Hi
> The constraint is correct, since the pattern ought to result into lea

Agreed.

> instruction. FOr some purpose the spliter refuse it - I will figure out why
> and send fix soon.

Maybe unrelated, here is a patch which fixes a bunch of i386 regressions
(not in the testsuite, but in the distribution build):

Basically, it does 2 things:
1) Avoid calling gen_lowpart on immediate_operands. That usually results
   in aborts(), e.g. look what is gen_lowpart doing with stuff like CONST
   (for pic unspecs), LABEL_REF or SYMBOL_REF.
2) Replicates the lea_general conditionals for the splitter conditions:
   although Richard said you you don't have to replicate them, it seems
   the splitters are otherwise matched and I saw multiple times that e.g.
   a SImode lea_0 valid instruction is splitted into the identical lea_0
   instruction etc.

I'll bootstrap this in a second and then build a couple hundreds MB of
sources to be sure then.

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

	* config/i386/i386.md (lea_general_1): Replicate conditionals.
	Don't use gen_lowpart on immediates.
	(lea_general_2, lea_general_3): Likewise.

--- gcc/config/i386/i386.md.jj	Mon Jul 31 20:02:15 2000
+++ gcc/config/i386/i386.md	Wed Aug  2 12:52:39 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)]
   "
 {
@@ -3763,7 +3769,6 @@
   operands[0] = gen_lowpart (SImode, operands[0]);
   operands[1] = gen_lowpart (Pmode, operands[1]);
   operands[2] = gen_lowpart (Pmode, operands[2]);
-  operands[3] = gen_lowpart (Pmode, operands[3]);
   pat = gen_rtx_PLUS (Pmode, gen_rtx_PLUS (Pmode, operands[1], operands[2]),
   		      operands[3]);
   if (Pmode != SImode)
@@ -3785,14 +3790,20 @@
    && (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)]
   "
 {
   rtx pat;
   operands[0] = gen_lowpart (SImode, operands[0]);
   operands[1] = gen_lowpart (Pmode, operands[1]);
-  operands[3] = gen_lowpart (Pmode, operands[3]);
+  if (GET_CODE (operands[3]) == REG || GET_CODE (operands[3]) == SUBREG)
+    operands[3] = gen_lowpart (Pmode, operands[3]);
   pat = gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1], operands[2]),
   		      operands[3]);
   if (Pmode != SImode)
@@ -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)]
   "
 {
@@ -3822,7 +3837,6 @@
   operands[0] = gen_lowpart (SImode, operands[0]);
   operands[1] = gen_lowpart (Pmode, operands[1]);
   operands[3] = gen_lowpart (Pmode, operands[3]);
-  operands[4] = gen_lowpart (Pmode, operands[4]);
   pat = gen_rtx_PLUS (Pmode,
   		      gen_rtx_PLUS (Pmode, gen_rtx_MULT (Pmode, operands[1],
 		      					 operands[2]),


	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]