Andrew Pinski

Results 82 comments of Andrew Pinski

>I'm surprised we haven't seen it in the wild so far… Most likely because most C library function takes either an int, a pointer, or size_t due to historical K&R...

Hmm, isn't the code in the testcase valid? Or is it just the way constant folding interacts with other passes that causes p4c to reject it too? At one point...

It just looks like the checking is not checking the order here rather than an issue with the spec or otherwise. Take: ``` extern void log(in bit a); bit a(in...

Anyways here is another testcase: ``` extern bit ext(); control c() { bit tt; action a(in bit v1, in bit v2) { tt = v1++v2; } table t { actions...

This is related to https://github.com/p4lang/p4c/issues/3671 and https://github.com/p4lang/p4c/issues/3666

Or should `|`, `^` and `&` be valid really be made valid for arbitrary-precision integers. in similar way shifts and bit slices are handled?

> Maybe I messed this up in the recent pr #3716 No this has been accepted for a while I think. #2661 added the testcases.

> > Note: bitwise-operations (|,&,^,~) are not defined on expressions of type int. > > In general, bitwise operations such as `|`, `&` and `^` are supported for `int` in...

Note the only issue with ++ is how to handle negative #s for all of those operations. But if it is positive it is obvious what should be done really.

>Is this currently a P4 language limitation or bmv2-specific limitation? Looks to be BMV2 specific error message: backends/bmv2/common/action.cpp: "%1%: action parameters must be bit or int on this target", p);...