| ... | @@ -705,14 +705,7 @@ pub const Int = struct { | ... | @@ -705,14 +705,7 @@ pub const Int = struct { |
| 705 | const c1: Limb = @boolToInt(@addWithOverflow(Limb, a, carry.*, &r1)); | 705 | const c1: Limb = @boolToInt(@addWithOverflow(Limb, a, carry.*, &r1)); |
| 706 | | 706 | |
| 707 | // r2 = b * c | 707 | // r2 = b * c |
| 708 | // | 708 | const bc = DoubleLimb(math.mulWide(Limb, b, c)); |
| 709 | // We still use a DoubleLimb here since the @mulWithOverflow builtin does not | | |
| 710 | // return the carry and lower bits separately so we would need to perform this | | |
| 711 | // anyway to get the carry bits. The branch on the overflow case costs more than | | |
| 712 | // just computing them unconditionally and splitting. | | |
| 713 | // | | |
| 714 | // This could be a single x86 mul instruction, which stores the carry/lower in rdx:rax. | | |
| 715 | const bc = DoubleLimb(b) * DoubleLimb(c); | | |
| 716 | const r2 = @truncate(Limb, bc); | 709 | const r2 = @truncate(Limb, bc); |
| 717 | const c2 = @truncate(Limb, bc >> Limb.bit_count); | 710 | const c2 = @truncate(Limb, bc >> Limb.bit_count); |
| 718 | | 711 | |