: Restore alpha boostrap by partial revert

Submitted by Uros Bizjak on March 31, 2012, 1:07 p.m.

Details

Message ID CAFULd4b+QFpGcoSWYKSMUpTuw9-2tCBQncmEYY_jA96gPduoRQ@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak March 31, 2012, 1:07 p.m.
Hello!

Attached patch restores alpha bootstrap.

2012-03-31  Uros Bizjak  <ubizjak@gmail.com>

	Partially revert:
	2012-03-29  Richard Guenther  <rguenther@suse.de>

	* rtl.h (extended_count): Remove.
	* combine.c (extended_count): Remove.

Bootstrapped on alphaev68-pc-linux-gnu.

OK for mainline?

Uros.

Comments

Richard Guenther April 2, 2012, 8:21 a.m.
On Sat, 31 Mar 2012, Uros Bizjak wrote:

> Hello!
> 
> Attached patch restores alpha bootstrap.
> 
> 2012-03-31  Uros Bizjak  <ubizjak@gmail.com>
> 
> 	Partially revert:
> 	2012-03-29  Richard Guenther  <rguenther@suse.de>
> 
> 	* rtl.h (extended_count): Remove.
> 	* combine.c (extended_count): Remove.
> 
> Bootstrapped on alphaev68-pc-linux-gnu.
> 
> OK for mainline?

As alpha is the only user and this does not look in any way
"combine" specific, can you move it to alpha.c instead please?

Thanks,
Richard.
Uros Bizjak April 2, 2012, 8:23 a.m.
On Mon, Apr 2, 2012 at 10:21 AM, Richard Guenther <rguenther@suse.de> wrote:

>> 2012-03-31  Uros Bizjak  <ubizjak@gmail.com>
>>
>>       Partially revert:
>>       2012-03-29  Richard Guenther  <rguenther@suse.de>
>>
>>       * rtl.h (extended_count): Remove.
>>       * combine.c (extended_count): Remove.
>>
>> Bootstrapped on alphaev68-pc-linux-gnu.
>>
>> OK for mainline?
>
> As alpha is the only user and this does not look in any way
> "combine" specific, can you move it to alpha.c instead please?

This was the first thing I thought, but the function uses
nonzero_sign_valid, a variable local to combine.c

Uros.
Richard Guenther April 2, 2012, 8:25 a.m.
On Mon, 2 Apr 2012, Uros Bizjak wrote:

> On Mon, Apr 2, 2012 at 10:21 AM, Richard Guenther <rguenther@suse.de> wrote:
> 
> >> 2012-03-31  Uros Bizjak  <ubizjak@gmail.com>
> >>
> >>       Partially revert:
> >>       2012-03-29  Richard Guenther  <rguenther@suse.de>
> >>
> >>       * rtl.h (extended_count): Remove.
> >>       * combine.c (extended_count): Remove.
> >>
> >> Bootstrapped on alphaev68-pc-linux-gnu.
> >>
> >> OK for mainline?
> >
> > As alpha is the only user and this does not look in any way
> > "combine" specific, can you move it to alpha.c instead please?
> 
> This was the first thing I thought, but the function uses
> nonzero_sign_valid, a variable local to combine.c

Hmm, how ugly ;)  Your patch is ok then.

Sorry for the breakage.

Richard.

Patch hide | download patch | download mbox

Index: combine.c
===================================================================
--- combine.c	(revision 186039)
+++ combine.c	(working copy)
@@ -9674,6 +9674,31 @@ 
   return NULL;
 }
 
+/* Return the number of "extended" bits there are in X, when interpreted
+   as a quantity in MODE whose signedness is indicated by UNSIGNEDP.  For
+   unsigned quantities, this is the number of high-order zero bits.
+   For signed quantities, this is the number of copies of the sign bit
+   minus 1.  In both case, this function returns the number of "spare"
+   bits.  For example, if two quantities for which this function returns
+   at least 1 are added, the addition is known not to overflow.
+
+   This function will always return 0 unless called during combine, which
+   implies that it must be called from a define_split.  */
+
+unsigned int
+extended_count (const_rtx x, enum machine_mode mode, int unsignedp)
+{
+  if (nonzero_sign_valid == 0)
+    return 0;
+
+  return (unsignedp
+	  ? (HWI_COMPUTABLE_MODE_P (mode)
+	     ? (unsigned int) (GET_MODE_PRECISION (mode) - 1
+			       - floor_log2 (nonzero_bits (x, mode)))
+	     : 0)
+	  : num_sign_bit_copies (x, mode) - 1);
+}
+
 /* This function is called from `simplify_shift_const' to merge two
    outer operations.  Specifically, we have already found that we need
    to perform operation *POP0 with constant *PCONST0 at the outermost
Index: rtl.h
===================================================================
--- rtl.h	(revision 186039)
+++ rtl.h	(working copy)
@@ -2455,6 +2455,7 @@ 
 			     const_rtx, unsigned int);
 
 /* In combine.c  */
+extern unsigned int extended_count (const_rtx, enum machine_mode, int);
 extern rtx remove_death (unsigned int, rtx);
 extern void dump_combine_stats (FILE *);
 extern void dump_combine_total_stats (FILE *);