This is an archive of the discontinued LLVM Phabricator instance.

WebAssembly: floating-point comparisons
ClosedPublic

Authored by jfb on Aug 11 2015, 8:32 PM.

Details

Summary

D11924 implemented part of the floating-point comparisons, this patch implements the rest:

  • Tell ISelLowering that all booleans are either 0 or 1.
  • Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does).
  • Add tests for ord/uno.
  • Add tests for ueq/one/ult/ule/ugt/uge.
  • Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating.

Diff Detail

Event Timeline

jfb updated this revision to Diff 31899.Aug 11 2015, 8:32 PM
jfb retitled this revision from to WebAssembly: floating-point comparisons.
jfb updated this object.
jfb added a reviewer: sunfish.
jfb added a subscriber: llvm-commits.
sunfish accepted this revision.Aug 12 2015, 10:31 AM
sunfish edited edge metadata.
sunfish added inline comments.
lib/Target/WebAssembly/WebAssemblyInstrFloat.td
39

"32-bit" is clear from the code so isn't really critical to have in a comment. The thing not immediately obvious is that these are the "don't care" operators, and what's happening here is that we're mapping "don't care" operators onto supported operators.

This revision is now accepted and ready to land.Aug 12 2015, 10:31 AM
jfb updated this revision to Diff 31958.Aug 12 2015, 10:53 AM
jfb edited edge metadata.
  • Change comment.
This revision was automatically updated to reflect the committed changes.