1169689Skan/* Miscellaneous BPABI functions.
2169689Skan
3169689Skan   Copyright (C) 2003, 2004  Free Software Foundation, Inc.
4169689Skan   Contributed by CodeSourcery, LLC.
5169689Skan
6169689Skan   This file is free software; you can redistribute it and/or modify it
7169689Skan   under the terms of the GNU General Public License as published by the
8169689Skan   Free Software Foundation; either version 2, or (at your option) any
9169689Skan   later version.
10169689Skan
11169689Skan   In addition to the permissions in the GNU General Public License, the
12169689Skan   Free Software Foundation gives you unlimited permission to link the
13169689Skan   compiled version of this file into combinations with other programs,
14169689Skan   and to distribute those combinations without any restriction coming
15169689Skan   from the use of this file.  (The General Public License restrictions
16169689Skan   do apply in other respects; for example, they cover modification of
17169689Skan   the file, and distribution when not linked into a combine
18169689Skan   executable.)
19169689Skan
20169689Skan   This file is distributed in the hope that it will be useful, but
21169689Skan   WITHOUT ANY WARRANTY; without even the implied warranty of
22169689Skan   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23169689Skan   General Public License for more details.
24169689Skan
25169689Skan   You should have received a copy of the GNU General Public License
26169689Skan   along with this program; see the file COPYING.  If not, write to
27169689Skan   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
28169689Skan   Boston, MA 02110-1301, USA.  */
29169689Skan
30169689Skan#ifdef __ARMEB__
31169689Skan#define xxh r0
32169689Skan#define xxl r1
33169689Skan#define yyh r2
34169689Skan#define yyl r3
35169689Skan#else
36169689Skan#define xxh r1
37169689Skan#define xxl r0
38169689Skan#define yyh r3
39169689Skan#define yyl r2
40169689Skan#endif
41169689Skan
42169689Skan#ifdef L_aeabi_lcmp
43169689Skan
44169689SkanARM_FUNC_START aeabi_lcmp
45169689Skan	subs	ip, xxl, yyl
46169689Skan	sbcs	ip, xxh, yyh
47169689Skan	subeqs  ip, xxl, yyl
48169689Skan	mov	r0, ip
49169689Skan	RET
50169689Skan	FUNC_END aeabi_lcmp
51169689Skan
52169689Skan#endif /* L_aeabi_lcmp */
53169689Skan
54169689Skan#ifdef L_aeabi_ulcmp
55169689Skan
56169689SkanARM_FUNC_START aeabi_ulcmp
57169689Skan	cmp	xxh, yyh
58169689Skan	movlo	r0, #-1
59169689Skan	movhi	r0, #1
60169689Skan	RETc(ne)
61169689Skan	cmp	xxl, yyl
62169689Skan	movlo	r0, #-1
63169689Skan	movhi	r0, #1
64169689Skan	moveq	r0, #0
65169689Skan	RET
66169689Skan	FUNC_END aeabi_ulcmp
67169689Skan
68169689Skan#endif /* L_aeabi_ulcmp */
69169689Skan
70169689Skan#ifdef L_aeabi_ldivmod
71169689Skan
72169689SkanARM_FUNC_START aeabi_ldivmod
73169689Skan	sub sp, sp, #8
74169689Skan	stmfd sp!, {sp, lr}
75169689Skan	bl SYM(__gnu_ldivmod_helper) __PLT__
76169689Skan	ldr lr, [sp, #4]
77169689Skan	add sp, sp, #8
78169689Skan	ldmfd sp!, {r2, r3}
79169689Skan	RET
80169689Skan
81169689Skan#endif /* L_aeabi_ldivmod */
82169689Skan
83169689Skan#ifdef L_aeabi_uldivmod
84169689Skan
85169689SkanARM_FUNC_START aeabi_uldivmod
86169689Skan	sub sp, sp, #8
87169689Skan	stmfd sp!, {sp, lr}
88169689Skan	bl SYM(__gnu_uldivmod_helper) __PLT__
89169689Skan	ldr lr, [sp, #4]
90169689Skan	add sp, sp, #8
91169689Skan	ldmfd sp!, {r2, r3}
92169689Skan	RET
93169689Skan
94169689Skan#endif /* L_aeabi_divmod */
95169689Skan
96