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

deadalnix deadalnix at gmail.com
Thu May 19 22:20:06 UTC 2022


On Thursday, 19 May 2022 at 21:44:55 UTC, Walter Bright wrote:
> You never write things like:
>
>    a += (b < c);
>
> ? I do. And, as I remarked before, GPUs favor this style of 
> coding, as does SIMD code, as does cryto code.
>
> Hoping the compiler will transform the code into this style, if 
> it is not specified to, is just that, hope :-/
>
> Sometimes this style is not necessarily faster, either, even 
> though the user may desire it for crypto reasons.

That doesn't strike me as very convincing, because the compiler 
will sometime do the opposite too, so either way, at least for 
crypto, you have to look at the disassembly.

In our case, we even instrumentalized valgrind to cause a CI 
failure when such a branch occurs and run it on every patch.


More information about the Digitalmars-d mailing list