Merged revisions 143552,143554,143557,143560,143562,143564-143567,143570-143573,14357...
[official-gcc.git] / gcc / config / arm / bpabi.S
blob2900219d2f604c3a4bad256eafc47a076efa9819
1 /* Miscellaneous BPABI functions.
3    Copyright (C) 2003, 2004, 2007, 2008  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 #ifdef L_aeabi_lcmp
32 ARM_FUNC_START aeabi_lcmp
33         cmp     xxh, yyh
34         do_it   lt
35         movlt   r0, #-1
36         do_it   gt
37         movgt   r0, #1
38         do_it   ne
39         RETc(ne)
40         subs    r0, xxl, yyl
41         do_it   lo
42         movlo   r0, #-1
43         do_it   hi
44         movhi   r0, #1
45         RET
46         FUNC_END aeabi_lcmp
48 #endif /* L_aeabi_lcmp */
49         
50 #ifdef L_aeabi_ulcmp
52 ARM_FUNC_START aeabi_ulcmp
53         cmp     xxh, yyh
54         do_it   lo
55         movlo   r0, #-1
56         do_it   hi
57         movhi   r0, #1
58         do_it   ne
59         RETc(ne)
60         cmp     xxl, yyl
61         do_it   lo
62         movlo   r0, #-1
63         do_it   hi
64         movhi   r0, #1
65         do_it   eq
66         moveq   r0, #0
67         RET
68         FUNC_END aeabi_ulcmp
70 #endif /* L_aeabi_ulcmp */
72 #ifdef L_aeabi_ldivmod
74 ARM_FUNC_START aeabi_ldivmod
75         sub sp, sp, #8
76 #if defined(__thumb2__)
77         mov ip, sp
78         push {ip, lr}
79 #else
80         do_push {sp, lr}
81 #endif
82         bl SYM(__gnu_ldivmod_helper) __PLT__
83         ldr lr, [sp, #4]
84         add sp, sp, #8
85         do_pop {r2, r3}
86         RET
87         
88 #endif /* L_aeabi_ldivmod */
90 #ifdef L_aeabi_uldivmod
92 ARM_FUNC_START aeabi_uldivmod
93         sub sp, sp, #8
94 #if defined(__thumb2__)
95         mov ip, sp
96         push {ip, lr}
97 #else
98         do_push {sp, lr}
99 #endif
100         bl SYM(__gnu_uldivmod_helper) __PLT__
101         ldr lr, [sp, #4]
102         add sp, sp, #8
103         do_pop {r2, r3}
104         RET
105         
106 #endif /* L_aeabi_divmod */
107