2008-05-28 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / config / arm / bpabi.c
blob69f6e4eded98ca29f48c5993e0a782ae5c9da801
1 /* Miscellaneous BPABI functions.
3 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
4 Contributed by CodeSourcery, LLC.
6 This file is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
11 In addition to the permissions in the GNU General Public License, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of this file into combinations with other programs,
14 and to distribute those combinations without any restriction coming
15 from the use of this file. (The General Public License restrictions
16 do apply in other respects; for example, they cover modification of
17 the file, and distribution when not linked into a combine
18 executable.)
20 This file is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program; see the file COPYING. If not, write to
27 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
28 Boston, MA 02110-1301, USA. */
30 extern long long __divdi3 (long long, long long);
31 extern unsigned long long __udivdi3 (unsigned long long,
32 unsigned long long);
33 extern long long __gnu_ldivmod_helper (long long, long long, long long *);
34 extern unsigned long long __gnu_uldivmod_helper (unsigned long long,
35 unsigned long long,
36 unsigned long long *);
39 long long
40 __gnu_ldivmod_helper (long long a,
41 long long b,
42 long long *remainder)
44 long long quotient;
46 quotient = __divdi3 (a, b);
47 *remainder = a - b * quotient;
48 return quotient;
51 unsigned long long
52 __gnu_uldivmod_helper (unsigned long long a,
53 unsigned long long b,
54 unsigned long long *remainder)
56 unsigned long long quotient;
58 quotient = __udivdi3 (a, b);
59 *remainder = a - b * quotient;
60 return quotient;