- A819415BC60308FE0B550EEE13DA2D6D4819064E4D336E9766E65A63768AEF24AC7DB9F5AC238725587F4660C2992AE17ABC85EF5047D62BEB04BA2C12D1172A+ 81A6C2C4CE7F029E8973E0A4FF0632AD921D7F4BDBCD7BA4D48089DDBE69E90EA427434E5EFCD5A5588C66BBF9DCB257D56D463049028CF5E093795FA7EAEDE9ffa/libffa/fz_mul.adb(25 . 6)(25 . 24)
22
23 package body FZ_Mul is
24
25 -- Comba's multiplier fastpath. (CAUTION: UNBUFFERED)
26 procedure FZ_Mul_Comba_Fast(X : in FZ;
27 Y : in FZ;
28 XY : out FZ)
29 is
30 procedure Asm_Comba(X : in FZ;
31 Y : in FZ;
32 XY : out FZ;
33 L : in Word_Index);
34 pragma Import (C, Asm_Comba, "x86_64_comba_unrolled");
35 begin
36 pragma Assert(X'Length = Karatsuba_Thresh and
37 Y'Length = Karatsuba_Thresh and
38 XY'Length = 2*Karatsuba_Thresh);
39 Asm_Comba(X, Y, XY, X'Length);
40 end FZ_Mul_Comba_Fast;
41
42
43 -- Comba's multiplier. (CAUTION: UNBUFFERED)
44 procedure FZ_Mul_Comba(X : in FZ;
45 Y : in FZ;
(235 . 11)(253 . 14)
47
48 begin
49
50 if L <= Karatsuba_Thresh then
51
52 -- Base case:
53 FZ_Mul_Comba(X, Y, XY);
54 if L = Karatsuba_Thresh then
55
56 -- Optimized case:
57 FZ_Mul_Comba_Fast(X, Y, XY);
58 elsif L < Karatsuba_Thresh then
59
60 -- Base case
61 FZ_Mul_Comba(X, Y, XY);
62 else
63
64 -- Recursive case: