-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add tket2
feature and lowerings for tket2.rotation
extension
#100
Conversation
tket2
feature and lowerings for angle
extension
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 83.31% 83.54% +0.22%
==========================================
Files 25 26 +1
Lines 3758 4016 +258
Branches 3758 4016 +258
==========================================
+ Hits 3131 3355 +224
- Misses 331 343 +12
- Partials 296 318 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/custom/angle.rs
Outdated
|
||
/// A codegen extension for the `tket2.angle` extension. | ||
/// | ||
/// We lower [ANGLE_CUSTOM_TYPE] to the same [IntType] to which [USIZE_T] is |
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.
Any reason not to settle on 64-bit integers rather than USIZE_T
, so as to be platform-independent?
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 ops are defined to take USIZE_T arguments, so they are not platform independent.
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.
On reflection the choices are:
- always use USIZE_T: all ops are platform dependent
- use either i64 or a configurable int type: only anew is platform dependent
will change
Hi @doug-q could you resolve the conflict in |
9d043e8
to
c5be2e7
Compare
tket2
feature and lowerings for angle
extensiontket2
feature and lowerings for tket2.rotation
extension
src/custom/rotation.rs
Outdated
// As we always normalise angles to have a log_denom of | ||
// angle_width, we do not need the log_denom. |
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.
Obsolete comment.
// let rads_ok = { | ||
// let i32_ty = self.0.iw_context().i32_type(); | ||
// let builder = self.0.builder(); | ||
// let is_fpclass = get_intrinsic(module, "llvm.is.fpclass", [float_ty.as_basic_type_enum(), i32_ty.as_basic_type_enum()])?; | ||
// // Here we pick out the following floats: | ||
// // - bit 0: Signalling Nan | ||
// // - bit 3: Negative normal | ||
// // - bit 8: Positive normal | ||
// let test = i32_ty.const_int((1 << 0) | (1 << 3) | (1 << 8), false); | ||
// builder | ||
// .build_call(is_fpclass, &[rads.into(), test.into()], "")? | ||
// .try_as_basic_value() | ||
// .left() | ||
// .ok_or(anyhow!("llvm.is.fpclass has no return value"))? | ||
// .into_int_value() | ||
// }; |
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.
Delete commented code?
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 one is referenced in the comment above. this is the llvm-15 version of the code for 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.
Ah I see.
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
280af9f
to
bcdf0ba
Compare
## 🤖 New release * `hugr-llvm`: 0.4.0 -> 0.5.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.5.0](v0.4.0...v0.5.0) - 2024-09-16 ### New Features - Add emitters for int <-> float/usize conversions ([#94](#94)) - [**breaking**] array ops ([#96](#96)) - Add conversions itobool, ifrombool ([#101](#101)) - Add `tket2` feature and lowerings for `tket2.rotation` extension ([#100](#100)) ### Testing - Add execution test framework ([#97](#97)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/).
No description provided.