]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/gcc/config/arm/bpabi.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / gcc / config / arm / bpabi.S
1 /* Miscellaneous BPABI functions.
2
3    Copyright (C) 2003, 2004  Free Software Foundation, Inc.
4    Contributed by CodeSourcery, LLC.
5
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.
10
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.)
19
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.
24
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.  */
29
30 #ifdef __ARMEB__
31 #define xxh r0
32 #define xxl r1
33 #define yyh r2
34 #define yyl r3
35 #else
36 #define xxh r1
37 #define xxl r0
38 #define yyh r3
39 #define yyl r2
40 #endif  
41         
42 #ifdef L_aeabi_lcmp
43
44 ARM_FUNC_START aeabi_lcmp
45         subs    ip, xxl, yyl
46         sbcs    ip, xxh, yyh
47         subeqs  ip, xxl, yyl
48         mov     r0, ip
49         RET
50         FUNC_END aeabi_lcmp
51
52 #endif /* L_aeabi_lcmp */
53         
54 #ifdef L_aeabi_ulcmp
55
56 ARM_FUNC_START aeabi_ulcmp
57         cmp     xxh, yyh
58         movlo   r0, #-1
59         movhi   r0, #1
60         RETc(ne)
61         cmp     xxl, yyl
62         movlo   r0, #-1
63         movhi   r0, #1
64         moveq   r0, #0
65         RET
66         FUNC_END aeabi_ulcmp
67
68 #endif /* L_aeabi_ulcmp */
69
70 #ifdef L_aeabi_ldivmod
71
72 ARM_FUNC_START aeabi_ldivmod
73         sub sp, sp, #8
74         stmfd sp!, {sp, lr}
75         bl SYM(__gnu_ldivmod_helper) __PLT__
76         ldr lr, [sp, #4]
77         add sp, sp, #8
78         ldmfd sp!, {r2, r3}
79         RET
80         
81 #endif /* L_aeabi_ldivmod */
82
83 #ifdef L_aeabi_uldivmod
84
85 ARM_FUNC_START aeabi_uldivmod
86         sub sp, sp, #8
87         stmfd sp!, {sp, lr}
88         bl SYM(__gnu_uldivmod_helper) __PLT__
89         ldr lr, [sp, #4]
90         add sp, sp, #8
91         ldmfd sp!, {r2, r3}
92         RET
93         
94 #endif /* L_aeabi_divmod */
95