xref: /freebsd/lib/libc/arm/aeabi/aeabi_int_div.S (revision 1d386b48a555f61cb7325543adbbb5c3f3407a66)
1*cd9bdb73SMichal Meloun/*
2*cd9bdb73SMichal Meloun * Copyright (C) 2017 Michal Meloun
3*cd9bdb73SMichal Meloun * All rights reserved.
4*cd9bdb73SMichal Meloun *
5*cd9bdb73SMichal Meloun * Redistribution and use in source and binary forms, with or without
6*cd9bdb73SMichal Meloun * modification, are permitted provided that the following conditions
7*cd9bdb73SMichal Meloun * are met:
8*cd9bdb73SMichal Meloun * 1. Redistributions of source code must retain the above copyright
9*cd9bdb73SMichal Meloun *    notice, this list of conditions and the following disclaimer.
10*cd9bdb73SMichal Meloun * 2. Redistributions in binary form must reproduce the above copyright
11*cd9bdb73SMichal Meloun *    notice, this list of conditions and the following disclaimer in the
12*cd9bdb73SMichal Meloun *    documentation and/or other materials provided with the distribution.
13*cd9bdb73SMichal Meloun *
14*cd9bdb73SMichal Meloun * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*cd9bdb73SMichal Meloun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*cd9bdb73SMichal Meloun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*cd9bdb73SMichal Meloun * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*cd9bdb73SMichal Meloun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*cd9bdb73SMichal Meloun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*cd9bdb73SMichal Meloun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*cd9bdb73SMichal Meloun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*cd9bdb73SMichal Meloun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*cd9bdb73SMichal Meloun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*cd9bdb73SMichal Meloun * SUCH DAMAGE.
25*cd9bdb73SMichal Meloun *
26*cd9bdb73SMichal Meloun */
27*cd9bdb73SMichal Meloun
28*cd9bdb73SMichal Meloun#include <machine/asm.h>
29*cd9bdb73SMichal Meloun/*
30*cd9bdb73SMichal Meloun * Due to bug in libcompiler_rt, all symbols declared by
31*cd9bdb73SMichal Meloun * DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but
32*cd9bdb73SMichal Meloun * __aeabi_uidiv_compat and/or __aeabi_idiv_compat  are explicitly
33*cd9bdb73SMichal Meloun * exported from libc and don't causes problems.
34*cd9bdb73SMichal Meloun *
35*cd9bdb73SMichal Meloun * As workaround, export these from libc as compatible symbols,
36*cd9bdb73SMichal Meloun * in global namespace
37*cd9bdb73SMichal Meloun */
38*cd9bdb73SMichal Meloun
39*cd9bdb73SMichal MelounENTRY(__aeabi_uidiv_compat)
40*cd9bdb73SMichal Meloun	.symver __aeabi_uidiv_compat, __aeabi_uidiv@
41*cd9bdb73SMichal Meloun	b __udivsi3
42*cd9bdb73SMichal MelounEND(__aeabi_uidiv_compat)
43*cd9bdb73SMichal Meloun
44*cd9bdb73SMichal MelounENTRY(__aeabi_idiv_compat)
45*cd9bdb73SMichal Meloun	.symver __aeabi_idiv_compat, __aeabi_idiv@
46*cd9bdb73SMichal Meloun	b __divsi3
47*cd9bdb73SMichal MelounEND(__aeabi_idiv_compat)
48*cd9bdb73SMichal Meloun
49*cd9bdb73SMichal Meloun	.section .note.GNU-stack,"",%progbits
50