Repository navigation
[FIX][LLVM] Emit Float6 literals as integer payloads - #247
Open
DiadkoShmek wants to merge 1 commit into
Open
DiadkoShmek wants to merge 1 commit into
DiadkoShmek wants to merge 1 commit into
Conversation
Use nearest-even APFloat conversion and emit the six-bit payload as an LLVM integer constant, matching the representation of the other Select arm.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #104.
The LLVM backend represents both Float6 formats as
i6. Lowering a Float6 literal throughConstantFPtherefore uses the wrong LLVM constant kind, even though the other arm of aSelecthas the correct TIRx dtype.Convert the literal with the matching LLVM
APFloatsemantics using nearest-even rounding, then emit its bits as an integer constant. LLVM versions earlier than 19 do not have theseAPFloatformats, so report that limitation before materializing a constant.The two Float6 regressions fail on the locally built base
6569e2a181d686b2e0d1ba36c84786ff7c449c2dwith LLVM 19. On the rebuilt patch the compiled selects reproduce all 64 encodings and four midpoint checks per format, with exact results on the load arm too. The original typed tensor pattern was also checked with both branches on both formats. The final LLVM run passed 398 tests, including all 396 existing tests in the selected modules.AI assistance (Codex) was used for the patch, tests, and verification.