-
Notifications
You must be signed in to change notification settings - Fork 314
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
[CombToAIG] Add shl/shru/shrs lowering #8067
Conversation
This commit implements lowering for shift operations. They are currently lowered into mux-trees.
|
||
return nodes; | ||
} | ||
}; |
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.
There is a lot of if-else checks for left/right signed/unsigned shifts that contain most of the code of this pattern. Wouldn't it make sense to break it up into one pattern per shift op to make it more readable?
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.
Thanks, I refactored into different structs and used callbacks.
8c71278
to
67853ad
Compare
@maerhart Thank you for the great feedback! I totally agree it's nicer to just separate lowering patterns. I refactor the lowering pattern to use callbacks to get padding and extraction for each shifted amount. |
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.
That's a lot easier to read. Thanks!
This commit implements lowering for shift operations. They are currently lowered into mux-trees with a gate condition for out-of-bounds, e.g.: