The conversions u/int64_t to float64/32_t are not vectorisized if no HW-support (eg AVX512) available. But we can do that manually https://stackoverflow.com/questions/41144668/how-to-efficiently-perform-double-int64-conversions-with-sse-avx In the case u/int64_t -> float32_t i first convert to float64_t and then to float32_t. There might be a better way to implement this. With HW-support the standard implementation is of course faster. https://godbolt.org/z/WTa663PrK thx Gero
I suspect there is a dup of this bug already.
That will be right. I had reported something similar many years ago - but it was not fixed. thx Gero
More like a target issue. Note that u/int64_t when it doesn't fit float32_t eventually would need to raise a different exception than the float64_t -> float32_t Inf result does so the trick might not be fully IEEE conforming.
The link you've provided is about how to do it with severe limitations. So, we could do it that way only if the ranger tells us the integral (or floating point) values are in a certain range (+ -ffast-math or similar that you don't care about infinities etc.).
Sorry, I missed the full sequences later on for {,u}int64_t -> double, that is something to look at first I guess.