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

Walter Bright newshound2 at digitalmars.com
Fri May 20 03:42:06 UTC 2022


On 5/19/2022 3:51 PM, max haughton wrote:
> Good compilers can actually print a report of why they didn't vectorize things. 

I guess Manu never used good compilers :-)

Manu asked that a report be given in the form of an error message. Since it's 
what he did all day, I gave that a lot of weight.

Also, the point was Manu could then adjust the code with version statements to 
write loops that worked best on each target, rather than suffer unacceptable 
degradation from the fallback emulations.


> If you're writing SIMD code without dumping the assembler anyway you're not 
> paying enough attention. If you're going to go to all that effort you're going 
> to be profiling the code, and any good profiler will show you the disassembly 
> alongside. Maybe it doesn't scale in some minute sense but in practice I don't 
> think it makes that much difference because you have to either do the work 
> anyway, or it doesn't matter.

Manu did this all day and I gave a lot of weight to what he said would work best 
for him. If you're writing vector operations, for a vector instruction set, the 
compiler should give errors if it cannot do it. Emulation code is not acceptable.

I advocate disassembling, too, (remember the -vasm switch?) but disassembling 
and inspecting manually does not scale at all.


> LDC doesn't do this, GCC does. I don't think it actually matters, whereas if 
> you're consuming a library from someone who didn't do the SIMD parts properly, 
> it will at very least compile with LDC.

At least compiling is not good enough if you're expecting vector speed.


More information about the Digitalmars-d mailing list