xref: /netbsd-src/external/gpl3/gcc.old/dist/libgcc/config/arm/bpabi.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg /* Miscellaneous BPABI functions.
21debfc3dSmrg 
3*8feb0f0bSmrg    Copyright (C) 2003-2020 Free Software Foundation, Inc.
41debfc3dSmrg    Contributed by CodeSourcery, LLC.
51debfc3dSmrg 
61debfc3dSmrg    This file is free software; you can redistribute it and/or modify it
71debfc3dSmrg    under the terms of the GNU General Public License as published by the
81debfc3dSmrg    Free Software Foundation; either version 3, or (at your option) any
91debfc3dSmrg    later version.
101debfc3dSmrg 
111debfc3dSmrg    This file is distributed in the hope that it will be useful, but
121debfc3dSmrg    WITHOUT ANY WARRANTY; without even the implied warranty of
131debfc3dSmrg    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
141debfc3dSmrg    General Public License for more details.
151debfc3dSmrg 
161debfc3dSmrg    Under Section 7 of GPL version 3, you are granted additional
171debfc3dSmrg    permissions described in the GCC Runtime Library Exception, version
181debfc3dSmrg    3.1, as published by the Free Software Foundation.
191debfc3dSmrg 
201debfc3dSmrg    You should have received a copy of the GNU General Public License and
211debfc3dSmrg    a copy of the GCC Runtime Library Exception along with this program;
221debfc3dSmrg    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
231debfc3dSmrg    <http://www.gnu.org/licenses/>.  */
241debfc3dSmrg 
251debfc3dSmrg extern long long __divdi3 (long long, long long);
261debfc3dSmrg extern unsigned long long __udivdi3 (unsigned long long,
271debfc3dSmrg 				     unsigned long long);
281debfc3dSmrg extern long long __gnu_ldivmod_helper (long long, long long, long long *);
291debfc3dSmrg 
301debfc3dSmrg 
311debfc3dSmrg long long
__gnu_ldivmod_helper(long long a,long long b,long long * remainder)321debfc3dSmrg __gnu_ldivmod_helper (long long a,
331debfc3dSmrg 		      long long b,
341debfc3dSmrg 		      long long *remainder)
351debfc3dSmrg {
361debfc3dSmrg   long long quotient;
371debfc3dSmrg 
381debfc3dSmrg   quotient = __divdi3 (a, b);
391debfc3dSmrg   *remainder = a - b * quotient;
401debfc3dSmrg   return quotient;
411debfc3dSmrg }
421debfc3dSmrg 
43