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]
Other format: [Raw text]

Re: patch for machine independent rtl section to hide case statements for different types of constants.


Kenneth Zadeck <zadeck@naturalbridge.com> writes:
> I named it this way CASE_CONST_SCALAR_INTEGER because i need to 
> introduce in the next patch a predicate that looks like
>
> /* Predicate yielding true iff X is an rtx for a integer const.  */
> #if TARGET_SUPPORTS_WIDE_INT == 1
> #define CONST_INTEGER_P(X) \
>    (CONST_INT_P (X) || CONST_WIDE_INT_P (X))
> #else
> #define CONST_INTEGER_P(X) \
>    (CONST_INT_P (X) || CONST_DOUBLE_AS_INT_P (X))
> #endif
>
> for all of the rtxs that represent an integer.  And this name was 
> consistent with that.   It may be that you have a suggestion for the 
> name of predicate as well

Good guess.

> but it seemed to make more sense to have the 
> rtxs be consistent rather than rtx/mode consistent.

Yeah, I think CONST_SCALAR_INT_P would be better here too.  "INTEGER"
just isn't distinct enough from "INT" for the difference to be obvious.
It also doesn't indicate that complex integers and vector integers
are excluded.  SCALAR_INT seems a bit more precise, as well as
having precedent.

BTW, the "== 1" above looks redundant.

Richard


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