-
Notifications
You must be signed in to change notification settings - Fork 21
Floating Point Writing Fixes #45
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
base: main
Are you sure you want to change the base?
Floating Point Writing Fixes #45
Conversation
…d also adding the fcmp operation to the spec
@peter-campora When both integer and floating point extensions are enabled, should fptosi and sitofp be available? If not, is there another idiomatic way to convert between the values? |
@@ -696,7 +697,7 @@ additional runtime function must be available: | |||
|
|||
| Function | Signature | Description | | |||
| :---------------------------------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | |||
| __quantum__rt__float_record_output | `void(f64,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. | | |||
| __quantum__rt__float_record_output | `void(double,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. | |
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.
| __quantum__rt__float_record_output | `void(double,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. | | |
| __quantum__rt__double_record_output | `void(double,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. | |
If we assume that the idea is to use fpext
on smaller floating points and use only __quantum__rt__double_record_output
for half
, float
, and double
. It still leaves the question of how to output fp128
type. We may need another RT function for that.
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.
Alternatively, only 16/32/64-bit floating-point types should be supported.
!"float_computations", !"f32,f64"}`. The precision must be one of the LLVM | ||
recognized values (f16, f32, f64, f80, or f128), and classical computations on | ||
!"float_computations", !"float,double"}`. The precision must be one of the LLVM | ||
recognized values (`half (f16)`, `float (f32)`, and `double (f64)`), and classical computations on |
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 backticks should be for the recognized values (types).
recognized values (`half (f16)`, `float (f32)`, and `double (f64)`), and classical computations on | |
recognized values (`half` (16-bit), `float` (32-bit), and `double` (64-bit)), and classical computations on |
Alternatively, binary16, binary32 and binary64 in parentheses.
Addressing: #41