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

deadalnix deadalnix at gmail.com
Thu May 27 12:50:52 UTC 2021


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).


More information about the Digitalmars-d mailing list