Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example P4 program with for loop iterating over elements of list that is unrolled? #4966

Open
jafingerhut opened this issue Oct 17, 2024 · 1 comment
Labels
question This is a topic requesting clarification.

Comments

@jafingerhut
Copy link
Contributor

I have not yet found an example of a loop starting with for (typeRef var in listExpr) { ... } that is unrolled.

It seems like that kind of loop would be the easiest to unroll, since the exact number of iterations is guaranteed to be a compile-time constant value, i.e. the number of elements in the list expression, and all P4 list expressions have a compile-time known number of elements.

@ChrisDodd
Copy link
Contributor

currently the ForInLoop code in unrollLoops can only handle ranges. Adding lists of integers should be trivial -- lists of complex things would be trickier.

@fruffy fruffy added the question This is a topic requesting clarification. label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a topic requesting clarification.
Projects
None yet
Development

No branches or pull requests

3 participants