URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [config/] [arm/] [bpabi-v6m.S] - Rev 282
Compare with Previous | Blame | View Log
/* Miscellaneous BPABI functions. ARMv6M implementationCopyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.Contributed by CodeSourcery.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 L_aeabi_lcmpFUNC_START aeabi_lcmpcmp xxh, yyhbeq 1fbgt 2fmov r0, #1neg r0, r0RET2:mov r0, #1RET1:sub r0, xxl, yylbeq 1fbhi 2fmov r0, #1neg r0, r0RET2:mov r0, #11:RETFUNC_END aeabi_lcmp#endif /* L_aeabi_lcmp */#ifdef L_aeabi_ulcmpFUNC_START aeabi_ulcmpcmp xxh, yyhbne 1fsub r0, xxl, yylbeq 2f1:bcs 1fmov r0, #1neg r0, r0RET1:mov r0, #12:RETFUNC_END aeabi_ulcmp#endif /* L_aeabi_ulcmp */.macro test_div_by_zero signedcmp yyh, #0bne 7fcmp yyl, #0bne 7fcmp xxh, #0bne 2fcmp xxl, #02:.ifc \signed, unsignedbeq 3fmov xxh, #0mvn xxh, xxh @ 0xffffffffmov xxl, xxh3:.elsebeq 5fblt 6fmov xxl, #0mvn xxl, xxl @ 0xfffffffflsr xxh, xxl, #1 @ 0x7fffffffb 5f6: mov xxh, #0x80lsl xxh, xxh, #24 @ 0x80000000mov xxl, #05:.endif@ tailcalls are tricky on v6-m.push {r0, r1, r2}ldr r0, 1fadr r1, 1fadd r0, r1str r0, [sp, #8]@ We know we are not on armv4t, so pop pc is safe.pop {r0, r1, pc}.align 21:.word __aeabi_ldiv0 - 1b7:.endm#ifdef L_aeabi_ldivmodFUNC_START aeabi_ldivmodtest_div_by_zero signedpush {r0, r1}mov r0, sppush {r0, lr}ldr r0, [sp, #8]bl SYM(__gnu_ldivmod_helper)ldr r3, [sp, #4]mov lr, r3add sp, sp, #8pop {r2, r3}RETFUNC_END aeabi_ldivmod#endif /* L_aeabi_ldivmod */#ifdef L_aeabi_uldivmodFUNC_START aeabi_uldivmodtest_div_by_zero unsignedpush {r0, r1}mov r0, sppush {r0, lr}ldr r0, [sp, #8]bl SYM(__gnu_uldivmod_helper)ldr r3, [sp, #4]mov lr, r3add sp, sp, #8pop {r2, r3}RETFUNC_END aeabi_uldivmod#endif /* L_aeabi_uldivmod */#ifdef L_arm_addsubsf3FUNC_START aeabi_frsubpush {r4, lr}mov r4, #1lsl r4, #31eor r0, r0, r4bl __aeabi_faddpop {r4, pc}FUNC_END aeabi_frsub#endif /* L_arm_addsubsf3 */#ifdef L_arm_cmpsf2FUNC_START aeabi_cfrcmplemov ip, r0mov r0, r1mov r1, ipb 6fFUNC_START aeabi_cfcmpeqFUNC_ALIAS aeabi_cfcmple aeabi_cfcmpeq@ The status-returning routines are required to preserve all@ registers except ip, lr, and cpsr.6: push {r0, r1, r2, r3, r4, lr}bl __lesf2@ Set the Z flag correctly, and the C flag unconditionally.cmp r0, #0@ Clear the C flag if the return value was -1, indicating@ that the first operand was smaller than the second.bmi 1fmov r1, #0cmn r0, r11:pop {r0, r1, r2, r3, r4, pc}FUNC_END aeabi_cfcmpleFUNC_END aeabi_cfcmpeqFUNC_END aeabi_cfrcmpleFUNC_START aeabi_fcmpeqpush {r4, lr}bl __eqsf2neg r0, r0add r0, r0, #1pop {r4, pc}FUNC_END aeabi_fcmpeq.macro COMPARISON cond, helper, mode=sf2FUNC_START aeabi_fcmp\condpush {r4, lr}bl __\helper\modecmp r0, #0b\cond 1fmov r0, #0pop {r4, pc}1:mov r0, #1pop {r4, pc}FUNC_END aeabi_fcmp\cond.endmCOMPARISON lt, leCOMPARISON le, leCOMPARISON gt, geCOMPARISON ge, ge#endif /* L_arm_cmpsf2 */#ifdef L_arm_addsubdf3FUNC_START aeabi_drsubpush {r4, lr}mov r4, #1lsl r4, #31eor xxh, xxh, r4bl __aeabi_daddpop {r4, pc}FUNC_END aeabi_drsub#endif /* L_arm_addsubdf3 */#ifdef L_arm_cmpdf2FUNC_START aeabi_cdrcmplemov ip, r0mov r0, r2mov r2, ipmov ip, r1mov r1, r3mov r3, ipb 6fFUNC_START aeabi_cdcmpeqFUNC_ALIAS aeabi_cdcmple aeabi_cdcmpeq@ The status-returning routines are required to preserve all@ registers except ip, lr, and cpsr.6: push {r0, r1, r2, r3, r4, lr}bl __ledf2@ Set the Z flag correctly, and the C flag unconditionally.cmp r0, #0@ Clear the C flag if the return value was -1, indicating@ that the first operand was smaller than the second.bmi 1fmov r1, #0cmn r0, r11:pop {r0, r1, r2, r3, r4, pc}FUNC_END aeabi_cdcmpleFUNC_END aeabi_cdcmpeqFUNC_END aeabi_cdrcmpleFUNC_START aeabi_dcmpeqpush {r4, lr}bl __eqdf2neg r0, r0add r0, r0, #1pop {r4, pc}FUNC_END aeabi_dcmpeq.macro COMPARISON cond, helper, mode=df2FUNC_START aeabi_dcmp\condpush {r4, lr}bl __\helper\modecmp r0, #0b\cond 1fmov r0, #0pop {r4, pc}1:mov r0, #1pop {r4, pc}FUNC_END aeabi_dcmp\cond.endmCOMPARISON lt, leCOMPARISON le, leCOMPARISON gt, geCOMPARISON ge, ge#endif /* L_arm_cmpdf2 */
