-
Notifications
You must be signed in to change notification settings - Fork 183
[CIR] Implement __builtin_ia32_cmpnleps/cmpnlepd #1893
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
Conversation
|
|
tommymcm
left a comment
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 are some soundness issues here. I don't think making VecCmpOp ordered or unordered is the solution, it goes agains the semantics of C/C++.
- Implement createVecCompare, getCIRIntOrFloatBitWidth, getVectorFCmpIR helper for VecCmp op creation. - Add clang/test/CIR/CodeGen/builtin-fcmp-sse.c test.
21aab62 to
a9d273e
Compare
…dered optimization
tommymcm
left a comment
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.
Here's some pointers for matching the skeleton.
bcardosolopes
left a comment
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 with one minot nit.
thanks for your patience!
This PR adds supports for __builtin_ia32_cmpnltps/cmpnltpd. Depends on #1893.
Fixes #1818
VecCmp op creation.
in OG, there is a sext from bool to int before casting to float vector since fcmp's result in llvm ir is boolean-like, while VecCmpOp in CIR returns int in the form of 0 or -1.
There is also a boolean
shouldInvertin CIR since CIR doesn't contain optimized unordered comparison, for example: OLE is the inverse predicate of UGT. So if we need UGT, we have to pass in OLE andshouldInvert = true