]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgcc/config/darwin-64.c
Update copyright years.
[thirdparty/gcc.git] / libgcc / config / darwin-64.c
CommitLineData
f7288899
EC
1/* Functions shipped in the ppc64 and x86_64 version of libgcc_s.1.dylib
2 in older Mac OS X versions, preserved for backwards compatibility.
99dee823 3 Copyright (C) 2006-2021 Free Software Foundation, Inc.
f7288899
EC
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
748086b7 9Software Foundation; either version 3, or (at your option) any later
f7288899
EC
10version.
11
f7288899
EC
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
748086b7
JJ
17Under Section 7 of GPL version 3, you are granted additional
18permissions described in the GCC Runtime Library Exception, version
193.1, as published by the Free Software Foundation.
20
21You should have received a copy of the GNU General Public License and
22a copy of the GCC Runtime Library Exception along with this program;
23see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24<http://www.gnu.org/licenses/>. */
f7288899
EC
25
26#if defined (__ppc64__) || defined (__x86_64__)
27/* Many of these functions have probably never been used by anyone
28 anywhere on these targets, but it's hard to prove this, so they're defined
29 here. None are actually necessary, as demonstrated below by defining
30 each function using the operation it implements. */
31
32typedef long DI;
33typedef unsigned long uDI;
34typedef int SI;
35typedef unsigned int uSI;
36typedef int word_type __attribute__ ((mode (__word__)));
37
38DI __ashldi3 (DI x, word_type c);
39DI __ashrdi3 (DI x, word_type c);
40int __clzsi2 (uSI x);
41word_type __cmpdi2 (DI x, DI y);
42int __ctzsi2 (uSI x);
43DI __divdi3 (DI x, DI y);
44uDI __lshrdi3 (uDI x, word_type c);
45DI __moddi3 (DI x, DI y);
46DI __muldi3 (DI x, DI y);
47DI __negdi2 (DI x);
48int __paritysi2 (uSI x);
49int __popcountsi2 (uSI x);
50word_type __ucmpdi2 (uDI x, uDI y);
51uDI __udivdi3 (uDI x, uDI y);
52uDI __udivmoddi4 (uDI x, uDI y, uDI *r);
53uDI __umoddi3 (uDI x, uDI y);
54
55DI __ashldi3 (DI x, word_type c) { return x << c; }
56DI __ashrdi3 (DI x, word_type c) { return x >> c; }
57int __clzsi2 (uSI x) { return __builtin_clz (x); }
58word_type __cmpdi2 (DI x, DI y) { return x < y ? 0 : x == y ? 1 : 2; }
59int __ctzsi2 (uSI x) { return __builtin_ctz (x); }
60DI __divdi3 (DI x, DI y) { return x / y; }
61uDI __lshrdi3 (uDI x, word_type c) { return x >> c; }
62DI __moddi3 (DI x, DI y) { return x % y; }
63DI __muldi3 (DI x, DI y) { return x * y; }
64DI __negdi2 (DI x) { return -x; }
65int __paritysi2 (uSI x) { return __builtin_parity (x); }
66int __popcountsi2 (uSI x) { return __builtin_popcount (x); }
67word_type __ucmpdi2 (uDI x, uDI y) { return x < y ? 0 : x == y ? 1 : 2; }
68uDI __udivdi3 (uDI x, uDI y) { return x / y; }
69uDI __udivmoddi4 (uDI x, uDI y, uDI *r) { *r = x % y; return x / y; }
70uDI __umoddi3 (uDI x, uDI y) { return x % y; }
71
72#endif /* __ppc64__ || __x86_64__ */