M1 10x faster than Intel at integral division, throughput one 64-bit divide in two cycles

Max Haughton maxhaton at gmail.com
Thu May 27 17:20:41 UTC 2021


On Thursday, 27 May 2021 at 12:50:52 UTC, deadalnix wrote:
> On Thursday, 27 May 2021 at 08:46:20 UTC, Manu wrote:
>> It's a strange thing to optimise... I seem to do an integer 
>> divide so infrequently, that I can't imagine a measurable 
>> improvement in most code I've ever written if it were 
>> substantially faster. I feel like I stopped doing frequent 
>> integer divides right about the same time computers got 
>> FPU's...
>>
>
> There are a few places where it matters. Some cryptographic 
> operations for instance, or data compression/decompression. 
> Memory allocators tend to rely on it, not heavily, but the rest 
> of the system depends heavily on them.
>
> More generally, the problem with x86 divide isn't it's perf per 
> se, but the fact that it is not pipelined on Intel machines (no 
> idea about AMD).

Not pipelined!?

https://www.uops.info/table.html?search=idiv&cb_lat=on&cb_tp=on&cb_uops=on&cb_ports=on&cb_SKL=on&cb_ZEN3=on&cb_measurements=on&cb_doc=on&cb_base=on


More information about the Digitalmars-d mailing list