1 /* Miscellaneous BPABI functions.
3 Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
5 Contributed by CodeSourcery, LLC.
7 This file is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3, or (at your option) any
12 This file is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
27 /* Some attributes that are common to all routines in this file. */
28 /* Tag_ABI_align_needed: This code does not require 8-byte
29 alignment from the caller. */
30 /* .eabi_attribute 24, 0 -- default setting. */
31 /* Tag_ABI_align_preserved: This code preserves 8-byte
32 alignment in any callee. */
34 #endif /* __ARM_EABI__ */
38 ARM_FUNC_START aeabi_lcmp
54 #endif /* L_aeabi_lcmp */
58 ARM_FUNC_START aeabi_ulcmp
76 #endif /* L_aeabi_ulcmp */
78 .macro test_div_by_zero signed
79 /* Tail-call to divide-by-zero handlers which may be overridden by the user,
80 so unwinding works properly. */
81 #if defined(__thumb2__)
87 .ifc \signed, unsigned
95 movlt xxh, #0x80000000
97 movgt xxh, #0x7fffffff
98 movgt xxl, #0xffffffff
100 b SYM (__aeabi_ldiv0) __PLT__
103 /* Note: Thumb-1 code calls via an ARM shim on processors which
110 .ifc \signed, unsigned
111 movne xxh, #0xffffffff
112 movne xxl, #0xffffffff
114 movlt xxh, #0x80000000
116 movgt xxh, #0x7fffffff
117 movgt xxl, #0xffffffff
119 b SYM (__aeabi_ldiv0) __PLT__
124 #ifdef L_aeabi_ldivmod
126 ARM_FUNC_START aeabi_ldivmod
127 test_div_by_zero signed
130 #if defined(__thumb2__)
136 bl SYM(__gnu_ldivmod_helper) __PLT__
142 #endif /* L_aeabi_ldivmod */
144 #ifdef L_aeabi_uldivmod
146 ARM_FUNC_START aeabi_uldivmod
147 test_div_by_zero unsigned
150 #if defined(__thumb2__)
156 bl SYM(__gnu_uldivmod_helper) __PLT__
162 #endif /* L_aeabi_divmod */