feat(hugr-llvm): Emit rounding operation for FloatOps::fround extension ops#2949
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2949 +/- ##
==========================================
- Coverage 83.84% 83.83% -0.01%
==========================================
Files 267 267
Lines 52923 52933 +10
Branches 46854 46864 +10
==========================================
+ Hits 44371 44379 +8
Misses 6283 6283
- Partials 2269 2271 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
acl-cqc
left a comment
There was a problem hiding this comment.
Generally this looks fine, but I'm trying to understand the connection to Quantinuum/guppylang#1561. This PR implies that the current situation is that we can't compile rounding at all, even without an extra precision argument?
| #[case::fmul(FloatOps::fmul)] | ||
| #[case::fdiv(FloatOps::fdiv)] | ||
| #[case::fpow(FloatOps::fpow)] | ||
| #[case::fround(FloatOps::fround)] |
There was a problem hiding this comment.
The thing that worries me here is that fround appears to be unary, whereas all the others seem to be binary (taking two floats)....
There was a problem hiding this comment.
This is not true, fneg is also unary and appears in the test cases.
## 🤖 New release * `hugr-model`: 0.26.1 -> 0.27.0 (✓ API compatible changes) * `hugr-core`: 0.26.1 -> 0.27.0 (✓ API compatible changes) * `hugr-llvm`: 0.26.1 -> 0.27.0 (✓ API compatible changes) * `hugr-persistent`: 0.5.1 -> 0.6.0 (✓ API compatible changes) * `hugr`: 0.26.1 -> 0.27.0 (✓ API compatible changes) * `hugr-cli`: 0.26.1 -> 0.27.0 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr-model` <blockquote> ## [0.26.0](hugr-model-v0.25.7...hugr-model-v0.26.0) - 2026-03-16 ### Testing - Replace model text snapshots with roundtrip tests ([#2933](#2933)) - Add missing width arg in model-call example ([#2945](#2945)) </blockquote> ## `hugr-core` <blockquote> ## [0.27.0](hugr-core-v0.26.1...hugr-core-v0.27.0) - 2026-03-31 ### Bug Fixes - Use valid identifiers when constructing AST model ([#2973](#2973)) - Panic on constant folding with opaque consts ([#2986](#2986)) ### New Features - *(py)* Allow missing ext versions ExtensionDesc metadata ([#2979](#2979)) - [**breaking**] Deprecate JSON serialization format ([#2991](#2991)) - [**breaking**] Bump public `portgraph` dependency to `0.16.0` ([#2998](#2998)) ### Refactor - Simplify validate_subtree ([#2969](#2969)) - further cleanups to SiblingSubgraph + generalize over trait HugrConvexChecker ([#2957](#2957)) </blockquote> ## `hugr-llvm` <blockquote> ## [0.27.0](hugr-llvm-v0.26.1...hugr-llvm-v0.27.0) - 2026-03-31 ### New Features - *(hugr-llvm)* Emit rounding operation for `FloatOps::fround` extension ops ([#2949](#2949)) </blockquote> ## `hugr-persistent` <blockquote> ## [0.6.0](hugr-persistent-v0.5.1...hugr-persistent-v0.6.0) - 2026-03-31 ### New Features - [**breaking**] Deprecate JSON serialization format ([#2991](#2991)) </blockquote> ## `hugr` <blockquote> ## [0.27.0](hugr-v0.26.1...hugr-v0.27.0) - 2026-03-31 ### Bug Fixes - Use valid identifiers when constructing AST model ([#2973](#2973)) - Panic on constant folding with opaque consts ([#2986](#2986)) ### New Features - *(py)* Allow missing ext versions ExtensionDesc metadata ([#2979](#2979)) - [**breaking**] Bump public `portgraph` dependency to `0.16.0` ([#2998](#2998)) - [**breaking**] Deprecate JSON serialization format ([#2991](#2991)) ### Refactor - Simplify validate_subtree ([#2969](#2969)) - further cleanups to SiblingSubgraph + generalize over trait HugrConvexChecker ([#2957](#2957)) </blockquote> ## `hugr-cli` <blockquote> ## [0.27.0](hugr-cli-v0.26.1...hugr-cli-v0.27.0) - 2026-03-31 ### Bug Fixes - Do extension resolution on exts loaded by hugr-cli ([#2987](#2987)) ### New Features - *(py)* Allow missing ext versions ExtensionDesc metadata ([#2979](#2979)) - [**breaking**] Deprecate JSON serialization format ([#2991](#2991)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: Agustín Borgna <[email protected]>
Adds
FloatOps::froundLLVM lowering support. This is to add support for rounding operations in Selene, connected to Quantinuum/guppylang#1561.I am a bit unsure how the tests work, but simply adding another test case in line with the existing ones seems to work fine.