raw
ffa_ch9_exodus.kv       1 ------------------------------------------------------------------------------
ffa_ch9_exodus.kv 2 ------------------------------------------------------------------------------
ffa_ch9_exodus.kv 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch9_exodus.kv 4 -- --
ffa_ch9_exodus.kv 5 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch9_exodus.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch9_exodus.kv 7 -- --
ffa_ch9_exodus.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch9_exodus.kv 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch9_exodus.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch9_exodus.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch9_exodus.kv 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch9_exodus.kv 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch9_exodus.kv 14 -- that you use - for any purpose. --
ffa_ch9_exodus.kv 15 -- --
ffa_ch9_exodus.kv 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch9_exodus.kv 17 ------------------------------------------------------------------------------
ffa_ch9_exodus.kv 18 ------------------------------------------------------------------------------
ffa_ch9_exodus.kv 19
ffa_ch9_exodus.kv 20 with Words; use Words;
ffa_ch9_exodus.kv 21
ffa_ch9_exodus.kv 22
ffa_ch9_exodus.kv 23 package W_Mul is
ffa_ch9_exodus.kv 24
ffa_ch9_exodus.kv 25 pragma Pure;
ffa_ch9_exodus.kv 26
ffa_ch9_exodus.kv 27 -- The bitness of a Half-Word
ffa_ch9_exodus.kv 28 HalfBitness : constant Positive := Bitness / 2;
ffa_ch9_exodus.kv 29 subtype HalfWord is Word range 0 .. 2**HalfBitness;
ffa_ch9_exodus.kv 30
ffa_ch9_exodus.kv 31 -- The number of bytes in a Half-Word
ffa_ch9_exodus.kv 32 HalfByteness : constant Positive := Byteness / 2;
ffa_ch9_exodus.kv 33
ffa_ch10_karatsub... 34 -- Multiply half-words X and Y, producing a Word-sized product (Iron)
ffa_ch10_karatsub... 35 function Mul_HalfWord_Iron(X : in HalfWord; Y : in HalfWord) return Word;
ffa_ch11_tuning_a... 36 pragma Inline_Always(Mul_HalfWord_Iron);
ffa_ch10_karatsub... 37
ffa_ch10_karatsub... 38 -- Multiply half-words X and Y, producing a Word-sized product (Egyptian)
ffa_ch10_karatsub... 39 function Mul_HalfWord_Soft(X : in HalfWord; Y : in HalfWord) return Word;
ffa_ch11_tuning_a... 40 pragma Inline_Always(Mul_HalfWord_Soft);
ffa_ch9_exodus.kv 41
ffa_ch9_exodus.kv 42 -- Get the bottom half of a Word
ffa_ch9_exodus.kv 43 function BottomHW(W : in Word) return HalfWord;
ffa_ch11_tuning_a... 44 pragma Inline_Always(BottomHW);
ffa_ch9_exodus.kv 45
ffa_ch9_exodus.kv 46 -- Get the top half of a Word
ffa_ch9_exodus.kv 47 function TopHW(W : in Word) return HalfWord;
ffa_ch11_tuning_a... 48 pragma Inline_Always(TopHW);
ffa_ch9_exodus.kv 49
ffa_ch10_karatsub... 50 -- Carry out X*Y mult, return lower word XY_LW and upper word XY_HW (Iron)
ffa_ch11_tuning_a... 51 procedure Mul_Word(X : in Word; Y : in Word;
ffa_ch11_tuning_a... 52 XY_LW : out Word; XY_HW : out Word);
ffa_ch11_tuning_a... 53 pragma Inline_Always(Mul_Word);
ffa_ch9_exodus.kv 54
ffa_ch12_karatsub... 55 -- Carry out X*X squaring, return lower word XX_LW and upper word XX_HW.
ffa_ch12_karatsub... 56 procedure Sqr_Word(X : in Word;
ffa_ch12_karatsub... 57 XX_LW : out Word;
ffa_ch12_karatsub... 58 XX_HW : out Word);
ffa_ch12_karatsub... 59 pragma Inline_Always(Sqr_Word);
ffa_ch12_karatsub... 60
ffa_ch9_exodus.kv 61 end W_Mul;