This is the mail archive of the gcc@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]

[GSoC] support for literals


Hi,
    I was wondering if it would be a good idea to have the following syntax
for literals:
(type val) ?
type would be one of the tree-codes representing cst types like
INTEGER_CST, REAL_CST, etc.

eg:
(negate (integer_cst 3))

would be equivalent to the following:
(negate INTEGER_CST_P@0)
if (TREE_INT_CST_LOW (@0) == 3)
{ .. }

Also possibly provide a short-hand for some literals
like integer and floating point, so just writing
3 would be short-hand for (integer_cst 3) ?

Many patterns from [1] have integral constants to match.
eg: (a >> 2) >=3 -> a >= (3 << 2)
so this could be written as:
(gte (rshift @0 2) 3)
(gte @0 (lshift 3 2))

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14753

Thanks,
Prathamesh


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