This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support Bit-Preserving FP in F/D Extensions
ClosedPublic

Authored by lenary on Jun 5 2019, 6:52 AM.

Details

Summary

This allows some integer bitwise operations to instead be performed by
hardware fp instructions. This is correct because the RISC-V spec
requires the F and D extensions to use the IEEE-754 standard
representation, and fp register loads and stores to be bit-preserving.

This is tested against the soft-float ABI, but with hardware float
extensions enabled, so that the tests also ensure the optimisation also
fires in this case.

Event Timeline

lenary created this revision.Jun 5 2019, 6:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2019, 6:52 AM
lenary updated this revision to Diff 203137.Jun 5 2019, 6:55 AM
  • Update Testcase Comment
asb accepted this revision.Jun 5 2019, 9:56 PM

With the addition of nounwind to the tests, this looks good to me. Thanks!

llvm/test/CodeGen/RISCV/float-bit-preserving-dagcombines.ll
18

Please add the nounwind attribute to all of these functions, so this tests won't be affected when call frame info directives are emitted (update_llc_test_checks.py doesn't strip them out).

This revision is now accepted and ready to land.Jun 5 2019, 9:56 PM
lenary updated this revision to Diff 203317.Jun 6 2019, 2:47 AM
  • Add nounwind directives to testcases
lenary marked 2 inline comments as done.Jun 6 2019, 2:47 AM
lenary added inline comments.
llvm/test/CodeGen/RISCV/float-bit-preserving-dagcombines.ll
18

Sure, done!

lenary marked an inline comment as done.Jun 6 2019, 2:48 AM
This revision was automatically updated to reflect the committed changes.