Bitcoin Core  22.99.0
P2P Digital Currency
glibc_compat.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
7 #endif
8 
9 #include <cstddef>
10 #include <cstdint>
11 
12 #if defined(__i386__) || defined(__arm__)
13 
14 extern "C" int64_t __udivmoddi4(uint64_t u, uint64_t v, uint64_t* rp);
15 
16 extern "C" int64_t __wrap___divmoddi4(int64_t u, int64_t v, int64_t* rp)
17 {
18  int32_t c1 = 0, c2 = 0;
19  int64_t uu = u, vv = v;
20  int64_t w;
21  int64_t r;
22 
23  if (uu < 0) {
24  c1 = ~c1, c2 = ~c2, uu = -uu;
25  }
26  if (vv < 0) {
27  c1 = ~c1, vv = -vv;
28  }
29 
30  w = __udivmoddi4(uu, vv, (uint64_t*)&r);
31  if (c1)
32  w = -w;
33  if (c2)
34  r = -r;
35 
36  *rp = r;
37  return w;
38 }
39 #endif
40 
41 extern "C" float log2f_old(float x);
42 #ifdef __i386__
43 __asm(".symver log2f_old,log2f@GLIBC_2.1");
44 #elif defined(__amd64__)
45 __asm(".symver log2f_old,log2f@GLIBC_2.2.5");
46 #elif defined(__arm__)
47 __asm(".symver log2f_old,log2f@GLIBC_2.4");
48 #elif defined(__aarch64__)
49 __asm(".symver log2f_old,log2f@GLIBC_2.17");
50 #elif defined(__powerpc64__)
51 # ifdef WORDS_BIGENDIAN
52 __asm(".symver log2f_old,log2f@GLIBC_2.3");
53 # else
54 __asm(".symver log2f_old,log2f@GLIBC_2.17");
55 # endif
56 #elif defined(__riscv)
57 __asm(".symver log2f_old,log2f@GLIBC_2.27");
58 #endif
59 extern "C" float __wrap_log2f(float x)
60 {
61  return log2f_old(x);
62 }
bitcoin-config.h
__wrap_log2f
float __wrap_log2f(float x)
Definition: glibc_compat.cpp:59
log2f_old
float log2f_old(float x)