xref: /netbsd-src/external/gpl3/gcc.old/dist/libgcc/config/darwin-64.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg /* Functions shipped in the ppc64 and x86_64 version of libgcc_s.1.dylib
21debfc3dSmrg    in older Mac OS X versions, preserved for backwards compatibility.
3*8feb0f0bSmrg    Copyright (C) 2006-2020 Free Software Foundation, Inc.
41debfc3dSmrg 
51debfc3dSmrg This file is part of GCC.
61debfc3dSmrg 
71debfc3dSmrg GCC is free software; you can redistribute it and/or modify it under
81debfc3dSmrg the terms of the GNU General Public License as published by the Free
91debfc3dSmrg Software Foundation; either version 3, or (at your option) any later
101debfc3dSmrg version.
111debfc3dSmrg 
121debfc3dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
131debfc3dSmrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
141debfc3dSmrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
151debfc3dSmrg for more details.
161debfc3dSmrg 
171debfc3dSmrg Under Section 7 of GPL version 3, you are granted additional
181debfc3dSmrg permissions described in the GCC Runtime Library Exception, version
191debfc3dSmrg 3.1, as published by the Free Software Foundation.
201debfc3dSmrg 
211debfc3dSmrg You should have received a copy of the GNU General Public License and
221debfc3dSmrg a copy of the GCC Runtime Library Exception along with this program;
231debfc3dSmrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
241debfc3dSmrg <http://www.gnu.org/licenses/>.  */
251debfc3dSmrg 
261debfc3dSmrg #if defined (__ppc64__) || defined (__x86_64__)
271debfc3dSmrg /* Many of these functions have probably never been used by anyone
281debfc3dSmrg    anywhere on these targets, but it's hard to prove this, so they're defined
291debfc3dSmrg    here.  None are actually necessary, as demonstrated below by defining
301debfc3dSmrg    each function using the operation it implements.  */
311debfc3dSmrg 
321debfc3dSmrg typedef long DI;
331debfc3dSmrg typedef unsigned long uDI;
341debfc3dSmrg typedef int SI;
351debfc3dSmrg typedef unsigned int uSI;
361debfc3dSmrg typedef int word_type __attribute__ ((mode (__word__)));
371debfc3dSmrg 
381debfc3dSmrg DI __ashldi3 (DI x, word_type c);
391debfc3dSmrg DI __ashrdi3 (DI x, word_type c);
401debfc3dSmrg int __clzsi2 (uSI x);
411debfc3dSmrg word_type __cmpdi2 (DI x, DI y);
421debfc3dSmrg int __ctzsi2 (uSI x);
431debfc3dSmrg DI __divdi3 (DI x, DI y);
441debfc3dSmrg uDI __lshrdi3 (uDI x, word_type c);
451debfc3dSmrg DI __moddi3 (DI x, DI y);
461debfc3dSmrg DI __muldi3 (DI x, DI y);
471debfc3dSmrg DI __negdi2 (DI x);
481debfc3dSmrg int __paritysi2 (uSI x);
491debfc3dSmrg int __popcountsi2 (uSI x);
501debfc3dSmrg word_type __ucmpdi2 (uDI x, uDI y);
511debfc3dSmrg uDI __udivdi3 (uDI x, uDI y);
521debfc3dSmrg uDI __udivmoddi4 (uDI x, uDI y, uDI *r);
531debfc3dSmrg uDI __umoddi3 (uDI x, uDI y);
541debfc3dSmrg 
__ashldi3(DI x,word_type c)551debfc3dSmrg DI __ashldi3 (DI x, word_type c) { return x << c; }
__ashrdi3(DI x,word_type c)561debfc3dSmrg DI __ashrdi3 (DI x, word_type c) { return x >> c; }
__clzsi2(uSI x)571debfc3dSmrg int __clzsi2 (uSI x) { return __builtin_clz (x); }
__cmpdi2(DI x,DI y)581debfc3dSmrg word_type __cmpdi2 (DI x, DI y) { return x < y ? 0 : x == y ? 1 : 2; }
__ctzsi2(uSI x)591debfc3dSmrg int __ctzsi2 (uSI x) { return __builtin_ctz (x); }
__divdi3(DI x,DI y)601debfc3dSmrg DI __divdi3 (DI x, DI y) { return x / y; }
__lshrdi3(uDI x,word_type c)611debfc3dSmrg uDI __lshrdi3 (uDI x, word_type c) { return x >> c; }
__moddi3(DI x,DI y)621debfc3dSmrg DI __moddi3 (DI x, DI y) { return x % y; }
__muldi3(DI x,DI y)631debfc3dSmrg DI __muldi3 (DI x, DI y) { return x * y; }
__negdi2(DI x)641debfc3dSmrg DI __negdi2 (DI x) { return -x; }
__paritysi2(uSI x)651debfc3dSmrg int __paritysi2 (uSI x) { return __builtin_parity (x); }
__popcountsi2(uSI x)661debfc3dSmrg int __popcountsi2 (uSI x) { return __builtin_popcount (x); }
__ucmpdi2(uDI x,uDI y)671debfc3dSmrg word_type __ucmpdi2 (uDI x, uDI y) { return x < y ? 0 : x == y ? 1 : 2; }
__udivdi3(uDI x,uDI y)681debfc3dSmrg uDI __udivdi3 (uDI x, uDI y) { return x / y; }
__udivmoddi4(uDI x,uDI y,uDI * r)691debfc3dSmrg uDI __udivmoddi4 (uDI x, uDI y, uDI *r) { *r = x % y; return x / y; }
__umoddi3(uDI x,uDI y)701debfc3dSmrg uDI __umoddi3 (uDI x, uDI y) { return x % y; }
711debfc3dSmrg 
721debfc3dSmrg #endif /* __ppc64__ || __x86_64__ */
73