-
Notifications
You must be signed in to change notification settings - Fork 15
feat(hugr-llvm): Emit rounding operation for FloatOps::fround extension ops
#2949
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
Open
maximilianruesch
wants to merge
3
commits into
main
Choose a base branch
from
mr/feat/support-emitting-float-round
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
hugr-llvm/src/extension/snapshots/hugr_llvm__extension__float__test__fround@llvm21.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| source: hugr-llvm/src/extension/float.rs | ||
| assertion_line: 234 | ||
| expression: mod_str | ||
| --- | ||
| ; ModuleID = 'test_context' | ||
| source_filename = "test_context" | ||
|
|
||
| define internal double @_hl.main.1(double %0) { | ||
| alloca_block: | ||
| br label %entry_block | ||
|
|
||
| entry_block: ; preds = %alloca_block | ||
| %1 = call double @llvm.round.f64(double %0) | ||
| ret double %1 | ||
| } | ||
|
|
||
| ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) | ||
| declare double @llvm.round.f64(double) #0 | ||
|
|
||
| attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } |
30 changes: 30 additions & 0 deletions
30
...src/extension/snapshots/hugr_llvm__extension__float__test__fround@pre-mem2reg@llvm21.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| source: hugr-llvm/src/extension/float.rs | ||
| assertion_line: 234 | ||
| expression: mod_str | ||
| --- | ||
| ; ModuleID = 'test_context' | ||
| source_filename = "test_context" | ||
|
|
||
| define internal double @_hl.main.1(double %0) { | ||
| alloca_block: | ||
| %"0" = alloca double, align 8 | ||
| %"2_0" = alloca double, align 8 | ||
| %"4_0" = alloca double, align 8 | ||
| br label %entry_block | ||
|
|
||
| entry_block: ; preds = %alloca_block | ||
| store double %0, ptr %"2_0", align 8 | ||
| %"2_01" = load double, ptr %"2_0", align 8 | ||
| %1 = call double @llvm.round.f64(double %"2_01") | ||
| store double %1, ptr %"4_0", align 8 | ||
| %"4_02" = load double, ptr %"4_0", align 8 | ||
| store double %"4_02", ptr %"0", align 8 | ||
| %"03" = load double, ptr %"0", align 8 | ||
| ret double %"03" | ||
| } | ||
|
|
||
| ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) | ||
| declare double @llvm.round.f64(double) #0 | ||
|
|
||
| attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } |
Oops, something went wrong.
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.
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.
The thing that worries me here is that
froundappears to be unary, whereas all the others seem to be binary (taking two floats)....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.
This is not true,
fnegis also unary and appears in the test cases.