Do you think if statement as expression would be nice to have in D?

Bruce Carneal bcarneal at gmail.com
Wed Jun 8 00:55:07 UTC 2022


On Tuesday, 7 June 2022 at 21:48:10 UTC, Guillaume Piolat wrote:
> On Tuesday, 7 June 2022 at 21:09:08 UTC, Bruce Carneal wrote:
>>
>> 3) It's measurably (slightly) faster in many instances (it 
>> helps that I can shape the operand flows for this app)
>
> Depends on the loop, for example LLVM can vectorize llvm_sqrt
> https://d.godbolt.org/z/6xaTKnn9z
>
> but not llvm_exp / llvm_cos / llvm_sin / llvm_log
>
> https://d.godbolt.org/z/Pc34967vc
>
> for such loops I have to go __vector

Yes.  I too definitely want __vector as a backstop when autovec 
isn't up to the job and SIMT math is not available.  I also reach 
for __vector when conditionals become problematic.



More information about the Digitalmars-d mailing list