-
+ 0A3C652DEF28676A7BE3A8C8A76C1BF1542C42C993718D9B72CA7B74F87C41BA4491609560F2980D3DB266ED00FA3ACE57A1D7BE43F6BF6837BEED880D5B9460
ffa/libffa/w_mul.ads
(0 . 0)(1 . 46)
361 ------------------------------------------------------------------------------
362 ------------------------------------------------------------------------------
363 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
364 -- --
365 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
366 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
367 -- --
368 -- You do not have, nor can you ever acquire the right to use, copy or --
369 -- distribute this software ; Should you use this software for any purpose, --
370 -- or copy and distribute it to anyone or in any manner, you are breaking --
371 -- the laws of whatever soi-disant jurisdiction, and you promise to --
372 -- continue doing so for the indefinite future. In any case, please --
373 -- always : read and understand any software ; verify any PGP signatures --
374 -- that you use - for any purpose. --
375 -- --
376 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
377 ------------------------------------------------------------------------------
378 ------------------------------------------------------------------------------
379
380 with Words; use Words;
381
382
383 package W_Mul is
384
385 pragma Pure;
386
387 -- The bitness of a Half-Word
388 HalfBitness : constant Positive := Bitness / 2;
389 subtype HalfWord is Word range 0 .. 2**HalfBitness;
390
391 -- The number of bytes in a Half-Word
392 HalfByteness : constant Positive := Byteness / 2;
393
394 -- Multiply half-words X and Y, producing a Word-sized product
395 function Mul_HalfWord(X : in HalfWord; Y : in HalfWord) return Word;
396
397 -- Get the bottom half of a Word
398 function BottomHW(W : in Word) return HalfWord;
399
400 -- Get the top half of a Word
401 function TopHW(W : in Word) return HalfWord;
402
403 -- Carry out X*Y mult, return lower word XY_LW and upper word XY_HW.
404 procedure Mul_Word(X : in Word; Y : in Word; XY_LW : out Word; XY_HW : out Word);
405
406 end W_Mul;