Time to move std.experimental.checkedint to std.checkedint ?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Mar 31 04:08:02 UTC 2021


On 3/31/21 12:04 AM, Vladimir Panteleev wrote:
> On Wednesday, 31 March 2021 at 04:01:48 UTC, Andrei Alexandrescu wrote:
>> On 3/30/21 11:40 PM, Vladimir Panteleev wrote:
>>> On Wednesday, 31 March 2021 at 03:30:00 UTC, Andrei Alexandrescu wrote:
>>>> FWIW I toyed with this but don't know what optimization flags zig 
>>>> takes: https://godbolt.org/z/vKds1c8WY
>>>
>>> Typing --help in the flags box answers that question :) And the 
>>> answer is "-O ReleaseFast":
>>> https://godbolt.org/z/1WK6W7TM9
>>
>> Cool, thanks. I was looking for "the fastest code that still has the 
>> checks", how to get that?
> 
> Right, sorry.
> 
> --help says:
> 
>      ReleaseFast             Optimizations on, safety off
>      ReleaseSafe             Optimizations on, safety on
> 
> So, maybe that.
> 
> The ReleaseSafe code looks pretty good, it generates a "jo" instruction: 
> https://godbolt.org/z/cYcscf1W5
> 
> Who knows what it actually looks like in CPU microcode, though :)

Not much to write home about. The jumps scale linearly with the number 
of primitive operations:

https://godbolt.org/z/r3sj1T4hc

That's not going to be a speed demon.


More information about the Digitalmars-d mailing list