Commit 8168ccc0 by Sebastian Huber Committed by Richard Earnshaw

lib1funcs.asm (__prefer_thumb__): New define.

2010-02-18  Sebastian Huber <sebastian.huber@embedded-brains.de>

	* config/arm/lib1funcs.asm (__prefer_thumb__): New define.
	(udivsi3, aeabi_uidivmod, divsi3, aeabi_idivmod): Use Thumb-1 variant
	if __prefer_thumb__ is defined.

From-SVN: r156868
parent 2f95713b
2010-02-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config/arm/lib1funcs.asm (__prefer_thumb__): New define.
(udivsi3, aeabi_uidivmod, divsi3, aeabi_idivmod): Use Thumb-1 variant
if __prefer_thumb__ is defined.
2010-02-18 Martin Jambor <mjambor@suse.cz> 2010-02-18 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/43066 PR tree-optimization/43066
......
...@@ -112,6 +112,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -112,6 +112,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#error Unable to determine architecture. #error Unable to determine architecture.
#endif #endif
/* There are times when we might prefer Thumb1 code even if ARM code is
permitted, for example, the code might be smaller, or there might be
interworking problems with switching to ARM state if interworking is
disabled. */
#if (defined(__thumb__) \
&& !defined(__thumb2__) \
&& (!defined(__THUMB_INTERWORK__) \
|| defined (__OPTIMIZE_SIZE__) \
|| defined(__ARM_ARCH_6M__)))
# define __prefer_thumb__
#endif
/* How to return from a function call depends on the architecture variant. */ /* How to return from a function call depends on the architecture variant. */
#if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__) #if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__)
...@@ -917,7 +929,7 @@ LSYM(Lgot_result): ...@@ -917,7 +929,7 @@ LSYM(Lgot_result):
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifdef L_udivsi3 #ifdef L_udivsi3
#if defined(__ARM_ARCH_6M__) #if defined(__prefer_thumb__)
FUNC_START udivsi3 FUNC_START udivsi3
FUNC_ALIAS aeabi_uidiv udivsi3 FUNC_ALIAS aeabi_uidiv udivsi3
...@@ -974,7 +986,7 @@ LSYM(udivsi3_skip_div0_test): ...@@ -974,7 +986,7 @@ LSYM(udivsi3_skip_div0_test):
DIV_FUNC_END udivsi3 unsigned DIV_FUNC_END udivsi3 unsigned
#if defined(__ARM_ARCH_6M__) #if defined(__prefer_thumb__)
FUNC_START aeabi_uidivmod FUNC_START aeabi_uidivmod
cmp r1, #0 cmp r1, #0
beq LSYM(Ldiv0) beq LSYM(Ldiv0)
...@@ -1042,7 +1054,7 @@ LSYM(Lover10): ...@@ -1042,7 +1054,7 @@ LSYM(Lover10):
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifdef L_divsi3 #ifdef L_divsi3
#if defined(__ARM_ARCH_6M__) #if defined(__prefer_thumb__)
FUNC_START divsi3 FUNC_START divsi3
FUNC_ALIAS aeabi_idiv divsi3 FUNC_ALIAS aeabi_idiv divsi3
...@@ -1130,7 +1142,7 @@ LSYM(divsi3_skip_div0_test): ...@@ -1130,7 +1142,7 @@ LSYM(divsi3_skip_div0_test):
DIV_FUNC_END divsi3 signed DIV_FUNC_END divsi3 signed
#if defined(__ARM_ARCH_6M__) #if defined(__prefer_thumb__)
FUNC_START aeabi_idivmod FUNC_START aeabi_idivmod
cmp r1, #0 cmp r1, #0
beq LSYM(Ldiv0) beq LSYM(Ldiv0)
......
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