Time to move std.experimental.checkedint to std.checkedint ?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Mar 31 05:00:03 UTC 2021
On 3/31/21 12:59 AM, Walter Bright wrote:
> On 3/30/2021 9:08 PM, Andrei Alexandrescu wrote:
>> 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.
>
> The ldc:
> mov eax, edi
> imul eax, eax
> add eax, edi *
> add eax, 1 *
> ret
>
> * should be:
>
> lea eax,1[eax + edi]
>
> Let's try dmd -O:
>
> __D3lea6squareFiZi:
> mov EDX,EAX
> imul EAX,EAX
> lea EAX,1[EAX][EDX]
> ret
>
> Woo-hoo!
Yah, actually gdc uses lea as well: https://godbolt.org/z/Gb6416EKe
More information about the Digitalmars-d
mailing list