This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add FPToSIOp to Standard dialect.
ClosedPublic

Authored by hanchung on May 4 2020, 4:24 PM.

Details

Summary

Cast from a value interpreted as floating-point to the corresponding signed
integer value. Similar to an element-wise static_cast in C++, performs an
element-wise conversion operation.

Diff Detail

Event Timeline

hanchung created this revision.May 4 2020, 4:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2020, 4:24 PM
rriddle added inline comments.May 4 2020, 4:52 PM
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
1553

This is a little light on semantics, i.e., what is the rounding mode? towards zero? Can you beef this up? I would expect it to at least cover the same beats as the llvm equivalent:
https://llvm.org/docs/LangRef.html#fptosi-to-instruction

hanchung updated this revision to Diff 261971.May 4 2020, 5:21 PM

Address comments.

hanchung marked 2 inline comments as done.May 4 2020, 5:22 PM
hanchung added inline comments.
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
1553

I was referring it in the later sentence, but it would be great to point it out directly. Fixed.

hanchung marked an inline comment as done.May 4 2020, 11:29 PM
mravishankar accepted this revision.May 6 2020, 9:57 AM

Looks good to me. Please wait for River to accept.

This revision is now accepted and ready to land.May 6 2020, 9:57 AM
antiagainst accepted this revision.May 8 2020, 4:59 AM

Looks good to me. Please wait for River to accept.

I think River's concerns were addressed. He is OOO for the next week; let's land this and we can always fix afterwards if he has more concerns.

Looks good to me. Please wait for River to accept.

I think River's concerns were addressed. He is OOO for the next week; let's land this and we can always fix afterwards if he has more concerns.

Sounds good to me. @rriddle Feel free to ping me or leave comments here if there are other concerns. I'm happy to address them.

This revision was automatically updated to reflect the committed changes.