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

Reply via email to