+2004-08-12 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/lib1funcs.asm (ARM_FUNC_ALIAS): Also alias _L__name.
+ (aeabi_uidivmod, aeabi_idivmod): Provide thumb implementation.
+
2004-08-12 David Daney <ddaney@avtrex.com>
- * java/gcj.texi: Add subsection on signal usage.
+ * java/gcj.texi: Add subsection on signal usage.
2004-08-12 David Edelsohn <edelsohn@gnu.org>
bx pc
nop
.arm
-_L__\name: /* A hook to tell gdb that we've switched to ARM */
+/* A hook to tell gdb that we've switched to ARM mode. Also used to call
+ directly from other local arm routines. */
+_L__\name:
.endm
#define EQUIV .thumb_set
+/* Branch directly to a function declared with ARM_FUNC_START.
+ Must be called in arm mode. */
.macro ARM_CALL name
bl _L__\name
.endm
.macro ARM_FUNC_ALIAS new old
.globl SYM (__\new)
EQUIV SYM (__\new), SYM (__\old)
+#ifdef __thumb__
+ .set SYM (_L__\new), SYM (_L__\old)
+#endif
.endm
#ifdef __thumb__
DIV_FUNC_END udivsi3
-ARM_FUNC_START aeabi_uidivmod
+FUNC_START aeabi_uidivmod
+#ifdef __thumb__
+ push {r0, r1, lr}
+ bl SYM(__udivsi3)
+ POP {r1, r2, r3}
+ mul r2, r0
+ sub r1, r1, r2
+ bx r3
+#else
stmfd sp!, { r0, r1, lr }
- ARM_CALL udivsi3
+ bl SYM(__udivsi3)
ldmfd sp!, { r1, r2, lr }
mul r3, r2, r0
sub r1, r1, r3
RET
+#endif
FUNC_END aeabi_uidivmod
#endif /* L_udivsi3 */
DIV_FUNC_END divsi3
-ARM_FUNC_START aeabi_idivmod
+FUNC_START aeabi_idivmod
+#ifdef __thumb__
+ push {r0, r1, lr}
+ bl SYM(__divsi3)
+ POP {r1, r2, r3}
+ mul r2, r0
+ sub r1, r1, r2
+ bx r3
+#else
stmfd sp!, { r0, r1, lr }
- ARM_CALL divsi3
+ bl SYM(__divsi3)
ldmfd sp!, { r1, r2, lr }
mul r3, r2, r0
sub r1, r1, r3
RET
+#endif
FUNC_END aeabi_idivmod
#endif /* L_divsi3 */