mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
[druntime] core.int128: Add 64-bit mul() overload and optimize via inline asm on x86_64
This commit is contained in:
parent
6c160b78d5
commit
b390c7ec13
2 changed files with 69 additions and 6 deletions
14
changelog/druntime.int128.dd
Normal file
14
changelog/druntime.int128.dd
Normal file
|
@ -0,0 +1,14 @@
|
|||
`core.int128`: Add `mul` and `udivmod` overloads for 64-bit operands
|
||||
|
||||
These map to a single x86_64 instruction and have accordingly been optimized via inline assembly.
|
||||
|
||||
---
|
||||
import core.int128;
|
||||
|
||||
ulong a, b;
|
||||
Cent product128 = mul(a, b);
|
||||
|
||||
ulong divisor64 = …;
|
||||
ulong modulus64;
|
||||
ulong quotient64 = udivmod(product128, divisor64, modulus64);
|
||||
---
|
Loading…
Add table
Add a link
Reference in a new issue