Fake mknative

This commit is contained in:
maya 2019-04-15 14:02:23 +00:00
parent 8cd3219f80
commit fc3e881944
6 changed files with 489 additions and 126 deletions

View File

@ -1,6 +1,6 @@
/* This file is automatically generated. DO NOT EDIT! */
/* Generated from: NetBSD: mknative-gcc,v 1.79 2014/05/29 16:27:50 skrll Exp */
/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */
/* Generated from: NetBSD: mknative-gcc,v 1.100 2019/02/09 03:57:00 mrg Exp */
/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
@ -29,18 +29,39 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `getegid' function. */
#define HAVE_GETEGID 1
/* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getloadavg' function. */
#define HAVE_GETLOADAVG 1
/* Define to 1 if you have the `getuid' function. */
#define HAVE_GETUID 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `dl' library (-ldl). */
/* #undef HAVE_LIBDL */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if pthread_{,attr_}{g,s}etaffinity_np is supported. */
/* #undef HAVE_PTHREAD_AFFINITY_NP */
/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
/* Define to 1 if you have the `secure_getenv' function. */
/* #undef HAVE_SECURE_GETENV */
/* Define to 1 if you have the <semaphore.h> header file. */
#define HAVE_SEMAPHORE_H 1
@ -59,9 +80,12 @@
/* Define to 1 if you have the `strtoull' function. */
#define HAVE_STRTOULL 1
/* Define to 1 if the system has the type `struct _Mutex_Control'. */
/* #undef HAVE_STRUCT__MUTEX_CONTROL */
/* Define to 1 if the target runtime linker supports binding the same symbol
to different versions. */
/* #undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT */
#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1
/* Define to 1 if the target supports __sync_*_compare_and_swap */
#define HAVE_SYNC_BUILTINS 1
@ -72,6 +96,9 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
#define HAVE_SYS_SYSCTL_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
@ -84,13 +111,28 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `__secure_getenv' function. */
/* #undef HAVE___SECURE_GETENV */
/* Define path to HSA runtime. */
#define HSA_RUNTIME_LIB ""
/* Define to 1 if GNU symbol versioning is used for libgomp. */
/* #undef LIBGOMP_GNU_SYMBOL_VERSIONING */
#define LIBGOMP_GNU_SYMBOL_VERSIONING 1
/* Define to 1 if building libgomp for an accelerator-only target. */
/* #undef LIBGOMP_OFFLOADED_ONLY */
/* Define to 1 if libgomp should use POSIX threads. */
#define LIBGOMP_USE_PTHREADS 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Define to offload targets, separated by commas. */
#define OFFLOAD_TARGETS ""
/* Name of package */
#define PACKAGE "libgomp"
@ -98,10 +140,10 @@
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU OpenMP Runtime Library"
#define PACKAGE_NAME "GNU Offloading and Multi Processing Runtime Library"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU OpenMP Runtime Library 1.0"
#define PACKAGE_STRING "GNU Offloading and Multi Processing Runtime Library 1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libgomp"
@ -112,6 +154,19 @@
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.0"
/* Define to 1 if the HSA plugin is built, 0 if not. */
#define PLUGIN_HSA 0
/* Define to 1 if the NVIDIA plugin is built, 0 if not. */
#define PLUGIN_NVPTX 0
/* Define to 1 if the NVIDIA plugin should dlopen libcuda.so.1, 0 if it should
be linked against it. */
#define PLUGIN_NVPTX_DYNAMIC 0
/* Define if all infrastructure, needed for plugins, is supported. */
/* #undef PLUGIN_SUPPORT */
/* The size of `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */
@ -136,5 +191,8 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if the target use emutls for thread-local storage. */
/* #undef USE_EMUTLS */
/* Version number of package */
#define VERSION "1.0"

View File

@ -1,7 +1,7 @@
# This file is automatically generated. DO NOT EDIT!
# Generated from: NetBSD: mknative-gcc,v 1.79 2014/05/29 16:27:50 skrll Exp
# Generated from: NetBSD: mknative-gcc,v 1.85 2016/03/15 21:38:32 mrg Exp
# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp
#
# This spec file is read by gcc when linking. It is used to specify the
# standard libraries we need in order to link with -fopenmp.
# standard libraries we need in order to link with libgomp.
*link_gomp: -lgomp %{static: }

View File

@ -1,11 +1,12 @@
/* This file is automatically generated. DO NOT EDIT! */
/* Generated from: NetBSD: mknative-gcc,v 1.79 2014/05/29 16:27:50 skrll Exp */
/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */
/* Generated from: NetBSD: mknative-gcc,v 1.94 2018/09/04 22:57:25 mrg Exp */
/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */
/* Copyright (C) 2005-2013 Free Software Foundation, Inc.
/* Copyright (C) 2005-2017 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
This file is part of the GNU Offloading and Multi Processing Library
(libgomp).
Libgomp is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by

View File

@ -1,11 +1,12 @@
/* This file is automatically generated. DO NOT EDIT! */
/* Generated from: NetBSD: mknative-gcc,v 1.79 2014/05/29 16:27:50 skrll Exp */
/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */
/* Generated from: NetBSD: mknative-gcc,v 1.94 2018/09/04 22:57:25 mrg Exp */
/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */
/* Copyright (C) 2005-2013 Free Software Foundation, Inc.
/* Copyright (C) 2005-2017 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
This file is part of the GNU Offloading and Multi Processing Library
(libgomp).
Libgomp is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@ -26,8 +27,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef OMP_H
#define OMP_H 1
#ifndef _OMP_H
#define _OMP_H 1
#ifndef _LIBGOMP_OMP_LOCK_DEFINED
#define _LIBGOMP_OMP_LOCK_DEFINED 1
@ -56,6 +57,24 @@ typedef enum omp_sched_t
omp_sched_auto = 4
} omp_sched_t;
typedef enum omp_proc_bind_t
{
omp_proc_bind_false = 0,
omp_proc_bind_true = 1,
omp_proc_bind_master = 2,
omp_proc_bind_close = 3,
omp_proc_bind_spread = 4
} omp_proc_bind_t;
typedef enum omp_lock_hint_t
{
omp_lock_hint_none = 0,
omp_lock_hint_uncontended = 1,
omp_lock_hint_contended = 2,
omp_lock_hint_nonspeculative = 4,
omp_lock_hint_speculative = 8,
} omp_lock_hint_t;
#ifdef __cplusplus
extern "C" {
# define __GOMP_NOTHROW throw ()
@ -78,12 +97,16 @@ extern void omp_set_nested (int) __GOMP_NOTHROW;
extern int omp_get_nested (void) __GOMP_NOTHROW;
extern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW;
extern void omp_init_lock_with_hint (omp_lock_t *, omp_lock_hint_t)
__GOMP_NOTHROW;
extern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW;
extern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW;
extern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW;
extern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW;
extern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void omp_init_nest_lock_with_hint (omp_nest_lock_t *, omp_lock_hint_t)
__GOMP_NOTHROW;
extern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
@ -92,20 +115,55 @@ extern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
extern double omp_get_wtime (void) __GOMP_NOTHROW;
extern double omp_get_wtick (void) __GOMP_NOTHROW;
void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
int omp_get_thread_limit (void) __GOMP_NOTHROW;
void omp_set_max_active_levels (int) __GOMP_NOTHROW;
int omp_get_max_active_levels (void) __GOMP_NOTHROW;
int omp_get_level (void) __GOMP_NOTHROW;
int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
int omp_get_team_size (int) __GOMP_NOTHROW;
int omp_get_active_level (void) __GOMP_NOTHROW;
extern void omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
extern void omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
extern int omp_get_thread_limit (void) __GOMP_NOTHROW;
extern void omp_set_max_active_levels (int) __GOMP_NOTHROW;
extern int omp_get_max_active_levels (void) __GOMP_NOTHROW;
extern int omp_get_level (void) __GOMP_NOTHROW;
extern int omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
extern int omp_get_team_size (int) __GOMP_NOTHROW;
extern int omp_get_active_level (void) __GOMP_NOTHROW;
int omp_in_final (void) __GOMP_NOTHROW;
extern int omp_in_final (void) __GOMP_NOTHROW;
extern int omp_get_cancellation (void) __GOMP_NOTHROW;
extern omp_proc_bind_t omp_get_proc_bind (void) __GOMP_NOTHROW;
extern int omp_get_num_places (void) __GOMP_NOTHROW;
extern int omp_get_place_num_procs (int) __GOMP_NOTHROW;
extern void omp_get_place_proc_ids (int, int *) __GOMP_NOTHROW;
extern int omp_get_place_num (void) __GOMP_NOTHROW;
extern int omp_get_partition_num_places (void) __GOMP_NOTHROW;
extern void omp_get_partition_place_nums (int *) __GOMP_NOTHROW;
extern void omp_set_default_device (int) __GOMP_NOTHROW;
extern int omp_get_default_device (void) __GOMP_NOTHROW;
extern int omp_get_num_devices (void) __GOMP_NOTHROW;
extern int omp_get_num_teams (void) __GOMP_NOTHROW;
extern int omp_get_team_num (void) __GOMP_NOTHROW;
extern int omp_is_initial_device (void) __GOMP_NOTHROW;
extern int omp_get_initial_device (void) __GOMP_NOTHROW;
extern int omp_get_max_task_priority (void) __GOMP_NOTHROW;
extern void *omp_target_alloc (__SIZE_TYPE__, int) __GOMP_NOTHROW;
extern void omp_target_free (void *, int) __GOMP_NOTHROW;
extern int omp_target_is_present (void *, int) __GOMP_NOTHROW;
extern int omp_target_memcpy (void *, void *, __SIZE_TYPE__, __SIZE_TYPE__,
__SIZE_TYPE__, int, int) __GOMP_NOTHROW;
extern int omp_target_memcpy_rect (void *, void *, __SIZE_TYPE__, int,
const __SIZE_TYPE__ *,
const __SIZE_TYPE__ *,
const __SIZE_TYPE__ *,
const __SIZE_TYPE__ *,
const __SIZE_TYPE__ *, int, int)
__GOMP_NOTHROW;
extern int omp_target_associate_ptr (void *, void *, __SIZE_TYPE__,
__SIZE_TYPE__, int) __GOMP_NOTHROW;
extern int omp_target_disassociate_ptr (void *, int) __GOMP_NOTHROW;
#ifdef __cplusplus
}
#endif
#endif /* OMP_H */
#endif /* _OMP_H */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.1 2014/09/19 17:23:57 matt Exp $
# $NetBSD: Makefile.inc,v 1.2 2019/04/15 14:02:23 maya Exp $
SRCS+= \
random.c \
@ -15,7 +15,6 @@ SRCS+= \
toom8h_mul.c \
zero.c \
mod_1_4.c \
gcdext.c \
add_err3_n.c \
binvert.c \
mu_div_q.c \
@ -26,14 +25,12 @@ SRCS+= \
dcpi1_div_qr.c \
hgcd_reduce.c \
matrix22_mul1_inverse_vector.c \
tabselect.c \
toom6_sqr.c \
divrem_1.c \
hgcd_step.c \
sub_err3_n.c \
mod_1.c \
toom42_mulmid.c \
divexact.c \
jacobi.c \
powlo.c \
mul.c \
@ -65,7 +62,6 @@ SRCS+= \
rshift.c \
div_q.c \
jacbase.c \
addcnd_n.c \
hgcd_matrix.c \
toom_eval_dgr3_pm1.c \
mullo_n.c \
@ -77,7 +73,6 @@ SRCS+= \
add_1.c \
sqr_basecase.c \
toom_interpolate_5pts.c \
sbpi1_bdiv_q.c \
pre_mod_1.c \
hgcd.c \
bdiv_dbm1c.c \
@ -97,11 +92,9 @@ SRCS+= \
sub_n.c \
toom_eval_pm2.c \
add_n.c \
subcnd_n.c \
hgcd2.c \
toom62_mul.c \
comb_tables.c \
sbpi1_bdiv_qr.c \
sub_err2_n.c \
scan1.c \
brootinv.c \
@ -136,10 +129,8 @@ SRCS+= \
dive_1.c \
cmp.c \
toom_eval_pm1.c \
hgcd_appr.c \
scan0.c \
gcd_subdiv_step.c \
sbpi1_div_qr.c \
invert.c \
sub.c \
toom_eval_pm2rexp.c \
@ -155,30 +146,187 @@ SRCS+= \
pow_1.c \
get_d.c \
toom52_mul.c \
sbpi1_div_q.c \
diveby3.c \
fib2_ui.c \
bdiv_qr.c \
hgcd_jacobi.c \
toom3_sqr.c \
gcd.c \
redc_n.c \
sub_err1_n.c \
C_SRCS_LIST= \
xor_n.c mpn/generic/logops_n.c \
sb_div_r_sec.c mpn/generic/sb_div_sec.c \
nand_n.c mpn/generic/logops_n.c \
nior_n.c mpn/generic/logops_n.c \
random.c mpn/generic/random.c \
toom_interpolate_7pts.c mpn/generic/toom_interpolate_7pts.c \
sbpi1_divappr_q.c mpn/generic/sbpi1_divappr_q.c \
random2.c mpn/generic/random2.c \
mu_bdiv_q.c mpn/generic/mu_bdiv_q.c \
mulmid_basecase.c mpn/generic/mulmid_basecase.c \
jacobi_2.c mpn/generic/jacobi_2.c \
toom32_mul.c mpn/generic/toom32_mul.c \
toom44_mul.c mpn/generic/toom44_mul.c \
toom8h_mul.c mpn/generic/toom8h_mul.c \
toom2_sqr.c mpn/generic/toom2_sqr.c \
zero.c mpn/generic/zero.c \
mod_1_4.c mpn/generic/mod_1_4.c \
gcdext.c mpn/generic/gcdext.c \
hamdist.c mpn/generic/popham.c \
popcount.c mpn/generic/popham.c \
sbpi1_div_qr_sec.c mpn/generic/sbpi1_div_sec.c \
and_n.c mpn/generic/logops_n.c \
ior_n.c mpn/generic/logops_n.c \
sb_div_qr_sec.c mpn/generic/sb_div_sec.c \
sec_powm.c mpn/generic/sec_powm.c \
add_err3_n.c mpn/generic/add_err3_n.c \
binvert.c mpn/generic/binvert.c \
mu_div_q.c mpn/generic/mu_div_q.c \
and_n.c mpn/generic/logops_n.c \
invertappr.c mpn/generic/invertappr.c \
add_n_sub_n.c mpn/generic/add_n_sub_n.c \
dump.c mpn/generic/dump.c \
mu_divappr_q.c mpn/generic/mu_divappr_q.c \
dcpi1_div_qr.c mpn/generic/dcpi1_div_qr.c \
hgcd_reduce.c mpn/generic/hgcd_reduce.c \
matrix22_mul1_inverse_vector.c mpn/generic/matrix22_mul1_inverse_vector.c \
toom6_sqr.c mpn/generic/toom6_sqr.c \
divrem_1.c mpn/generic/divrem_1.c \
hgcd_step.c mpn/generic/hgcd_step.c \
sub_err3_n.c mpn/generic/sub_err3_n.c \
mod_1.c mpn/generic/mod_1.c \
toom42_mulmid.c mpn/generic/toom42_mulmid.c \
sec_div_qr.c mpn/generic/sec_div.c \
andn_n.c mpn/generic/logops_n.c \
divexact.c mpn/generic/divexact.c \
jacobi.c mpn/generic/jacobi.c \
powlo.c mpn/generic/powlo.c \
mul.c mpn/generic/mul.c \
set_str.c mpn/generic/set_str.c \
toom42_mul.c mpn/generic/toom42_mul.c \
toom_interpolate_6pts.c mpn/generic/toom_interpolate_6pts.c \
toom54_mul.c mpn/generic/toom54_mul.c \
dcpi1_divappr_q.c mpn/generic/dcpi1_divappr_q.c \
toom_eval_dgr3_pm2.c mpn/generic/toom_eval_dgr3_pm2.c \
mod_1_3.c mpn/generic/mod_1_3.c \
xor_n.c mpn/generic/logops_n.c \
nior_n.c mpn/generic/logops_n.c \
toom_couple_handling.c mpn/generic/toom_couple_handling.c \
add.c mpn/generic/add.c \
div_qr_2.c mpn/generic/div_qr_2.c \
toom_interpolate_12pts.c mpn/generic/toom_interpolate_12pts.c \
perfsqr.c mpn/generic/perfsqr.c \
toom53_mul.c mpn/generic/toom53_mul.c \
toom_eval_pm2exp.c mpn/generic/toom_eval_pm2exp.c \
mu_div_qr.c mpn/generic/mu_div_qr.c \
toom_interpolate_16pts.c mpn/generic/toom_interpolate_16pts.c \
bdiv_q.c mpn/generic/bdiv_q.c \
sec_invert.c mpn/generic/sec_invert.c \
toom22_mul.c mpn/generic/toom22_mul.c \
bsqrtinv.c mpn/generic/bsqrtinv.c \
toom4_sqr.c mpn/generic/toom4_sqr.c \
div_q.c mpn/generic/div_q.c \
jacbase.c mpn/generic/jacbase.c \
sec_sqr.c mpn/generic/sec_sqr.c \
hgcd_matrix.c mpn/generic/hgcd_matrix.c \
toom_eval_dgr3_pm1.c mpn/generic/toom_eval_dgr3_pm1.c \
mullo_n.c mpn/generic/mullo_n.c \
toom33_mul.c mpn/generic/toom33_mul.c \
mod_1_2.c mpn/generic/mod_1_2.c \
sqrlo.c mpn/generic/sqrlo.c \
sub_1.c mpn/generic/sub_1.c \
add_err2_n.c mpn/generic/add_err2_n.c \
trialdiv.c mpn/generic/trialdiv.c \
add_1.c mpn/generic/add_1.c \
sqr_basecase.c mpn/generic/sqr_basecase.c \
toom_interpolate_5pts.c mpn/generic/toom_interpolate_5pts.c \
sbpi1_bdiv_q.c mpn/generic/sbpi1_bdiv_q.c \
pre_mod_1.c mpn/generic/pre_mod_1.c \
hgcd.c mpn/generic/hgcd.c \
div_qr_1.c mpn/generic/div_qr_1.c \
sqrtrem.c mpn/generic/sqrtrem.c \
bdiv_q_1.c mpn/generic/bdiv_q_1.c \
gcdext_1.c mpn/generic/gcdext_1.c \
toom63_mul.c mpn/generic/toom63_mul.c \
div_qr_2u_pi1.c mpn/generic/div_qr_2u_pi1.c \
mul_basecase.c mpn/generic/mul_basecase.c \
toom8_sqr.c mpn/generic/toom8_sqr.c \
neg.c mpn/generic/neg.c \
gcdext_lehmer.c mpn/generic/gcdext_lehmer.c \
divis.c mpn/generic/divis.c \
dcpi1_div_q.c mpn/generic/dcpi1_div_q.c \
sec_div_r.c mpn/generic/sec_div.c \
toom_eval_pm2.c mpn/generic/toom_eval_pm2.c \
hgcd2.c mpn/generic/hgcd2.c \
toom62_mul.c mpn/generic/toom62_mul.c \
comb_tables.c mpn/generic/comb_tables.c \
sbpi1_bdiv_qr.c mpn/generic/sbpi1_bdiv_qr.c \
sub_err2_n.c mpn/generic/sub_err2_n.c \
scan1.c mpn/generic/scan1.c \
brootinv.c mpn/generic/brootinv.c \
pre_divrem_1.c mpn/generic/pre_divrem_1.c \
perfpow.c mpn/generic/perfpow.c \
get_str.c mpn/generic/get_str.c \
mulmod_bnm1.c mpn/generic/mulmod_bnm1.c \
mullo_basecase.c mpn/generic/mullo_basecase.c \
ior_n.c mpn/generic/logops_n.c \
tdiv_qr.c mpn/generic/tdiv_qr.c \
sec_pi1_div_qr.c mpn/generic/sec_pi1_div.c \
div_qr_2n_pi1.c mpn/generic/div_qr_2n_pi1.c \
toom43_mul.c mpn/generic/toom43_mul.c \
mod_1_1.c mpn/generic/mod_1_1.c \
matrix22_mul.c mpn/generic/matrix22_mul.c \
sec_pi1_div_r.c mpn/generic/sec_pi1_div.c \
xnor_n.c mpn/generic/logops_n.c \
iorn_n.c mpn/generic/logops_n.c \
sbpi1_div_r_sec.c mpn/generic/sbpi1_div_sec.c \
andn_n.c mpn/generic/logops_n.c \
divrem.c mpn/generic/divrem.c \
bsqrt.c mpn/generic/bsqrt.c \
gcd_1.c mpn/generic/gcd_1.c \
dcpi1_bdiv_qr.c mpn/generic/dcpi1_bdiv_qr.c \
mul_n.c mpn/generic/mul_n.c \
redc_2.c mpn/generic/redc_2.c \
toom6h_mul.c mpn/generic/toom6h_mul.c \
sqrmod_bnm1.c mpn/generic/sqrmod_bnm1.c \
mul_fft.c mpn/generic/mul_fft.c \
mulmid.c mpn/generic/mulmid.c \
powm.c mpn/generic/powm.c \
rootrem.c mpn/generic/rootrem.c \
cnd_sub_n.c mpn/generic/cnd_sub_n.c \
cnd_add_n.c mpn/generic/cnd_add_n.c \
toom_interpolate_8pts.c mpn/generic/toom_interpolate_8pts.c \
remove.c mpn/generic/remove.c \
lshiftc.c mpn/generic/lshiftc.c \
sec_mul.c mpn/generic/sec_mul.c \
cmp.c mpn/generic/cmp.c \
toom_eval_pm1.c mpn/generic/toom_eval_pm1.c \
nand_n.c mpn/generic/logops_n.c \
hgcd_appr.c mpn/generic/hgcd_appr.c \
cnd_swap.c mpn/generic/cnd_swap.c \
scan0.c mpn/generic/scan0.c \
gcd_subdiv_step.c mpn/generic/gcd_subdiv_step.c \
sbpi1_div_qr.c mpn/generic/sbpi1_div_qr.c \
invert.c mpn/generic/invert.c \
sub.c mpn/generic/sub.c \
sqrlo_basecase.c mpn/generic/sqrlo_basecase.c \
toom_eval_pm2rexp.c mpn/generic/toom_eval_pm2rexp.c \
sec_sub_1.c mpn/generic/sec_aors_1.c \
broot.c mpn/generic/broot.c \
sec_add_1.c mpn/generic/sec_aors_1.c \
popcount.c mpn/generic/popham.c \
dcpi1_bdiv_q.c mpn/generic/dcpi1_bdiv_q.c \
hgcd2_jacobi.c mpn/generic/hgcd2_jacobi.c \
add_err1_n.c mpn/generic/add_err1_n.c \
mulmid_n.c mpn/generic/mulmid_n.c \
redc_1.c mpn/generic/redc_1.c \
sqr.c mpn/generic/sqr.c \
nussbaumer_mul.c mpn/generic/nussbaumer_mul.c \
zero_p.c mpn/generic/zero_p.c \
mu_bdiv_qr.c mpn/generic/mu_bdiv_qr.c \
pow_1.c mpn/generic/pow_1.c \
get_d.c mpn/generic/get_d.c \
toom52_mul.c mpn/generic/toom52_mul.c \
sbpi1_div_q.c mpn/generic/sbpi1_div_q.c \
diveby3.c mpn/generic/diveby3.c \
fib2_ui.c mpn/generic/fib2_ui.c \
bdiv_qr.c mpn/generic/bdiv_qr.c \
hgcd_jacobi.c mpn/generic/hgcd_jacobi.c \
div_qr_1n_pi1.c mpn/generic/div_qr_1n_pi1.c \
sizeinbase.c mpn/generic/sizeinbase.c \
toom3_sqr.c mpn/generic/toom3_sqr.c \
gcd.c mpn/generic/gcd.c \
redc_n.c mpn/generic/redc_n.c \
sub_err1_n.c mpn/generic/sub_err1_n.c
GMP_LIMB_BITS=64

View File

@ -1,23 +1,32 @@
/* Definitions for GNU multiple precision functions. -*- mode: c -*-
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free
Software Foundation, Inc.
Copyright 1991, 1993-1997, 1999-2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#ifndef __GMP_H__
@ -40,23 +49,15 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define GMP_NAIL_MASK (~ GMP_NUMB_MASK)
/* The following (everything under ifndef __GNU_MP__) must be identical in
gmp.h and mp.h to allow both to be included in an application or during
the library build. */
#ifndef __GNU_MP__
#define __GNU_MP__ 5
#define __GNU_MP__ 6
#define __need_size_t /* tell gcc stddef.h we only want size_t */
#if defined (__cplusplus)
#include <cstddef> /* for size_t */
#else
#include <stddef.h> /* for size_t */
#endif
#undef __need_size_t
#include <limits.h>
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
/* #undef _LONG_LONG_LIMB */
#define _LONG_LONG_LIMB 1
#define __GMP_LIBGMP_DLL 0
#endif
@ -228,8 +229,6 @@ typedef const __mpq_struct *mpq_srcptr;
typedef __mpq_struct *mpq_ptr;
/* This is not wanted in mp.h, so put it outside the __GNU_MP__ common
section. */
#if __GMP_LIBGMP_DLL
#ifdef __GMP_WITHIN_GMPXX
/* compiling to go into a DLL libgmpxx */
@ -264,7 +263,8 @@ typedef __mpq_struct *mpq_ptr;
|| defined (_MSL_STDIO_H) /* Metrowerks */ \
|| defined (_STDIO_H_INCLUDED) /* QNX4 */ \
|| defined (_ISO_STDIO_ISO_H) /* Sun C++ */ \
|| defined (__STDIO_LOADED) /* VMS */
|| defined (__STDIO_LOADED) /* VMS */ \
|| defined (__DEFINED_FILE) /* musl */
#define _GMP_H_HAVE_FILE 1
#endif
@ -276,16 +276,14 @@ typedef __mpq_struct *mpq_ptr;
#define _GMP_H_HAVE_OBSTACK 1
#endif
/* The prototypes for gmp_vprintf etc are provided only if va_list is
available, via an application having included <stdarg.h> or <varargs.h>.
Usually va_list is a typedef so can't be tested directly, but C99
specifies that va_start is a macro (and it was normally a macro on past
systems too), so look for that.
/* The prototypes for gmp_vprintf etc are provided only if va_list is defined,
via an application having included <stdarg.h>. Usually va_list is a typedef
so can't be tested directly, but C99 specifies that va_start is a macro.
<stdio.h> will define some sort of va_list for vprintf and vfprintf, but
let's not bother trying to use that since it's not standard and since
application uses for gmp_vprintf etc will almost certainly require the
whole <stdarg.h> or <varargs.h> anyway. */
whole <stdarg.h> anyway. */
#ifdef va_start
#define _GMP_H_HAVE_VA_LIST 1
@ -359,10 +357,11 @@ typedef __mpq_struct *mpq_ptr;
GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
inline semantics, unless -fgnu89-inline is used. */
#ifdef __GNUC__
#if (defined __GNUC_STDC_INLINE__) || \
(__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || \
(__GNUC__ > 4)
#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \
|| (defined __GNUC_GNU_INLINE__ && defined __cplusplus)
#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
#else
#define __GMP_EXTERN_INLINE extern __inline__
#endif
#define __GMP_INLINE_PROTOTYPES 1
#endif
@ -443,12 +442,6 @@ typedef __mpq_struct *mpq_ptr;
#define __GMP_ABS(x) ((x) >= 0 ? (x) : -(x))
#define __GMP_MAX(h,i) ((h) > (i) ? (h) : (i))
/* __GMP_USHRT_MAX is not "~ (unsigned short) 0" because short is promoted
to int by "~". */
#define __GMP_UINT_MAX (~ (unsigned) 0)
#define __GMP_ULONG_MAX (~ (unsigned long) 0)
#define __GMP_USHRT_MAX ((unsigned short) ~0)
/* __builtin_expect is in gcc 3.0, and not in 2.95. */
#if __GMP_GNUC_PREREQ (3,0)
@ -466,7 +459,7 @@ typedef __mpq_struct *mpq_ptr;
#endif
/* Allow direct user access to numerator and denominator of a mpq_t object. */
/* Allow direct user access to numerator and denominator of an mpq_t object. */
#define mpq_numref(Q) (&((Q)->_mp_num))
#define mpq_denref(Q) (&((Q)->_mp_den))
@ -483,8 +476,8 @@ __GMP_DECLSPEC void mp_set_memory_functions (void *(*) (size_t),
#define mp_get_memory_functions __gmp_get_memory_functions
__GMP_DECLSPEC void mp_get_memory_functions (void *(**) (size_t),
void *(**) (void *, size_t, size_t),
void (**) (void *, size_t)) __GMP_NOTHROW;
void *(**) (void *, size_t, size_t),
void (**) (void *, size_t)) __GMP_NOTHROW;
#define mp_bits_per_limb __gmp_bits_per_limb
__GMP_DECLSPEC extern const int mp_bits_per_limb;
@ -1116,6 +1109,22 @@ __GMP_DECLSPEC void mpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);
#define mpz_eor __gmpz_xor
__GMP_DECLSPEC void mpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);
#define mpz_limbs_read __gmpz_limbs_read
__GMP_DECLSPEC mp_srcptr mpz_limbs_read (mpz_srcptr);
#define mpz_limbs_write __gmpz_limbs_write
__GMP_DECLSPEC mp_ptr mpz_limbs_write (mpz_ptr, mp_size_t);
#define mpz_limbs_modify __gmpz_limbs_modify
__GMP_DECLSPEC mp_ptr mpz_limbs_modify (mpz_ptr, mp_size_t);
#define mpz_limbs_finish __gmpz_limbs_finish
__GMP_DECLSPEC void mpz_limbs_finish (mpz_ptr, mp_size_t);
#define mpz_roinit_n __gmpz_roinit_n
__GMP_DECLSPEC mpz_srcptr mpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t);
#define MPZ_ROINIT_N(xp, xs) {{0, (xs),(xp) }}
/**************** Rational (i.e. Q) routines. ****************/
@ -1145,6 +1154,9 @@ __GMP_DECLSPEC int _mpq_cmp_si (mpq_srcptr, long, unsigned long) __GMP_ATTRIBUTE
#define _mpq_cmp_ui __gmpq_cmp_ui
__GMP_DECLSPEC int _mpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __GMP_ATTRIBUTE_PURE;
#define mpq_cmp_z __gmpq_cmp_z
__GMP_DECLSPEC int mpq_cmp_z (mpq_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
#define mpq_div __gmpq_div
__GMP_DECLSPEC void mpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr);
@ -1252,6 +1264,9 @@ __GMP_DECLSPEC void mpf_clears (mpf_ptr, ...);
#define mpf_cmp __gmpf_cmp
__GMP_DECLSPEC int mpf_cmp (mpf_srcptr, mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
#define mpf_cmp_z __gmpf_cmp_z
__GMP_DECLSPEC int mpf_cmp_z (mpf_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
#define mpf_cmp_d __gmpf_cmp_d
__GMP_DECLSPEC int mpf_cmp_d (mpf_srcptr, double) __GMP_ATTRIBUTE_PURE;
@ -1462,6 +1477,14 @@ __GMP_DECLSPEC mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
__GMP_DECLSPEC int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
#endif
#define mpn_zero_p __MPN(zero_p)
#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_zero_p)
__GMP_DECLSPEC int mpn_zero_p (mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
#endif
#define mpn_divexact_1 __MPN(divexact_1)
__GMP_DECLSPEC void mpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#define mpn_divexact_by3(dst,src,size) \
mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0))
@ -1480,6 +1503,9 @@ __GMP_DECLSPEC mp_limb_t mpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t,
#define mpn_divrem_2 __MPN(divrem_2)
__GMP_DECLSPEC mp_limb_t mpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr);
#define mpn_div_qr_1 __MPN(div_qr_1)
__GMP_DECLSPEC mp_limb_t mpn_div_qr_1 (mp_ptr, mp_limb_t *, mp_srcptr, mp_size_t, mp_limb_t);
#define mpn_div_qr_2 __MPN(div_qr_2)
__GMP_DECLSPEC mp_limb_t mpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
@ -1525,9 +1551,7 @@ __GMP_DECLSPEC mp_limb_t mpn_neg (mp_ptr, mp_srcptr, mp_size_t);
#endif
#define mpn_com __MPN(com)
#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_com)
__GMP_DECLSPEC void mpn_com (mp_ptr, mp_srcptr, mp_size_t);
#endif
#define mpn_perfect_square_p __MPN(perfect_square_p)
__GMP_DECLSPEC int mpn_perfect_square_p (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
@ -1563,6 +1587,9 @@ __GMP_DECLSPEC mp_bitcnt_t mpn_scan1 (mp_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PU
#define mpn_set_str __MPN(set_str)
__GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
#define mpn_sizeinbase __MPN(sizeinbase)
__GMP_DECLSPEC size_t mpn_sizeinbase (mp_srcptr, mp_size_t, int);
#define mpn_sqrtrem __MPN(sqrtrem)
__GMP_DECLSPEC mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
@ -1609,8 +1636,56 @@ __GMP_DECLSPEC void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
#define mpn_zero __MPN(zero)
__GMP_DECLSPEC void mpn_zero (mp_ptr, mp_size_t);
#define mpn_udiv_w_sdiv __MPN(udiv_w_sdiv)
__GMP_DECLSPEC mp_limb_t mpn_udiv_w_sdiv (mp_limb_t *, mp_limb_t, mp_limb_t, mp_limb_t);
#define mpn_cnd_add_n __MPN(cnd_add_n)
__GMP_DECLSPEC mp_limb_t mpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_cnd_sub_n __MPN(cnd_sub_n)
__GMP_DECLSPEC mp_limb_t mpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_sec_add_1 __MPN(sec_add_1)
__GMP_DECLSPEC mp_limb_t mpn_sec_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
#define mpn_sec_add_1_itch __MPN(sec_add_1_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_add_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_sub_1 __MPN(sec_sub_1)
__GMP_DECLSPEC mp_limb_t mpn_sec_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
#define mpn_sec_sub_1_itch __MPN(sec_sub_1_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_sub_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_cnd_swap __MPN(cnd_swap)
__GMP_DECLSPEC void mpn_cnd_swap (mp_limb_t, volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t);
#define mpn_sec_mul __MPN(sec_mul)
__GMP_DECLSPEC void mpn_sec_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sec_mul_itch __MPN(sec_mul_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_mul_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_sqr __MPN(sec_sqr)
__GMP_DECLSPEC void mpn_sec_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sec_sqr_itch __MPN(sec_sqr_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_sqr_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_powm __MPN(sec_powm)
__GMP_DECLSPEC void mpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_bitcnt_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sec_powm_itch __MPN(sec_powm_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_powm_itch (mp_size_t, mp_bitcnt_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_tabselect __MPN(sec_tabselect)
__GMP_DECLSPEC void mpn_sec_tabselect (volatile mp_limb_t *, volatile const mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
#define mpn_sec_div_qr __MPN(sec_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sec_div_qr_itch __MPN(sec_div_qr_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_div_qr_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_div_r __MPN(sec_div_r)
__GMP_DECLSPEC void mpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_sec_div_r_itch __MPN(sec_div_r_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_div_r_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
#define mpn_sec_invert __MPN(sec_invert)
__GMP_DECLSPEC int mpn_sec_invert (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_bitcnt_t, mp_ptr);
#define mpn_sec_invert_itch __MPN(sec_invert_itch)
__GMP_DECLSPEC mp_size_t mpn_sec_invert_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
/**************** mpz inlines ****************/
@ -1658,7 +1733,7 @@ __GMP_EXTERN_INLINE
int
mpz_fits_uint_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
{
__GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_UINT_MAX);
__GMPZ_FITS_UTYPE_P (__gmp_z, UINT_MAX);
}
#endif
@ -1669,7 +1744,7 @@ __GMP_EXTERN_INLINE
int
mpz_fits_ulong_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
{
__GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_ULONG_MAX);
__GMPZ_FITS_UTYPE_P (__gmp_z, ULONG_MAX);
}
#endif
@ -1680,7 +1755,7 @@ __GMP_EXTERN_INLINE
int
mpz_fits_ushort_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
{
__GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_USHRT_MAX);
__GMPZ_FITS_UTYPE_P (__gmp_z, USHRT_MAX);
}
#endif
@ -1697,7 +1772,7 @@ mpz_get_ui (mpz_srcptr __gmp_z) __GMP_NOTHROW
/* This is a "#if" rather than a plain "if" so as to avoid gcc warnings
about "<< GMP_NUMB_BITS" exceeding the type size, and to avoid Borland
C++ 6.0 warnings about condition always true for something like
"__GMP_ULONG_MAX < GMP_NUMB_MASK". */
"ULONG_MAX < GMP_NUMB_MASK". */
#if GMP_NAIL_BITS == 0 || defined (_LONG_LONG_LIMB)
/* limb==long and no nails, or limb==longlong, one limb is enough */
return (__gmp_n != 0 ? __gmp_l : 0);
@ -1765,7 +1840,7 @@ mpz_popcount (mpz_srcptr __gmp_u) __GMP_NOTHROW
mp_bitcnt_t __gmp_result;
__gmp_usize = __gmp_u->_mp_size;
__gmp_result = (__gmp_usize < 0 ? __GMP_ULONG_MAX : 0);
__gmp_result = (__gmp_usize < 0 ? ULONG_MAX : 0);
if (__GMP_LIKELY (__gmp_usize > 0))
__gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
return __gmp_result;
@ -2088,6 +2163,22 @@ mpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) __GMP_NOT
}
#endif
#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_zero_p)
#if ! defined (__GMP_FORCE_mpn_zero_p)
__GMP_EXTERN_INLINE
#endif
int
mpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) __GMP_NOTHROW
{
/* if (__GMP_LIKELY (__gmp_n > 0)) */
do {
if (__gmp_p[--__gmp_n] != 0)
return 0;
} while (__gmp_n != 0);
return 1;
}
#endif
#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub)
#if ! defined (__GMP_FORCE_mpn_sub)
__GMP_EXTERN_INLINE
@ -2121,14 +2212,20 @@ __GMP_EXTERN_INLINE
mp_limb_t
mpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
{
mp_limb_t __gmp_ul, __gmp_cy;
__gmp_cy = 0;
do {
__gmp_ul = *__gmp_up++;
*__gmp_rp++ = -__gmp_ul - __gmp_cy;
__gmp_cy |= __gmp_ul != 0;
} while (--__gmp_n != 0);
return __gmp_cy;
while (*__gmp_up == 0) /* Low zero limbs are unchanged by negation. */
{
*__gmp_rp = 0;
if (!--__gmp_n) /* All zero */
return 0;
++__gmp_up; ++__gmp_rp;
}
*__gmp_rp = (- *__gmp_up) & GMP_NUMB_MASK;
if (--__gmp_n) /* Higher limbs get complemented. */
mpn_com (++__gmp_rp, ++__gmp_up, __gmp_n);
return 1;
}
#endif
@ -2147,17 +2244,18 @@ mpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
#define mpz_cmp_ui(Z,UI) \
(__builtin_constant_p (UI) && (UI) == 0 \
? mpz_sgn (Z) : _mpz_cmp_ui (Z,UI))
#define mpz_cmp_si(Z,SI) \
(__builtin_constant_p (SI) && (SI) == 0 ? mpz_sgn (Z) \
: __builtin_constant_p (SI) && (SI) > 0 \
? _mpz_cmp_ui (Z, __GMP_CAST (unsigned long int, SI)) \
#define mpz_cmp_si(Z,SI) \
(__builtin_constant_p ((SI) >= 0) && (SI) >= 0 \
? mpz_cmp_ui (Z, __GMP_CAST (unsigned long, SI)) \
: _mpz_cmp_si (Z,SI))
#define mpq_cmp_ui(Q,NUI,DUI) \
(__builtin_constant_p (NUI) && (NUI) == 0 \
? mpq_sgn (Q) : _mpq_cmp_ui (Q,NUI,DUI))
#define mpq_cmp_si(q,n,d) \
(__builtin_constant_p ((n) >= 0) && (n) >= 0 \
? mpq_cmp_ui (q, __GMP_CAST (unsigned long, n), d) \
#define mpq_cmp_ui(Q,NUI,DUI) \
(__builtin_constant_p (NUI) && (NUI) == 0 ? mpq_sgn (Q) \
: __builtin_constant_p ((NUI) == (DUI)) && (NUI) == (DUI) \
? mpz_cmp (mpq_numref (Q), mpq_denref (Q)) \
: _mpq_cmp_ui (Q,NUI,DUI))
#define mpq_cmp_si(q,n,d) \
(__builtin_constant_p ((n) >= 0) && (n) >= 0 \
? mpq_cmp_ui (q, __GMP_CAST (unsigned long, n), d) \
: _mpq_cmp_si (q, n, d))
#else
#define mpz_cmp_ui(Z,UI) _mpz_cmp_ui (Z,UI)
@ -2218,13 +2316,13 @@ enum
};
/* Define CC and CFLAGS which were used to build this version of GMP */
#define __GMP_CC "gcc -std=gnu99"
#define __GMP_CFLAGS "-O2 -pedantic"
#define __GMP_CC "gcc"
#define __GMP_CFLAGS "-O2 -pedantic -mabi=n32"
/* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
#define __GNU_MP_VERSION 5
/* Major version number is the value of __GNU_MP__ too, above. */
#define __GNU_MP_VERSION 6
#define __GNU_MP_VERSION_MINOR 1
#define __GNU_MP_VERSION_PATCHLEVEL 3
#define __GNU_MP_VERSION_PATCHLEVEL 2
#define __GNU_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
#define __GMP_H__