xref: /netbsd-src/external/gpl3/gcc/dist/libgcc/config/arm/bpabi.c (revision b1e838363e3c6fc78a55519254d99869742dd33c)
148fb7bfaSmrg /* Miscellaneous BPABI functions.
248fb7bfaSmrg 
3*b1e83836Smrg    Copyright (C) 2003-2022 Free Software Foundation, Inc.
448fb7bfaSmrg    Contributed by CodeSourcery, LLC.
548fb7bfaSmrg 
648fb7bfaSmrg    This file is free software; you can redistribute it and/or modify it
748fb7bfaSmrg    under the terms of the GNU General Public License as published by the
848fb7bfaSmrg    Free Software Foundation; either version 3, or (at your option) any
948fb7bfaSmrg    later version.
1048fb7bfaSmrg 
1148fb7bfaSmrg    This file is distributed in the hope that it will be useful, but
1248fb7bfaSmrg    WITHOUT ANY WARRANTY; without even the implied warranty of
1348fb7bfaSmrg    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1448fb7bfaSmrg    General Public License for more details.
1548fb7bfaSmrg 
1648fb7bfaSmrg    Under Section 7 of GPL version 3, you are granted additional
1748fb7bfaSmrg    permissions described in the GCC Runtime Library Exception, version
1848fb7bfaSmrg    3.1, as published by the Free Software Foundation.
1948fb7bfaSmrg 
2048fb7bfaSmrg    You should have received a copy of the GNU General Public License and
2148fb7bfaSmrg    a copy of the GCC Runtime Library Exception along with this program;
2248fb7bfaSmrg    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2348fb7bfaSmrg    <http://www.gnu.org/licenses/>.  */
2448fb7bfaSmrg 
2548fb7bfaSmrg extern long long __divdi3 (long long, long long);
2648fb7bfaSmrg extern unsigned long long __udivdi3 (unsigned long long,
2748fb7bfaSmrg 				     unsigned long long);
2848fb7bfaSmrg extern long long __gnu_ldivmod_helper (long long, long long, long long *);
2948fb7bfaSmrg 
3048fb7bfaSmrg 
3148fb7bfaSmrg long long
__gnu_ldivmod_helper(long long a,long long b,long long * remainder)3248fb7bfaSmrg __gnu_ldivmod_helper (long long a,
3348fb7bfaSmrg 		      long long b,
3448fb7bfaSmrg 		      long long *remainder)
3548fb7bfaSmrg {
3648fb7bfaSmrg   long long quotient;
3748fb7bfaSmrg 
3848fb7bfaSmrg   quotient = __divdi3 (a, b);
3948fb7bfaSmrg   *remainder = a - b * quotient;
4048fb7bfaSmrg   return quotient;
4148fb7bfaSmrg }
4248fb7bfaSmrg 
43