raw
ffa_ch3_shifts.kv       1 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 2 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch3_shifts.kv 4 -- --
ffa_ch3_shifts.kv 5 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch3_shifts.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch3_shifts.kv 7 -- --
ffa_ch3_shifts.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch3_shifts.kv 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch3_shifts.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch3_shifts.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch3_shifts.kv 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch3_shifts.kv 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch3_shifts.kv 14 -- that you use - for any purpose. --
ffa_ch3_shifts.kv 15 -- --
ffa_ch3_shifts.kv 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch3_shifts.kv 17 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 18 ------------------------------------------------------------------------------
ffa_ch3_shifts.kv 19
ffa_ch2_logicals.kv 20 package body FZ_BitOp is
ffa_ch2_logicals.kv 21
ffa_ch2_logicals.kv 22 -- Result := X & Y
ffa_ch2_logicals.kv 23 procedure FZ_And(X : in FZ; Y : in FZ; Result : out FZ) is
ffa_ch2_logicals.kv 24 begin
ffa_ch2_logicals.kv 25 for i in X'Range loop
ffa_ch2_logicals.kv 26 Result(i) := X(i) and Y(i);
ffa_ch2_logicals.kv 27 end loop;
ffa_ch2_logicals.kv 28 end FZ_And;
ffa_ch2_logicals.kv 29 pragma Inline_Always(FZ_And);
ffa_ch2_logicals.kv 30
ffa_ch2_logicals.kv 31
ffa_ch2_logicals.kv 32 -- N := N & W, W is a word
ffa_ch2_logicals.kv 33 procedure FZ_And_W(N : in out FZ; W : in Word) is
ffa_ch2_logicals.kv 34 begin
ffa_ch2_logicals.kv 35 N(N'First) := N(N'First) and W;
ffa_ch2_logicals.kv 36 end FZ_And_W;
ffa_ch2_logicals.kv 37 pragma Inline_Always(FZ_And_W);
ffa_ch2_logicals.kv 38
ffa_ch2_logicals.kv 39
ffa_ch2_logicals.kv 40 -- Result := X | Y
ffa_ch2_logicals.kv 41 procedure FZ_Or(X : in FZ; Y : in FZ; Result : out FZ) is
ffa_ch2_logicals.kv 42 begin
ffa_ch2_logicals.kv 43 for i in X'Range loop
ffa_ch2_logicals.kv 44 Result(i) := X(i) or Y(i);
ffa_ch2_logicals.kv 45 end loop;
ffa_ch2_logicals.kv 46 end FZ_Or;
ffa_ch2_logicals.kv 47 pragma Inline_Always(FZ_Or);
ffa_ch2_logicals.kv 48
ffa_ch2_logicals.kv 49
ffa_ch2_logicals.kv 50 -- N := N | W, W is a word
ffa_ch2_logicals.kv 51 procedure FZ_Or_W(N : in out FZ; W : in Word) is
ffa_ch2_logicals.kv 52 begin
ffa_ch2_logicals.kv 53 N(N'First) := N(N'First) or W;
ffa_ch2_logicals.kv 54 end FZ_Or_W;
ffa_ch2_logicals.kv 55 pragma Inline_Always(FZ_Or_W);
ffa_ch2_logicals.kv 56
ffa_ch2_logicals.kv 57
ffa_ch2_logicals.kv 58 -- Result := X ^ Y
ffa_ch2_logicals.kv 59 procedure FZ_Xor(X : in FZ; Y : in FZ; Result : out FZ) is
ffa_ch2_logicals.kv 60 begin
ffa_ch2_logicals.kv 61 for i in X'Range loop
ffa_ch2_logicals.kv 62 Result(i) := X(i) xor Y(i);
ffa_ch2_logicals.kv 63 end loop;
ffa_ch2_logicals.kv 64 end FZ_Xor;
ffa_ch2_logicals.kv 65 pragma Inline_Always(FZ_Xor);
ffa_ch2_logicals.kv 66
ffa_ch2_logicals.kv 67
ffa_ch2_logicals.kv 68 -- N := N ^ W, W is a word
ffa_ch2_logicals.kv 69 procedure FZ_Xor_W(N : in out FZ; W : in Word) is
ffa_ch2_logicals.kv 70 begin
ffa_ch2_logicals.kv 71 N(N'First) := N(N'First) xor W;
ffa_ch2_logicals.kv 72 end FZ_Xor_W;
ffa_ch2_logicals.kv 73 pragma Inline_Always(FZ_Xor_W);
ffa_ch2_logicals.kv 74
ffa_ch2_logicals.kv 75
ffa_ch2_logicals.kv 76 -- NotN := ~N
ffa_ch3_shifts.kv 77 procedure FZ_Not(N : in FZ;
ffa_ch2_logicals.kv 78 NotN : out FZ) is
ffa_ch2_logicals.kv 79 begin
ffa_ch2_logicals.kv 80 for i in N'Range loop
ffa_ch2_logicals.kv 81 NotN(i) := not N(i);
ffa_ch2_logicals.kv 82 end loop;
ffa_ch3_shifts.kv 83 end FZ_Not;
ffa_ch3_shifts.kv 84 pragma Inline_Always(FZ_Not);
ffa_ch2_logicals.kv 85
ffa_ch2_logicals.kv 86 end FZ_BitOp;