-
+ 991563401E923B6D1448644D1AD8FE238E79F5154F98D7317D38227C5856D6CFB55FCEE27C5DDA316E70464A3F234831358B58D9B409CF2D5DB90AA1F38D9E92
ffa/libffa/word_ops.ads
(0 . 0)(1 . 42)
984 ------------------------------------------------------------------------------
985 ------------------------------------------------------------------------------
986 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
987 -- --
988 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
989 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
990 -- --
991 -- You do not have, nor can you ever acquire the right to use, copy or --
992 -- distribute this software ; Should you use this software for any purpose, --
993 -- or copy and distribute it to anyone or in any manner, you are breaking --
994 -- the laws of whatever soi-disant jurisdiction, and you promise to --
995 -- continue doing so for the indefinite future. In any case, please --
996 -- always : read and understand any software ; verify any PGP signatures --
997 -- that you use - for any purpose. --
998 -- --
999 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
1000 ------------------------------------------------------------------------------
1001 ------------------------------------------------------------------------------
1002
1003 with Words; use Words;
1004
1005 -- Fundamental Operations on Words:
1006 package Word_Ops is
1007
1008 pragma Pure;
1009
1010 -- Branch-free calculation of 'carry' from a machine-word addition.
1011 function W_Carry(A : in Word; B : in Word; S : in Word)
1012 return WBool;
1013
1014 -- Branch-free calculation of 'borrow' from a machine-word subtraction.
1015 function W_Borrow(A : in Word; B : in Word; D : in Word)
1016 return WBool;
1017
1018 -- Without any branching: if Sel == 0, return A; if Sel == 1, return B.
1019 function W_Mux(A : in Word; B : in Word; Sel : in WBool)
1020 return Word;
1021
1022 -- Exchange A and B.
1023 procedure W_Swap(A : in out Word; B : in out Word);
1024
1025 end Word_Ops;