Commit 6db757ba by Doug Evans

lib1funcs.asm (__USER_LABEL_PREFIX__): Define if not already.

	* arm/lib1funcs.asm (__USER_LABEL_PREFIX__): Define if not already.
	(CONCAT1,CONCAT2,SYM): Define.
	(__udivsi3,__divsi3,__umodsi3,__modsi3,__div0): Use SYM to define
	global labels.

From-SVN: r10939
parent 18a686c0
...@@ -275,6 +275,19 @@ Ldiv_zero: ...@@ -275,6 +275,19 @@ Ldiv_zero:
#define RETCOND #define RETCOND
#endif #endif
#ifndef __USER_LABEL_PREFIX__
#define __USER_LABEL_PREFIX__ _
#endif
/* ANSI concatenation macros. */
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
/* Use the right prefix for global labels. */
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
#ifdef L_udivsi3 #ifdef L_udivsi3
ip .req r12 ip .req r12
...@@ -282,9 +295,9 @@ sp .req r13 ...@@ -282,9 +295,9 @@ sp .req r13
lr .req r14 lr .req r14
pc .req r15 pc .req r15
.text .text
.globl ___udivsi3 .globl SYM (__udivsi3)
.align 0 .align 0
___udivsi3: SYM (__udivsi3):
stmdb sp!, {r4, r5, lr} stmdb sp!, {r4, r5, lr}
@ Ready to divide. Compute size of quotient; scale comparand. @ Ready to divide. Compute size of quotient; scale comparand.
movs lr, r1 movs lr, r1
...@@ -596,7 +609,7 @@ Lgot_result: ...@@ -596,7 +609,7 @@ Lgot_result:
Ldiv_zero: Ldiv_zero:
@ Divide by zero trap. If it returns, return 0 (about as @ Divide by zero trap. If it returns, return 0 (about as
@ wrong as possible, but that is what SunOS does...). @ wrong as possible, but that is what SunOS does...).
bl ___div0 bl SYM (__div0)
mov r0, #0 mov r0, #0
ldmia sp!, {r4, r5, pc}RETCOND ldmia sp!, {r4, r5, pc}RETCOND
...@@ -609,9 +622,9 @@ sp .req r13 ...@@ -609,9 +622,9 @@ sp .req r13
lr .req r14 lr .req r14
pc .req r15 pc .req r15
.text .text
.globl ___divsi3 .globl SYM (__divsi3)
.align 0 .align 0
___divsi3: SYM (__divsi3):
stmdb sp!, {r4, r5, r6, lr} stmdb sp!, {r4, r5, r6, lr}
@ compute sign of result; if neither is negative, no problem @ compute sign of result; if neither is negative, no problem
eor r6, r1, r0 @ compute sign eor r6, r1, r0 @ compute sign
...@@ -930,7 +943,7 @@ Lgot_result: ...@@ -930,7 +943,7 @@ Lgot_result:
Ldiv_zero: Ldiv_zero:
@ Divide by zero trap. If it returns, return 0 (about as @ Divide by zero trap. If it returns, return 0 (about as
@ wrong as possible, but that is what SunOS does...). @ wrong as possible, but that is what SunOS does...).
bl ___div0 bl SYM (__div0)
mov r0, #0 mov r0, #0
ldmia sp!, {r4, r5, r6, pc}RETCOND ldmia sp!, {r4, r5, r6, pc}RETCOND
...@@ -943,9 +956,9 @@ sp .req r13 ...@@ -943,9 +956,9 @@ sp .req r13
lr .req r14 lr .req r14
pc .req r15 pc .req r15
.text .text
.globl ___umodsi3 .globl SYM (__umodsi3)
.align 0 .align 0
___umodsi3: SYM (__umodsi3):
stmdb sp!, {r4, r5, lr} stmdb sp!, {r4, r5, lr}
@ Ready to divide. Compute size of quotient; scale comparand. @ Ready to divide. Compute size of quotient; scale comparand.
movs lr, r1 movs lr, r1
...@@ -1257,7 +1270,7 @@ Lgot_result: ...@@ -1257,7 +1270,7 @@ Lgot_result:
Ldiv_zero: Ldiv_zero:
@ Divide by zero trap. If it returns, return 0 (about as @ Divide by zero trap. If it returns, return 0 (about as
@ wrong as possible, but that is what SunOS does...). @ wrong as possible, but that is what SunOS does...).
bl ___div0 bl SYM (__div0)
mov r0, #0 mov r0, #0
ldmia sp!, {r4, r5, pc}RETCOND ldmia sp!, {r4, r5, pc}RETCOND
...@@ -1270,9 +1283,9 @@ sp .req r13 ...@@ -1270,9 +1283,9 @@ sp .req r13
lr .req r14 lr .req r14
pc .req r15 pc .req r15
.text .text
.globl ___modsi3 .globl SYM (__modsi3)
.align 0 .align 0
___modsi3: SYM (__modsi3):
stmdb sp!, {r4, r5, r6, lr} stmdb sp!, {r4, r5, r6, lr}
@ compute sign of result; if neither is negative, no problem @ compute sign of result; if neither is negative, no problem
mov r6, r0 mov r6, r0
...@@ -1591,7 +1604,7 @@ Lgot_result: ...@@ -1591,7 +1604,7 @@ Lgot_result:
Ldiv_zero: Ldiv_zero:
@ Divide by zero trap. If it returns, return 0 (about as @ Divide by zero trap. If it returns, return 0 (about as
@ wrong as possible, but that is what SunOS does...). @ wrong as possible, but that is what SunOS does...).
bl ___div0 bl SYM (__div0)
mov r0, #0 mov r0, #0
ldmia sp!, {r4, r5, r6, pc}RETCOND ldmia sp!, {r4, r5, r6, pc}RETCOND
...@@ -1599,9 +1612,9 @@ Ldiv_zero: ...@@ -1599,9 +1612,9 @@ Ldiv_zero:
#ifdef L_dvmd_tls #ifdef L_dvmd_tls
.globl ___div0 .globl SYM (__div0)
.align 0 .align 0
___div0: SYM (__div0):
RET pc, lr RET pc, lr
#endif /* L_divmodsi_tools */ #endif /* L_divmodsi_tools */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment