Should you be able to initialize a float with a char?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri May 20 10:40:08 UTC 2022


On Friday, 20 May 2022 at 04:34:28 UTC, max haughton wrote:
> You still have "vector speed" in a sense. The emulated SIMD is 
> still good it's just not optimal, as I was saying previously 
> there are targets where even though you *have* (say) 256 bit 
> registers, you actually might want to use 128 bit ones in some 
> places because newer instructions tend to be emulated (in a 
> sense) so might not actually be worth the port pressure inside 
> the processor.

Yes, it is always better to allow for gradual optimization, going 
from generic target to increasingly specific as you need it. Case 
in point, WASM doesn't support SIMD, but the WASM engines (at 
least one of them) recognizes the output from LLVM builtin simd 
and reconstruct SIMD for the CPU from sequences of regular WASM 
instructions. So even if the target does not support SIMD you can 
get SIMD performance by using "generic" SIMD in the optimizer…

Things are getting much more complicated now for non-real time, 
just look at the Intel compiler that compiles to a mix of 
CPU/SIMD/GPU… That's where batch programming is heading…



More information about the Digitalmars-d mailing list