tree checksum vpatch file split hunks

all signers: asciilifeform diana_coman

antecedents: ffa_ch2_logicals.kv

press order:

ffa_ch1_genesis.kvasciilifeform diana_coman
ffa_ch2_logicals.kvasciilifeform diana_coman
ffa_ch3_shifts.kvasciilifeform diana_coman

patch:

- AB686F59589863AB3EFE9E97C9AE2ECC3BE0D3457D010326AFFFEACA6FF42A662F1B05FEB8C08492EF77392EDDE5ABF26E8EE6CABC75BC0F2391663AE77EBB16
+ FF319D21D5A1B36292F185556512B4EF986CCF657610377DA93D3EFAEBA340C67ABD8AEA86423176090F7DBB9A33203740D27B87B229A70AB30E3ACE6633CB0E
ffa/ffademo/demo_ch2.adb
(172 . 8)(172 . 8)
5 New_Line;
6 New_Line;
7
8 FZ_Neg(X, Z);
9 Put_Line("After FZ_Neg(X, Z):");
10 FZ_Not(X, Z);
11 Put_Line("After FZ_Not(X, Z):");
12 Put_Line("Z =");
13 Dump(Z);
14 New_Line;
-
+ D2AEC7DB4CEF68A2CA7DDF2AAE62E393F228C429D60DD1AC7CBF0C7E5519B30CA053CC9C78A78438FF1108541C9F47240DA5500345C97854EFAA853A4A930C9D
ffa/ffademo/demo_ch3.adb
(0 . 0)(1 . 110)
19 ------------------------------------------------------------------------------
20 ------------------------------------------------------------------------------
21 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
22 -- --
23 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
24 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
25 -- --
26 -- You do not have, nor can you ever acquire the right to use, copy or --
27 -- distribute this software ; Should you use this software for any purpose, --
28 -- or copy and distribute it to anyone or in any manner, you are breaking --
29 -- the laws of whatever soi-disant jurisdiction, and you promise to --
30 -- continue doing so for the indefinite future. In any case, please --
31 -- always : read and understand any software ; verify any PGP signatures --
32 -- that you use - for any purpose. --
33 -- --
34 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
35 ------------------------------------------------------------------------------
36 ------------------------------------------------------------------------------
37
38 -- From Ada:
39 with Ada.Text_IO; use Ada.Text_IO;
40
41 -- From FFA:
42 with Words; use Words;
43 with FZ_Type; use FZ_Type;
44
45 -- FFA Ch. 3
46 with FZ_Shift; use FZ_Shift;
47
48 -- From the Demo:
49 with FFA_IO; use FFA_IO;
50
51
52 package body Demo_Ch3 is
53
54 procedure Demo_Shifts is
55
56 X : FZ(1 .. 4) := ( 16#083e16f27091f65f#, 16#74c01a9c3ce54f80#,
57 16#9fd0913737c3fcbe#, 16#fa55f3f5459a9e79# );
58
59 Z : FZ(1 .. 4) := ( 0, 0, 0, 0 );
60
61 -- Overflow
62 O : Word := 0;
63
64 begin
65
66 Put_Line("~~~ Ch. 3 : Shifts ~~~");
67 New_Line;
68
69 Put_Line("X =");
70 Dump(X);
71 New_Line;
72 New_Line;
73
74 -- Left Shifts:
75
76 FZ_ShiftLeft_O(X, Z, 1, O);
77 Put_Line("X << 1 =");
78 Dump(Z);
79 New_Line;
80 Put_Line("Overflow = ");
81 Dump(O);
82 New_Line;
83
84 FZ_ShiftLeft_O(X, Z, 13, O);
85 Put_Line("X << 13 =");
86 Dump(Z);
87 New_Line;
88 Put_Line("Overflow = ");
89 Dump(O);
90 New_Line;
91
92 FZ_ShiftLeft_O(X, Z, 40, O);
93 Put_Line("X << 40 =");
94 Dump(Z);
95 New_Line;
96 Put_Line("Overflow = ");
97 Dump(O);
98 New_Line;
99
100 -- Right Shifts:
101
102 FZ_ShiftRight_O(X, Z, 1, O);
103 Put_Line("X >> 1 =");
104 Dump(Z);
105 New_Line;
106 Put_Line("Overflow = ");
107 Dump(O);
108 New_Line;
109
110 FZ_ShiftRight_O(X, Z, 13, O);
111 Put_Line("X >> 13 =");
112 Dump(Z);
113 New_Line;
114 Put_Line("Overflow = ");
115 Dump(O);
116 New_Line;
117
118 FZ_ShiftRight_O(X, Z, 40, O);
119 Put_Line("X >> 40 =");
120 Dump(Z);
121 New_Line;
122 Put_Line("Overflow = ");
123 Dump(O);
124 New_Line;
125
126 end Demo_Shifts;
127
128 end Demo_Ch3;
-
+ 49E370ED04A5198711E8BAE455B680EC0B5E88AA2EAC1A2D6839F368792A21EFE06EC7F204B66A6956AAF1512F704928A35A4B6906EEF8355325944ED09EDDF9
ffa/ffademo/demo_ch3.ads
(0 . 0)(1 . 24)
133 ------------------------------------------------------------------------------
134 ------------------------------------------------------------------------------
135 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
136 -- --
137 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
138 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
139 -- --
140 -- You do not have, nor can you ever acquire the right to use, copy or --
141 -- distribute this software ; Should you use this software for any purpose, --
142 -- or copy and distribute it to anyone or in any manner, you are breaking --
143 -- the laws of whatever soi-disant jurisdiction, and you promise to --
144 -- continue doing so for the indefinite future. In any case, please --
145 -- always : read and understand any software ; verify any PGP signatures --
146 -- that you use - for any purpose. --
147 -- --
148 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
149 ------------------------------------------------------------------------------
150 ------------------------------------------------------------------------------
151
152 package Demo_Ch3 is
153
154 procedure Demo_Shifts;
155
156 end Demo_Ch3;
- 929CD7FD79C21425923705BD800100DD2405068BC84B5E8C9F3CB425BD7DC3A3C453A3016614B4DBC62AA05A5CDFF70FDB1812A25FFF2101A5BCF382BA574382
+ D02319FE61524AD04E579446F26DF1BCF6B822050B357DCF7BF150CA553F25EBF9603C246A84B902D0E3165A71A29B519A2E9D10A0F5D150EB2DB24B44A36355
ffa/ffademo/ffa_demo.adb
(19 . 6)(19 . 7)
161
162 with Demo_Ch1; use Demo_Ch1;
163 with Demo_Ch2; use Demo_Ch2;
164 with Demo_Ch3; use Demo_Ch3;
165
166 procedure FFA_Demo is
167 begin
(31 . 4)(32 . 7)
169 Demo_FZ_Basics;
170 Demo_FZ_Various_Ops;
171
172 -- Ch. 3
173 Demo_Shifts;
174
175 end FFA_Demo;
- 00F1170667A8787008530F64E8648158EDBBEC88DC26D7D7FC78DC796405A300F450E8FF290A66FF874DC2FDA5A3293012F4E1260E54E7BD421389FF908FD959
+ 445A0EEA698AC3F75014034FD7D9E74D8253862AD5D62B77881DB9E986AB0D82D24C88FB227B12EA9C41FDFFAEBBF685A21780E42A8353CD81C74C8818C67898
ffa/libffa/fz_basic.adb
(1 . 3)(1 . 22)
180 ------------------------------------------------------------------------------
181 ------------------------------------------------------------------------------
182 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
183 -- --
184 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
185 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
186 -- --
187 -- You do not have, nor can you ever acquire the right to use, copy or --
188 -- distribute this software ; Should you use this software for any purpose, --
189 -- or copy and distribute it to anyone or in any manner, you are breaking --
190 -- the laws of whatever soi-disant jurisdiction, and you promise to --
191 -- continue doing so for the indefinite future. In any case, please --
192 -- always : read and understand any software ; verify any PGP signatures --
193 -- that you use - for any purpose. --
194 -- --
195 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
196 ------------------------------------------------------------------------------
197 ------------------------------------------------------------------------------
198
199 with Word_Ops; use Word_Ops;
200
201
(33 . 7)(52 . 7)
203
204 -- Exchange X and Y
205 procedure FZ_Swap(X : in out FZ; Y : in out FZ) is
206 T : FZ(X'Range) := X;
207 T : FZ(X'Range);
208 begin
209 T := X;
210 X := Y;
- C41300D143792A5D7C9F2FE4F9EB94324E99A91EB2BA164504ACF37137802AC0B00B5F3BBD00A9D23A9043B3B8731DB50B763E0B23CE061093ABD436A6B2B286
+ 5AE6FB91AABCFB353C9C2F5CC465795BC91FED25B5A98DD9A97B06FA959380E581F3F020D18717D791C858622F94C7EC13430D6FBA2476274E0A1D5985B8CC90
ffa/libffa/fz_basic.ads
(1 . 3)(1 . 22)
215 ------------------------------------------------------------------------------
216 ------------------------------------------------------------------------------
217 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
218 -- --
219 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
220 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
221 -- --
222 -- You do not have, nor can you ever acquire the right to use, copy or --
223 -- distribute this software ; Should you use this software for any purpose, --
224 -- or copy and distribute it to anyone or in any manner, you are breaking --
225 -- the laws of whatever soi-disant jurisdiction, and you promise to --
226 -- continue doing so for the indefinite future. In any case, please --
227 -- always : read and understand any software ; verify any PGP signatures --
228 -- that you use - for any purpose. --
229 -- --
230 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
231 ------------------------------------------------------------------------------
232 ------------------------------------------------------------------------------
233
234 with Words; use Words;
235 with FZ_Type; use FZ_Type;
236
- 00E146D70BDF4BC40B8E5B4687470F7A35132EABA708C8F04494121572E9675852087D2869FAA5759749DD3D2F14AEDE6259A115C1C2DFDF2D1551A49DF2C176
+ E392C4D077A2D9169133060244FB84669A4C990CEEA872AEF112A85421F233478363BC4D560547D5D53FDDB689C1BE3427497CD1B59401CFB3F4F3F7834A2021
ffa/libffa/fz_bitop.adb
(1 . 3)(1 . 22)
241 ------------------------------------------------------------------------------
242 ------------------------------------------------------------------------------
243 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
244 -- --
245 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
246 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
247 -- --
248 -- You do not have, nor can you ever acquire the right to use, copy or --
249 -- distribute this software ; Should you use this software for any purpose, --
250 -- or copy and distribute it to anyone or in any manner, you are breaking --
251 -- the laws of whatever soi-disant jurisdiction, and you promise to --
252 -- continue doing so for the indefinite future. In any case, please --
253 -- always : read and understand any software ; verify any PGP signatures --
254 -- that you use - for any purpose. --
255 -- --
256 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
257 ------------------------------------------------------------------------------
258 ------------------------------------------------------------------------------
259
260 package body FZ_BitOp is
261
262 -- Result := X & Y
(55 . 13)(74 . 13)
264
265
266 -- NotN := ~N
267 procedure FZ_Neg(N : in FZ;
268 procedure FZ_Not(N : in FZ;
269 NotN : out FZ) is
270 begin
271 for i in N'Range loop
272 NotN(i) := not N(i);
273 end loop;
274 end FZ_Neg;
275 pragma Inline_Always(FZ_Neg);
276 end FZ_Not;
277 pragma Inline_Always(FZ_Not);
278
279 end FZ_BitOp;
- 27EEADFDB34526DC90F3FACC0C01FA3EA2BE7353ABBDDDA0AD19255CE22AC25FA5118478CCD379BB6DB072735E23EC7ECF90B3973BE017878CCFB3581B8E16F2
+ 6C169EA38EFA2E6E30DB85131AB64CF5E71BCABCDFA4722B2F019C8BEBB1CABB5A2D8FC192703607B2A129CF54E36C2D136A68C3F6B13792CE138BCEE6B6BE52
ffa/libffa/fz_bitop.ads
(1 . 3)(1 . 22)
284 ------------------------------------------------------------------------------
285 ------------------------------------------------------------------------------
286 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
287 -- --
288 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
289 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
290 -- --
291 -- You do not have, nor can you ever acquire the right to use, copy or --
292 -- distribute this software ; Should you use this software for any purpose, --
293 -- or copy and distribute it to anyone or in any manner, you are breaking --
294 -- the laws of whatever soi-disant jurisdiction, and you promise to --
295 -- continue doing so for the indefinite future. In any case, please --
296 -- always : read and understand any software ; verify any PGP signatures --
297 -- that you use - for any purpose. --
298 -- --
299 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
300 ------------------------------------------------------------------------------
301 ------------------------------------------------------------------------------
302
303 with FZ_Type; use FZ_Type;
304 with Words; use Words;
305
(28 . 7)(47 . 7)
307 procedure FZ_Xor_W(N : in out FZ; W : in Word);
308
309 -- NotN := ~N
310 procedure FZ_Neg(N : in FZ; NotN : out FZ);
311 procedure FZ_Not(N : in FZ; NotN : out FZ);
312 pragma Precondition(N'Length = NotN'Length);
313
314 end FZ_BitOp;
- 2354C226B429A80777A4731F2300F13EA59E023BDD6C33E17FD65F5C22C1D2ED84A17CC6624D1FD00D5D1CBD6B69913F32FAEF626070488C800BFAC29991A4C4
+ 7BC2AC9CD0D23497E2E2DE528D4CBEFCBEC274B511B2642369218BB8A00F3663B32F70040BEDFCB5A1F8CE2D5B9A026A10AE106FD2C370D1369188122FCB7BE9
ffa/libffa/fz_cmp.adb
(1 . 3)(1 . 22)
319 ------------------------------------------------------------------------------
320 ------------------------------------------------------------------------------
321 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
322 -- --
323 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
324 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
325 -- --
326 -- You do not have, nor can you ever acquire the right to use, copy or --
327 -- distribute this software ; Should you use this software for any purpose, --
328 -- or copy and distribute it to anyone or in any manner, you are breaking --
329 -- the laws of whatever soi-disant jurisdiction, and you promise to --
330 -- continue doing so for the indefinite future. In any case, please --
331 -- always : read and understand any software ; verify any PGP signatures --
332 -- that you use - for any purpose. --
333 -- --
334 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
335 ------------------------------------------------------------------------------
336 ------------------------------------------------------------------------------
337
338 with W_Pred; use W_Pred;
339 with FZ_Arith; use FZ_Arith;
340
- A0AF30915DDF0A84F4ECA02A13F1C607BCD01B2A49998B4002A40F50A436CC4A61AA25922EBECE99A837662D76F0950FE63695ED1CC424792FE00B81E3E98E82
+ 9E52F3E150784CBFFB8E31B93FA3EDB380EDB86FB0106F1D34CF1A66964C1A1CA44514695B061FD40B4B1F37023CD131021D65C59295ED09C5265789F386CA73
ffa/libffa/fz_cmp.ads
(1 . 3)(1 . 22)
345 ------------------------------------------------------------------------------
346 ------------------------------------------------------------------------------
347 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
348 -- --
349 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
350 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
351 -- --
352 -- You do not have, nor can you ever acquire the right to use, copy or --
353 -- distribute this software ; Should you use this software for any purpose, --
354 -- or copy and distribute it to anyone or in any manner, you are breaking --
355 -- the laws of whatever soi-disant jurisdiction, and you promise to --
356 -- continue doing so for the indefinite future. In any case, please --
357 -- always : read and understand any software ; verify any PGP signatures --
358 -- that you use - for any purpose. --
359 -- --
360 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
361 ------------------------------------------------------------------------------
362 ------------------------------------------------------------------------------
363
364 with Words; use Words;
365 with FZ_Type; use FZ_Type;
366
- EF003DD5035581C12D242FA697E39248A2B1E26CE2EB0713F4BAC79816FE602174C3280840B698593456FAE2983D249493570FC86C5BC9B1E80FD715E1E44438
+ 0E7912475E7C658BB6371C563D6A8A95B45D22CE5A6FA9BEE0C8DDDB839A361EA7791C8A8EBFBCC8C325562A9A52E2AD66C984CCD8BBA1931B1EC4874EFBFD21
ffa/libffa/fz_pred.adb
(1 . 3)(1 . 22)
371 ------------------------------------------------------------------------------
372 ------------------------------------------------------------------------------
373 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
374 -- --
375 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
376 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
377 -- --
378 -- You do not have, nor can you ever acquire the right to use, copy or --
379 -- distribute this software ; Should you use this software for any purpose, --
380 -- or copy and distribute it to anyone or in any manner, you are breaking --
381 -- the laws of whatever soi-disant jurisdiction, and you promise to --
382 -- continue doing so for the indefinite future. In any case, please --
383 -- always : read and understand any software ; verify any PGP signatures --
384 -- that you use - for any purpose. --
385 -- --
386 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
387 ------------------------------------------------------------------------------
388 ------------------------------------------------------------------------------
389
390 with W_Pred; use W_Pred;
391
392
- 618A69A4BBB18555C26135CDFB3279183D88D47495F89D601670DFE911524078BF7AB5C3025712AD4CC1448B302D11AB3E47CD74E870401FAADAB6303831A5B9
+ 019C293F79D46BD5C0895A0F92143884A40072B67A1E22335D96D1557C8F1F760985B5ACA1A892905791656ACDA957014E1B67A927EC0946DC1CF8AE53592BB5
ffa/libffa/fz_pred.ads
(1 . 3)(1 . 22)
397 ------------------------------------------------------------------------------
398 ------------------------------------------------------------------------------
399 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
400 -- --
401 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
402 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
403 -- --
404 -- You do not have, nor can you ever acquire the right to use, copy or --
405 -- distribute this software ; Should you use this software for any purpose, --
406 -- or copy and distribute it to anyone or in any manner, you are breaking --
407 -- the laws of whatever soi-disant jurisdiction, and you promise to --
408 -- continue doing so for the indefinite future. In any case, please --
409 -- always : read and understand any software ; verify any PGP signatures --
410 -- that you use - for any purpose. --
411 -- --
412 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
413 ------------------------------------------------------------------------------
414 ------------------------------------------------------------------------------
415
416 with Words; use Words;
417 with FZ_Type; use FZ_Type;
418
-
+ C8D53B2A0E90EC081C6E0BDB4D1DE6FCF02ABA4AB34D1EB83271DF34CC3CB1FBB29B103551335477314F2A5DB544B91943CCAAE1DCA05676AA096420D59F9D84
ffa/libffa/fz_shift.adb
(0 . 0)(1 . 115)
423 ------------------------------------------------------------------------------
424 ------------------------------------------------------------------------------
425 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
426 -- --
427 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
428 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
429 -- --
430 -- You do not have, nor can you ever acquire the right to use, copy or --
431 -- distribute this software ; Should you use this software for any purpose, --
432 -- or copy and distribute it to anyone or in any manner, you are breaking --
433 -- the laws of whatever soi-disant jurisdiction, and you promise to --
434 -- continue doing so for the indefinite future. In any case, please --
435 -- always : read and understand any software ; verify any PGP signatures --
436 -- that you use - for any purpose. --
437 -- --
438 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
439 ------------------------------------------------------------------------------
440 ------------------------------------------------------------------------------
441
442 with W_Shifts; use W_Shifts;
443
444
445 package body FZ_Shift is
446
447 --------------------------------------------------------------
448 -- Shift Right
449 --------------------------------------------------------------
450
451 -- ShiftedN := N >> Count (with Overflow Input and Output)
452 procedure FZ_ShiftRight_O_I(N : in FZ;
453 ShiftedN : out FZ;
454 Count : in WBit_Index;
455 Overflow : out Word;
456 OF_in : in Word) is
457 Ni : Word;
458 Carry : Word := OF_in;
459 begin
460 for i in reverse N'Range loop
461 Ni := N(i);
462 ShiftedN(i) := Shift_Right(Ni, Count) or Carry;
463 Carry := Shift_Left(Ni, Bitness - Count);
464 end loop;
465 Overflow := Carry;
466 end FZ_ShiftRight_O_I;
467 pragma Inline_Always(FZ_ShiftRight_O_I);
468
469
470 -- ShiftedN := N >> Count (with Overflow Output only)
471 procedure FZ_ShiftRight_O(N : in FZ;
472 ShiftedN : out FZ;
473 Count : in WBit_Index;
474 Overflow : out Word) is
475 begin
476 FZ_ShiftRight_O_I(N, ShiftedN, Count, Overflow, 0);
477 end FZ_ShiftRight_O;
478 pragma Inline_Always(FZ_ShiftRight_O);
479
480
481 -- ShiftedN := N >> Count (no Overflow output or input)
482 procedure FZ_ShiftRight(N : in FZ;
483 ShiftedN : out FZ;
484 Count : in WBit_Index) is
485 Overflow : Word;
486 pragma Unreferenced(Overflow);
487 begin
488 FZ_ShiftRight_O_I(N, ShiftedN, Count, Overflow, 0);
489 end FZ_ShiftRight;
490 pragma Inline_Always(FZ_ShiftRight);
491
492 --------------------------------------------------------------
493 -- Shift Left
494 --------------------------------------------------------------
495
496 -- ShiftedN := N << Count (with Overflow Input and Output)
497 procedure FZ_ShiftLeft_O_I(N : in FZ;
498 ShiftedN : out FZ;
499 Count : in WBit_Index;
500 Overflow : out Word;
501 OF_in : in Word) is
502 Ni : Word;
503 Carry : Word := OF_in;
504 begin
505 for i in N'Range loop
506 Ni := N(i);
507 ShiftedN(i) := Shift_Left(Ni, Count) or Carry;
508 Carry := Shift_Right(Ni, Bitness - Count);
509 end loop;
510 Overflow := Carry;
511 end FZ_ShiftLeft_O_I;
512 pragma Inline_Always(FZ_ShiftLeft_O_I);
513
514
515 -- ShiftedN := N << Count (with Overflow Output only)
516 procedure FZ_ShiftLeft_O(N : in FZ;
517 ShiftedN : out FZ;
518 Count : in WBit_Index;
519 Overflow : out Word) is
520 begin
521 FZ_ShiftLeft_O_I(N, ShiftedN, Count, Overflow, 0);
522 end FZ_ShiftLeft_O;
523 pragma Inline_Always(FZ_ShiftLeft_O);
524
525
526 -- ShiftedN := N << Count (no Overflow output or input)
527 procedure FZ_ShiftLeft(N : in FZ;
528 ShiftedN : out FZ;
529 Count : in WBit_Index) is
530 Overflow : Word;
531 pragma Unreferenced(Overflow);
532 begin
533 FZ_ShiftLeft_O_I(N, ShiftedN, Count, Overflow, 0);
534 end FZ_ShiftLeft;
535 pragma Inline_Always(FZ_ShiftLeft);
536
537 end FZ_Shift;
-
+ 28A09B8F85E67C25816A78E1EED67A34FFFDDE6A8F2879736FE1B6C6A00ABF037D6C7A09AD85EB8CC3C13AB9F01C2D8FA7C97821EA649F0A292E1CF591B81323
ffa/libffa/fz_shift.ads
(0 . 0)(1 . 78)
542 ------------------------------------------------------------------------------
543 ------------------------------------------------------------------------------
544 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
545 -- --
546 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
547 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
548 -- --
549 -- You do not have, nor can you ever acquire the right to use, copy or --
550 -- distribute this software ; Should you use this software for any purpose, --
551 -- or copy and distribute it to anyone or in any manner, you are breaking --
552 -- the laws of whatever soi-disant jurisdiction, and you promise to --
553 -- continue doing so for the indefinite future. In any case, please --
554 -- always : read and understand any software ; verify any PGP signatures --
555 -- that you use - for any purpose. --
556 -- --
557 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
558 ------------------------------------------------------------------------------
559 ------------------------------------------------------------------------------
560
561 with Words; use Words;
562 with FZ_Type; use FZ_Type;
563
564
565 package FZ_Shift is
566
567 pragma Pure;
568
569 --------------------------------------------------------------
570 -- Shift Right
571 --------------------------------------------------------------
572
573 -- ShiftedN := N >> Count (with Overflow Input and Output)
574 procedure FZ_ShiftRight_O_I(N : in FZ;
575 ShiftedN : out FZ;
576 Count : in WBit_Index;
577 Overflow : out Word;
578 OF_in : in Word);
579 pragma Precondition(N'Length = ShiftedN'Length);
580
581 -- ShiftedN := N >> Count (with Overflow Output only)
582 procedure FZ_ShiftRight_O(N : in FZ;
583 ShiftedN : out FZ;
584 Count : in WBit_Index;
585 Overflow : out Word);
586 pragma Precondition(N'Length = ShiftedN'Length);
587
588 -- ShiftedN := N >> Count (no Overflow output or input)
589 procedure FZ_ShiftRight(N : in FZ;
590 ShiftedN : out FZ;
591 Count : in WBit_Index);
592 pragma Precondition(N'Length = ShiftedN'Length);
593
594 --------------------------------------------------------------
595 -- Shift Left
596 --------------------------------------------------------------
597
598 -- ShiftedN := N << Count (with Overflow Input and Output)
599 procedure FZ_ShiftLeft_O_I(N : in FZ;
600 ShiftedN : out FZ;
601 Count : in WBit_Index;
602 Overflow : out Word;
603 OF_in : in Word);
604 pragma Precondition(N'Length = ShiftedN'Length);
605
606 -- ShiftedN := N << Count (with Overflow Output only)
607 procedure FZ_ShiftLeft_O(N : in FZ;
608 ShiftedN : out FZ;
609 Count : in WBit_Index;
610 Overflow : out Word);
611 pragma Precondition(N'Length = ShiftedN'Length);
612
613 -- ShiftedN := N << Count (no Overflow output or input)
614 procedure FZ_ShiftLeft(N : in FZ;
615 ShiftedN : out FZ;
616 Count : in WBit_Index);
617 pragma Precondition(N'Length = ShiftedN'Length);
618
619 end FZ_Shift;