#ifndef _CL_D_H
#define _CL_D_H
-#include "cl_types.h"
-#include "cl_low.h"
+#include "cln/types.h"
+#include "base/cl_low.h"
-// Aus cl_types.h importiere:
+// Aus cln/types.h importiere:
// intDsize Anzahl Bits in einem Digit
-// uintD, sintD Integer-Typen für ein Digit
+// uintD, sintD Integer-Typen für ein Digit
// log2_intDsize log2(intDsize)
-// HAVE_DD Flag, das anzeigt, ob ein Integertyp für Doppel-Digits da ist
+// HAVE_DD Flag, das anzeigt, ob ein Integertyp für Doppel-Digits da ist
// intDDsize Anzahl Bits in einem Doppel-Digit
-// uintDD,sintDD Integer-Typen für ein Doppel-Digit
+// uintDD,sintDD Integer-Typen für ein Doppel-Digit
#ifdef HAVE_FAST_LONGLONG
#if !((64%intDsize)==0)
#endif
#endif
+namespace cln {
// Vorzeichen eines Digit bestimmen
// sign_of_sintD(wert)
#if (intDsize==16)
#define muluD mulu16
#endif
- #if (intDsize==32) && defined(HAVE_LONGLONG)
+ #if (intDsize==32)
#define muluD(arg1,arg2) ((uintDD)(uintD)(arg1)*(uintDD)(uintD)(arg2))
#endif
#else
// Zwei Digits multiplizieren, mit einem Digit als Ergebnis.
// (uintD)lo = muluD_unchecked(uintD arg1, uintD arg2)
-// Es wird vorausgesetzt, daß arg1*arg2 < 2^intDsize.
+// Es wird vorausgesetzt, daß arg1*arg2 < 2^intDsize.
#if (intDsize==8) || (intDsize==16) || (intDsize==64)
#define muluD_unchecked(arg1,arg2) ((uintD)((uintD)(arg1)*(uintD)(arg2)))
#endif
// bzw.
// divuD(uintD xhi, uintD xlo, uintD y, uintD q =, uintD r =);
// dividiert x/y und liefert q = floor(x/y) und r = (x mod y). x = q*y+r.
-// Es wird vorausgesetzt, daß 0 <= x < 2^intDsize*y.
+// Es wird vorausgesetzt, daß 0 <= x < 2^intDsize*y.
#if HAVE_DD
#if (intDsize==8)
#define divuD divu_1616_1616
#if (intDsize==16)
#define divuD divu_3216_1616
#endif
- #if (intDsize==32) && defined(HAVE_LONGLONG)
+ #if (intDsize==32)
#define divuD(x,y,q_zuweisung,r_zuweisung) \
{ var uint64 __x = (x); \
var uint32 __y = (y); \
// Durch ein Digit dividieren:
// floorD(uintD x, uintD y)
// dividiert x/y und liefert q = floor(x/y).
-// Es wird vorausgesetzt, daß y > 0.
+// Es wird vorausgesetzt, daß y > 0.
#if (intDsize==8) || (intDsize==16) || (intDsize==64)
#define floorD(arg1,arg2) (floor((uintD)(arg1),(uintD)(arg2)))
#endif
#define isqrtD isqrt_128_64
#endif
-// Bits eines Digit zählen:
+// Bits eines Digit zählen:
// integerlengthD(digit,size=);
-// setzt size auf die höchste in digit vorkommende Bitnummer.
+// setzt size auf die höchste in digit vorkommende Bitnummer.
// > digit: ein uintD >0
// < size: >0, <=intDsize, mit 2^(size-1) <= digit < 2^size
#if (intDsize==8)
#define integerlengthD integerlength64
#endif
-// Hintere Nullbits eines Digits zählen:
+// Hintere Nullbits eines Digits zählen:
// ord2_D(digit,count=);
// setzt size auf die kleinste in digit vorkommende Bitnummer.
// > digit: ein uintD >0
}
#endif
-// Bits eines Wortes zählen.
+// Bits eines Wortes zählen.
// logcountD(x)
// > x: ein uintD
// < ergebnis: Anzahl der darin gesetzten Bits
inline uint64 logcountD (uint64 x64) { logcount_64(); return x64; }
#endif
+} // namespace cln
+
#endif /* _CL_D_H */