ffa_ch1_genesis         1 ------------------------------------------------------------------------------
ffa_ch1_genesis 2 ------------------------------------------------------------------------------
ffa_ch1_genesis 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch1_genesis 4 -- --
ffa_ch1_genesis 5 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch1_genesis 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch1_genesis 7 -- --
ffa_ch1_genesis 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch1_genesis 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch1_genesis 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch1_genesis 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch1_genesis 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch1_genesis 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch1_genesis 14 -- that you use - for any purpose. --
ffa_ch1_genesis 15 -- --
ffa_ch1_genesis 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch1_genesis 17 ------------------------------------------------------------------------------
ffa_ch1_genesis 18 ------------------------------------------------------------------------------
ffa_ch1_genesis 19
ffa_ch1_genesis 20 with Words; use Words;
ffa_ch1_genesis 21
ffa_ch1_genesis 22 -- For some peculiar reason, the Ada standards group made
ffa_ch1_genesis 23 -- the fundamental Shift and Rotate bitwise ops into ~optional~ components!
ffa_ch1_genesis 24
ffa_ch1_genesis 25 -- However on GNAT we can force them to exist, as described in:
ffa_ch1_genesis 26 -- https://gcc.gnu.org/onlinedocs/gnat_rm/Shifts-and-Rotates.html
ffa_ch1_genesis 27
ffa_ch1_genesis 28 -- On a non-GNAT compiler, you're own your own.
ffa_ch1_genesis 29
ffa_ch1_genesis 30 package W_Shifts is
ffa_ch1_genesis 31
ffa_ch1_genesis 32 pragma Pure;
ffa_ch1_genesis 33
ffa_ch1_genesis 34 function Shift_Left
ffa_ch1_genesis 35 (Value : Word;
ffa_ch1_genesis 36 Amount : Natural)
ffa_ch1_genesis 37 return Word;
ffa_ch1_genesis 38 pragma Import(Intrinsic, Shift_Left);
ffa_ch1_genesis 39
ffa_ch1_genesis 40 function Shift_Right
ffa_ch1_genesis 41 (Value : Word;
ffa_ch1_genesis 42 Amount : Natural)
ffa_ch1_genesis 43 return Word;
ffa_ch1_genesis 44 pragma Import(Intrinsic, Shift_Right);
ffa_ch1_genesis 45
ffa_ch1_genesis 46 function Rotate_Left
ffa_ch1_genesis 47 (Value : Word;
ffa_ch1_genesis 48 Amount : Natural)
ffa_ch1_genesis 49 return Word;
ffa_ch1_genesis 50 pragma Import(Intrinsic, Rotate_Left);
ffa_ch1_genesis 51
ffa_ch1_genesis 52 function Rotate_Right
ffa_ch1_genesis 53 (Value : Word;
ffa_ch1_genesis 54 Amount : Natural)
ffa_ch1_genesis 55 return Word;
ffa_ch1_genesis 56 pragma Import(Intrinsic, Rotate_Right);
ffa_ch1_genesis 57
ffa_ch1_genesis 58 end W_Shifts;