URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgcc/] [config/] [arm/] [bpabi.S] - Rev 734
Compare with Previous | Blame | View Log
/* Miscellaneous BPABI functions.Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010Free Software Foundation, Inc.Contributed by CodeSourcery, LLC.This file is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License as published by theFree Software Foundation; either version 3, or (at your option) anylater version.This file is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.Under Section 7 of GPL version 3, you are granted additionalpermissions described in the GCC Runtime Library Exception, version3.1, as published by the Free Software Foundation.You should have received a copy of the GNU General Public License anda copy of the GCC Runtime Library Exception along with this program;see the files COPYING3 and COPYING.RUNTIME respectively. If not, see<http://www.gnu.org/licenses/>. */#ifdef __ARM_EABI__/* Some attributes that are common to all routines in this file. *//* Tag_ABI_align_needed: This code does not require 8-bytealignment from the caller. *//* .eabi_attribute 24, 0 -- default setting. *//* Tag_ABI_align_preserved: This code preserves 8-bytealignment in any callee. */.eabi_attribute 25, 1#endif /* __ARM_EABI__ */#ifdef L_aeabi_lcmpARM_FUNC_START aeabi_lcmpcmp xxh, yyhdo_it ltmovlt r0, #-1do_it gtmovgt r0, #1do_it neRETc(ne)subs r0, xxl, yyldo_it lomovlo r0, #-1do_it himovhi r0, #1RETFUNC_END aeabi_lcmp#endif /* L_aeabi_lcmp */#ifdef L_aeabi_ulcmpARM_FUNC_START aeabi_ulcmpcmp xxh, yyhdo_it lomovlo r0, #-1do_it himovhi r0, #1do_it neRETc(ne)cmp xxl, yyldo_it lomovlo r0, #-1do_it himovhi r0, #1do_it eqmoveq r0, #0RETFUNC_END aeabi_ulcmp#endif /* L_aeabi_ulcmp */.macro test_div_by_zero signed/* Tail-call to divide-by-zero handlers which may be overridden by the user,so unwinding works properly. */#if defined(__thumb2__)cbnz yyh, 1fcbnz yyl, 1fcmp xxh, #0do_it eqcmpeq xxl, #0.ifc \signed, unsignedbeq 2fmov xxh, #0xffffffffmov xxl, xxh2:.elsedo_it lt, tmovlt xxl, #0movlt xxh, #0x80000000do_it gt, tmovgt xxh, #0x7fffffffmovgt xxl, #0xffffffff.endifb SYM (__aeabi_ldiv0) __PLT__1:#else/* Note: Thumb-1 code calls via an ARM shim on processors whichsupport ARM mode. */cmp yyh, #0cmpeq yyl, #0bne 2fcmp xxh, #0cmpeq xxl, #0.ifc \signed, unsignedmovne xxh, #0xffffffffmovne xxl, #0xffffffff.elsemovlt xxh, #0x80000000movlt xxl, #0movgt xxh, #0x7fffffffmovgt xxl, #0xffffffff.endifb SYM (__aeabi_ldiv0) __PLT__2:#endif.endm#ifdef L_aeabi_ldivmodARM_FUNC_START aeabi_ldivmodtest_div_by_zero signedsub sp, sp, #8#if defined(__thumb2__)mov ip, sppush {ip, lr}#elsedo_push {sp, lr}#endifbl SYM(__gnu_ldivmod_helper) __PLT__ldr lr, [sp, #4]add sp, sp, #8do_pop {r2, r3}RET#endif /* L_aeabi_ldivmod */#ifdef L_aeabi_uldivmodARM_FUNC_START aeabi_uldivmodtest_div_by_zero unsignedsub sp, sp, #8#if defined(__thumb2__)mov ip, sppush {ip, lr}#elsedo_push {sp, lr}#endifbl SYM(__gnu_uldivmod_helper) __PLT__ldr lr, [sp, #4]add sp, sp, #8do_pop {r2, r3}RET#endif /* L_aeabi_divmod */
