raw
ffa_ch5_egypt.kv        1 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 2 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch5_egypt.kv 4 -- --
ffa_ch5_egypt.kv 5 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch5_egypt.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch5_egypt.kv 7 -- --
ffa_ch5_egypt.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch5_egypt.kv 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch5_egypt.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch5_egypt.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch5_egypt.kv 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch5_egypt.kv 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch5_egypt.kv 14 -- that you use - for any purpose. --
ffa_ch5_egypt.kv 15 -- --
ffa_ch5_egypt.kv 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch5_egypt.kv 17 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 18 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 19
ffa_ch5_egypt.kv 20 with FZ_Type; use FZ_Type;
ffa_ch5_egypt.kv 21
ffa_ch5_egypt.kv 22
ffa_ch5_egypt.kv 23 package FZ_Mul is
ffa_ch5_egypt.kv 24
ffa_ch5_egypt.kv 25 pragma Pure;
ffa_ch5_egypt.kv 26
ffa_ch11_tuning_a... 27 -- Karatsuba Threshhold - at or below this many Words, we use Comba mult.
ch11_unrolled_asm... 28 -- Edit the Karatsuba_Thresh in x86_64_comba.s as well after changing this
ch11_unrolled_asm... 29 -- value.
ch11_unrolled_asm... 30 Karatsuba_Thresh : constant Indices := 32;
ffa_ch10_karatsub... 31
ffa_ch10_karatsub... 32 -- Multiply. (CAUTION: UNBUFFERED)
ffa_ch11_tuning_a... 33 procedure FZ_Multiply_Unbuffered(X : in FZ;
ffa_ch11_tuning_a... 34 Y : in FZ;
ffa_ch11_tuning_a... 35 XY : out FZ);
ffa_ch11_tuning_a... 36 pragma Inline_Always(FZ_Multiply_Unbuffered);
ffa_ch10_karatsub... 37
ch11_unrolled_asm... 38 -- Comba's multiplier in assembly (fastpath). (CAUTION: UNBUFFERED)
ch11_unrolled_asm... 39 procedure FZ_Mul_Comba_Fast(X : in FZ;
ch11_unrolled_asm... 40 Y : in FZ;
ch11_unrolled_asm... 41 XY : out FZ);
ch11_unrolled_asm... 42 pragma Inline_Always(FZ_Mul_Comba_Fast);
ch11_unrolled_asm... 43
ffa_ch10_karatsub... 44 -- Comba's multiplier. (CAUTION: UNBUFFERED)
ffa_ch9_exodus.kv 45 procedure FZ_Mul_Comba(X : in FZ;
ffa_ch9_exodus.kv 46 Y : in FZ;
ffa_ch10_karatsub... 47 XY : out FZ);
ffa_ch11_tuning_a... 48 pragma Inline_Always(FZ_Mul_Comba);
ffa_ch10_karatsub... 49
ffa_ch10_karatsub... 50 -- Karatsuba's Multiplier. (CAUTION: UNBUFFERED)
ffa_ch10_karatsub... 51 procedure Mul_Karatsuba(X : in FZ;
ffa_ch10_karatsub... 52 Y : in FZ;
ffa_ch11_tuning_a... 53 XY : out FZ)
ffa_ch11_tuning_a... 54 with Pre => X'Length = Y'Length and
ffa_ch11_tuning_a... 55 XY'Length = (X'Length + Y'Length) and
ffa_ch11_tuning_a... 56 X'Length mod 2 = 0;
ffa_ch10_karatsub... 57 -- CAUTION: Inlining prohibited for Mul_Karatsuba !
ffa_ch10_karatsub... 58
ffa_ch10_karatsub... 59 -- Multiplier. Preserves the inputs.
ffa_ch11_tuning_a... 60 procedure FZ_Multiply_Buffered(X : in FZ;
ffa_ch11_tuning_a... 61 Y : in FZ;
ffa_ch11_tuning_a... 62 XY_Lo : out FZ;
ffa_ch11_tuning_a... 63 XY_Hi : out FZ);
ffa_ch11_tuning_a... 64 pragma Inline_Always(FZ_Multiply_Buffered);
ffa_ch5_egypt.kv 65
ffa_ch5_egypt.kv 66 end FZ_Mul;