Skip to content
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

Conversion to/from float #1

Open
nemequ opened this issue Feb 18, 2020 · 3 comments
Open

Conversion to/from float #1

nemequ opened this issue Feb 18, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@nemequ
Copy link

nemequ commented Feb 18, 2020

It would be nice to be able to convert to/from standard floats. Generically if possible, but at least if the system is using IEEE 754 (__STDC_IEC_559__ should be defined, though TBH I wouldn't be surprised if an MSVC exception is necessary).

FWIW, I'm considering this as a way to implement the float16_t stuff in NEON portably in SIMDe. I'm going to open a couple more issues, I just wanted you to understand the perspective I'm looking at it from since you seem to be focused on retrocomputing and so probably have different things in mind. If you're not interested in supporting my use case that's fine; please feel free to just close the issues if that's the case.

@artyom-beilis artyom-beilis self-assigned this Feb 18, 2020
@artyom-beilis artyom-beilis added the enhancement New feature or request label Feb 18, 2020
@artyom-beilis
Copy link
Owner

Yes you are right. I indeed need to expose to/from float at least for C API

@artyom-beilis
Copy link
Owner

Just for the record - it isn't high performance library - there are good libraries for c++ like half.hpp and for most modern systems it is better to do f16 math via conversion to float32 (with exception of arm that supports float16 natively in simd)

@nemequ
Copy link
Author

nemequ commented Feb 18, 2020

Yes, converting to float is my plan, I was just thinking this could be interesting if all that's available is softfp, but obviously I'd have to do some benchmarking. Also, C++ isn't an option; it would be nice to have something available in C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants