/* Include file for internal GNU MP types and definitions.
-Copyright (C) 1991, 1993, 1994, 1995, 1996, 2011 Free Software Foundation, Inc.
+Copyright (C) 1991-2023 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, see
-<http://www.gnu.org/licenses/>. */
+<https://www.gnu.org/licenses/>. */
/* When using gcc, make sure to use its builtin alloca. */
#if ! defined (alloca) && defined (__GNUC__)
#endif
#endif
-#if ! defined (HAVE_ALLOCA) || USE_STACK_ALLOC
+#if (! defined (alloca) && ! defined (HAVE_ALLOCA)) \
+ || defined (USE_STACK_ALLOC)
#include "stack-alloc.h"
#else
#define TMP_DECL(m)
#define inline /* Empty */
#endif
-#define ABS(x) (x >= 0 ? x : -x)
-#ifndef MIN
-#define MIN(l,o) ((l) < (o) ? (l) : (o))
-#endif
-#ifndef MAX
-#define MAX(h,i) ((h) > (i) ? (h) : (i))
-#endif
+/* Get MAX/MIN macros. */
+#include <sys/param.h>
/* Field access macros. */
#define SIZ(x) ((x)->_mp_size)
-#define ABSIZ(x) ABS (SIZ (x))
#define PTR(x) ((x)->_mp_d)
#define EXP(x) ((x)->_mp_exp)
#define PREC(x) ((x)->_mp_prec)
has to be set. Put the quotient in Q and the remainder in R. */
#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
do { \
- mp_limb_t _q, _ql, _r; \
+ mp_limb_t _ql __attribute__ ((unused)); \
+ mp_limb_t _q, _r; \
mp_limb_t _xh, _xl; \
umul_ppmm (_q, _ql, (nh), (di)); \
_q += (nh); /* DI is 2**BITS_PER_MP_LIMB too small */\
/* Prototypes for internal mpn calls. */
extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
- mp_srcptr vp, mp_size_t size));
+ mp_srcptr vp, mp_size_t size))
+ attribute_hidden;
extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
- mp_size_t size, mp_ptr tspace));
+ mp_size_t size, mp_ptr tspace))
+ attribute_hidden;
extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
- mp_size_t size));
+ mp_size_t size))
+ attribute_hidden;
extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,
- mp_ptr tspace));
-
-
-
-#ifndef IEEE_DOUBLE_BIG_ENDIAN
-#define IEEE_DOUBLE_BIG_ENDIAN 1
-#endif
-
-#ifndef IEEE_DOUBLE_MIXED_ENDIAN
-#define IEEE_DOUBLE_MIXED_ENDIAN 0
-#endif
-
-#if IEEE_DOUBLE_MIXED_ENDIAN
-union ieee_double_extract
-{
- struct
- {
- unsigned int manh:20;
- unsigned int exp:11;
- unsigned int sig:1;
- unsigned int manl:32;
- } s;
- double d;
-};
-#else
-#if IEEE_DOUBLE_BIG_ENDIAN
-union ieee_double_extract
-{
- struct
- {
- unsigned int sig:1;
- unsigned int exp:11;
- unsigned int manh:20;
- unsigned int manl:32;
- } s;
- double d;
-};
-#else
-union ieee_double_extract
-{
- struct
- {
- unsigned int manl:32;
- unsigned int manh:20;
- unsigned int exp:11;
- unsigned int sig:1;
- } s;
- double d;
-};
-#endif
-#endif
+ mp_ptr tspace))
+ attribute_hidden;