This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Use predicates for RTL objects
On Thu, Aug 08, 2019 at 10:42:06AM -0600, Jeff Law wrote:
> On 8/5/19 12:29 PM, Segher Boessenkool wrote:
> > On Mon, Aug 05, 2019 at 02:14:50PM -0400, Arvind Sankar wrote:
> >> On Mon, Aug 05, 2019 at 12:48:46PM -0500, Segher Boessenkool wrote:
> >>> First: do you have a copyright assignment? See
> >>> https://gcc.gnu.org/contribute.html
> >>> for instructions.
> >>
> >> Nope, is this really substantial enough to warrant one?
> >
> > Some might say it is, the sheer amount of code changed :-) If some
> > maintainer okays it without assignment, that is fine with me of course.
> >
> > This is also easier if it is all machine-generated and nice simple
> > patches :-)
> If it's entirely machine generated and you don't want to do a copyright
> assignment, then the way to go will be for someone with an assignment to
> run the scripts and commit the change. Then we'd only need an
> assignment if we wanted the scripts in the repo.
(/me thinks someone set him up to volunteer for this... Well I guess
that was me who did that? Oh well.)
Yes, I'll do that, and I'll rewrite the script so it is maintainable
(as far as that is possible with REs :-) ).
That leaves the new predicates...
> >>>> -/* Predicate yielding true iff X is an rtx for a double-int. */
> >>>> +/* Predicate yielding true iff X is an rtx for a floating point constant. */
> >>>> #define CONST_DOUBLE_AS_FLOAT_P(X) \
> >>>> (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode)
> >>>
> >>> Is const_double really only used for floating point these days?
> >
> >> Are you asking if the CONST_DOUBLE_AS_INT_P possibility is dead code
> >> now? That's beyond my current level of understanding of the code,
> >> hopefully someone else will chime in.
> >
> > I am asking if the change to this comment is correct.
> I thought we used CONST_DOUBLE for scalar constants that are wider than
> a HOST_WIDE_INT, or perhaps wider than 2 HOST_WIDE_INTs. If that's
> still the case, then the comment change is wrong.
Some lines above there is
/* Predicate yielding true iff X is an rtx for a double-int. */
#define CONST_DOUBLE_AS_INT_P(X) \
(GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == VOIDmode)
so the change is actually good? But these macros should be moved
together.
Segher