lib1funcs.asm (udivsi3): Add support for divide functions.

2011-11-16  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* config/arm/lib1funcs.asm (udivsi3): Add support for divide
	functions.
	(aeabi_uidivmod): Likewise.	
	(umodsi3): Likewise.
	(divsi3): Likewise.
	(aeabi_idivmod): Likewise.
	(modsi3): Likewise.

From-SVN: r181419
This commit is contained in:
Matthew Gretton-Dann 2011-11-16 18:02:12 +00:00 committed by Richard Earnshaw
parent 0fe1f31b9e
commit 425d737b36
2 changed files with 76 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2011-11-16 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* config/arm/lib1funcs.asm (udivsi3): Add support for divide
functions.
(aeabi_uidivmod): Likewise.
(umodsi3): Likewise.
(divsi3): Likewise.
(aeabi_idivmod): Likewise.
(modsi3): Likewise.
2011-11-16 Tristan Gingold <gingold@adacore.com> 2011-11-16 Tristan Gingold <gingold@adacore.com>
* config/alpha/qrnnd.S: Use specific pseudos for VMS. * config/alpha/qrnnd.S: Use specific pseudos for VMS.

View File

@ -951,6 +951,17 @@ LSYM(udivsi3_skip_div0_test):
pop { work } pop { work }
RET RET
#elif defined(__ARM_ARCH_EXT_IDIV__)
ARM_FUNC_START udivsi3
ARM_FUNC_ALIAS aeabi_uidiv udivsi3
cmp r1, #0
beq LSYM(Ldiv0)
udiv r0, r0, r1
RET
#else /* ARM version/Thumb-2. */ #else /* ARM version/Thumb-2. */
ARM_FUNC_START udivsi3 ARM_FUNC_START udivsi3
@ -997,6 +1008,14 @@ FUNC_START aeabi_uidivmod
mul r2, r0 mul r2, r0
sub r1, r1, r2 sub r1, r1, r2
bx r3 bx r3
#elif defined(__ARM_ARCH_EXT_IDIV__)
ARM_FUNC_START aeabi_uidivmod
cmp r1, #0
beq LSYM(Ldiv0)
mov r2, r0
udiv r0, r0, r1
mls r1, r0, r1, r2
RET
#else #else
ARM_FUNC_START aeabi_uidivmod ARM_FUNC_START aeabi_uidivmod
cmp r1, #0 cmp r1, #0
@ -1014,9 +1033,19 @@ ARM_FUNC_START aeabi_uidivmod
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifdef L_umodsi3 #ifdef L_umodsi3
FUNC_START umodsi3 #ifdef __ARM_ARCH_EXT_IDIV__
#ifdef __thumb__ ARM_FUNC_START umodsi3
cmp r1, #0
beq LSYM(Ldiv0)
udiv r2, r0, r1
mls r0, r1, r2, r0
RET
#elif defined(__thumb__)
FUNC_START umodsi3
cmp divisor, #0 cmp divisor, #0
beq LSYM(Ldiv0) beq LSYM(Ldiv0)
@ -1035,6 +1064,8 @@ LSYM(Lover10):
#else /* ARM version. */ #else /* ARM version. */
FUNC_START umodsi3
subs r2, r1, #1 @ compare divisor with 1 subs r2, r1, #1 @ compare divisor with 1
bcc LSYM(Ldiv0) bcc LSYM(Ldiv0)
cmpne r0, r1 @ compare dividend with divisor cmpne r0, r1 @ compare dividend with divisor
@ -1091,6 +1122,16 @@ LSYM(Lover12):
pop { work } pop { work }
RET RET
#elif defined(__ARM_ARCH_EXT_IDIV__)
ARM_FUNC_START divsi3
ARM_FUNC_ALIAS aeabi_idiv divsi3
cmp r1, #0
beq LSYM(Ldiv0)
sdiv r0, r0, r1
RET
#else /* ARM/Thumb-2 version. */ #else /* ARM/Thumb-2 version. */
ARM_FUNC_START divsi3 ARM_FUNC_START divsi3
@ -1153,6 +1194,14 @@ FUNC_START aeabi_idivmod
mul r2, r0 mul r2, r0
sub r1, r1, r2 sub r1, r1, r2
bx r3 bx r3
#elif defined(__ARM_ARCH_EXT_IDIV__)
ARM_FUNC_START aeabi_idivmod
cmp r1, #0
beq LSYM(Ldiv0)
mov r2, r0
sdiv r0, r0, r1
mls r1, r0, r1, r2
RET
#else #else
ARM_FUNC_START aeabi_idivmod ARM_FUNC_START aeabi_idivmod
cmp r1, #0 cmp r1, #0
@ -1170,9 +1219,20 @@ ARM_FUNC_START aeabi_idivmod
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifdef L_modsi3 #ifdef L_modsi3
FUNC_START modsi3 #if defined(__ARM_ARCH_EXT_IDIV__)
#ifdef __thumb__ ARM_FUNC_START modsi3
cmp r1, #0
beq LSYM(Ldiv0)
sdiv r2, r0, r1
mls r0, r1, r2, r0
RET
#elif defined(__thumb__)
FUNC_START modsi3
mov curbit, #1 mov curbit, #1
cmp divisor, #0 cmp divisor, #0
@ -1204,6 +1264,8 @@ LSYM(Lover12):
#else /* ARM version. */ #else /* ARM version. */
FUNC_START modsi3
cmp r1, #0 cmp r1, #0
beq LSYM(Ldiv0) beq LSYM(Ldiv0)
rsbmi r1, r1, #0 @ loops below use unsigned. rsbmi r1, r1, #0 @ loops below use unsigned.