-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature] Add native support for other floating point types #1864
Comments
What do you mean by having access to half floats and the other types? Math co-processors only support floats and doubles. 80 bit floats are only supported internally to ensure calculations have full precision results. Wouldn't support for types other than floats and doubles require that operations that use those types would have to be emulated? Would that still be considered as native support? From what I remember, and I may be wrong about this, all the types that ImHex supports are gcc supported types. If you encounter floating point numbers that are not natively supported you can calculate their values with the help of the ieee 754 floating point encoder and decoder tool provided in View>Tools which allows you to find how ieee 754 defines floating point numbers for any number of bytes, exponent size and mantissa size combination. Once you know how the numbers are encoded you would need to write functions to do the actual conversion but the tool makes it easy to write such functions not only for decoding but for encoding as well. |
I should have said 'built-in' instead of 'native'. The intention being to allow built-in access to the other IEEE-754 binary interchange formats (adding 16-bit and 128-bit, at a minimum) without needing to define / use custom patterns for them in PL - like the float16.pat already available. That is to say, this request is less about platform support and more about tool support and consistency I can see that Data Inspector already has import ieee_754;
// this specifically could possibly be pre-defined in ieee_754 as fp256
// (to disambiguate from any potential future f256 being added to built-in)
using binary256 = ieee_754::binary<19, 236>; I put this request here, instead of under either of the the PL focused repos, to focus more on ImHex as a whole
P.S. I did list 80-bit originally, because the linked gcc page made specific mention of supporting __float80 (aka _Float64x apparently), but admit that it is probably esoteric enough from a |
I plan on adding the remaining built-in float types once there's wide support for C++23's stdfloat. Once that's there, I'll leave There's a 16 bit float implementation in the type library right now that can be used but that's of course not as performant as doing it natively. I would however still be open to have a generic floating point implementation in the type library as well. |
What feature would you like to see?
In order to have closer parity with the existing supported integer types, it would be helpful to have access to other common floating point types such as 16 (half-precision), 80, and 128-bit (e.g. long double) types. These could then also have typedefs such as f16, f32, f64, f80, f128 (for parity with e.g. u128, etc)
This extended support would also apply to the PatternLanguage, but raising the feature request here as the editor as a whole also benefits from the suggestion.
Given how many variations there are (primarily differing only in exponent and mantissa lengths), perhaps a generic / templated type would also be feasible.
How will this feature be useful to you and others?
Request Type
Additional context?
No response
The text was updated successfully, but these errors were encountered: