-
Notifications
You must be signed in to change notification settings - Fork 448
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
DPDK Backend: Fix binary operations with 1st operand is not same as dst operand #3209
Conversation
You can save one more instruction with
|
Han, the transformation also applies to other non-commutative operations like shift |
Ok, but my comment is still valid. |
return false; | ||
} | ||
|
||
bool isStandardMetadata(cstring name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is actually PSA-specific, not DPDK specific. So it should probably move to some common file eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about creating a utils.h/cpp under backends/common/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably move more stuff in such a place. But it should be in some directory named "psa".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific function is for both psa and pna metadata. Of course, we can split it up if we decide to go with arch-specific common utils.
Can this PR be merged if this does not need to be an immediate action?
Yes. Do you think, this case should be specially handled? Also, I don't see any instruction for negation here |
Thanks for the pointer. This looks fine. |
DPDK needs the binary operation to have 1st src operand same as dst operand.
Some cases with non commutative operations were not correctly handled by the existing transformation pass.
For example:
a = b << a
should be converted to