-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FXML-4501] Lower arith.andi, arith.ori, arith.shli, arith.shrsi, arith.shrui, arith.xori to emitc #165
Conversation
6323607
to
51ea141
Compare
C++ about shift operations:
and the MLIR shift ops say
Here, |
Alternatively, checking the |
Ah, those flags don't constraint the shift amount. A better description of them is in the LLVM spec: https://llvm.org/docs/LangRef.html#shl-instruction |
Static checking is only possible when the amount of the right shift is statically known, which practically means a constant. So, in the general case we'll need to introduce runtime checks. However, I'm not sure of how to deal with anything that relies on poison values. There's no poison semantics in C/C++, and I have too little understanding of the differences between poison and undefined behavior to actually know what to do. |
In the runtime check, I resorted to using |
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.
LGTM
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.
LGTM
No description provided.