xref: /netbsd-src/external/lgpl3/mpfr/dist/src/mparam_h.in (revision ba125506a622fe649968631a56eba5d42ff57863)
1/* Various Thresholds of MPFR, not exported.  -*- mode: C -*-
2
3Copyright 2005-2023 Free Software Foundation, Inc.
4
5This file is part of the GNU MPFR Library.
6
7The GNU MPFR Library is free software; you can redistribute it and/or modify
8it under the terms of the GNU Lesser General Public License as published by
9the Free Software Foundation; either version 3 of the License, or (at your
10option) any later version.
11
12The GNU MPFR Library is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15License for more details.
16
17You should have received a copy of the GNU Lesser General Public License
18along with the GNU MPFR Library; see the file COPYING.LESSER.  If not, see
19https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
2051 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
21
22#ifndef __MPFR_IMPL_H__
23# error "MPFR Internal not included"
24#endif
25
26/* Threshold when testing coverage */
27#if defined(MPFR_TUNE_COVERAGE)
28#define MPFR_TUNE_CASE "src/generic/coverage/mparam.h"
29#include "generic/coverage/mparam.h"
30
31/* Note: the different macros used here are those defined by gcc,
32   for example with "gcc -mtune=native -dM -E -xc /dev/null".
33
34   The best parameters may depend on the local machine, not just
35   the architecture or even the target processor as accepted by
36   -mtune. Target-related options set by GCC can be obtained with
37   the "-Q --help=target --help=params" options (in addition to
38   -march=... and -mtune=...).
39   See https://gcc.gnu.org/pipermail/gcc-help/2021-September/140720.html */
40
41#elif (defined (__tune_core2__) || defined (__tune_nocona__)) && defined (__x86_64) /* 64-bit Core 2 or Xeon */
42#define MPFR_TUNE_CASE "src/x86_64/core2/mparam.h"
43#include "x86_64/core2/mparam.h"
44
45/* Put that before __x86_64__ since __x86_64__ is also defined on AMD 64,
46   We also have to define __tune_k8__ since __amd64__ is also defined on
47   Intel x86_64! Ignore Clang as it defines both of these macros even on
48   Intel x86_64, and it does not seem to be possible to provide tuning
49   information when compiling with Clang, so that it is better to select
50   generic parameters for x86_64. */
51#elif defined (__amd64__) && (defined (__tune_k8__) || defined (__tune_znver1__)) && ! defined (__clang__) /* AMD 64 */
52#define MPFR_TUNE_CASE "src/amd/mparam.h"
53#include "amd/mparam.h"
54
55/* _M_X64 is for the Microsoft compiler, see
56   https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros */
57#elif defined (__x86_64__) || defined (_M_X64)
58/* generic parameters for x86_64 */
59#define MPFR_TUNE_CASE "src/x86_64/mparam.h"
60#include "x86_64/mparam.h"
61
62#elif defined (__i386) || defined(_M_IX86)
63/* we consider all other 386's here,
64   including a 64-bit machine with gmp/mpfr compiled with ABI=32 */
65#define MPFR_TUNE_CASE "src/x86/mparam.h"
66#include "x86/mparam.h"
67
68#elif defined (__PPC64__) /* Threshold for 64-bit PowerPC */
69#define MPFR_TUNE_CASE "src/powerpc64/mparam.h"
70#include "powerpc64/mparam.h"
71
72#elif defined (__sparc_v9__) /* Threshold for 64-bit Sparc */
73#define MPFR_TUNE_CASE "src/sparc64/mparam.h"
74#include "sparc64/mparam.h"
75
76#elif defined (__mips__) /* MIPS */
77#define MPFR_TUNE_CASE "src/mips/mparam.h"
78#include "mips/mparam.h"
79
80#elif defined (__arm__) || defined (_M_ARM) /* ARM */
81#define MPFR_TUNE_CASE "src/arm/mparam.h"
82#include "arm/mparam.h"
83
84#else
85#define MPFR_TUNE_CASE "default"
86#endif
87
88/****************************************************************
89 * Default values of Threshold.                                 *
90 * Must be included in any case: it checks, for every constant, *
91 * if it has been defined, and it sets it to a default value if *
92 * it was not previously defined.                               *
93 ****************************************************************/
94#include "generic/mparam.h"
95