ARM: Use __aeabi_idiv
Daniel Jacobowitz
drow@false.org
Tue Oct 18 13:28:00 GMT 2005
I've committed this obvious patch to csl-arm-branch, and will commit it
to mainline when unfrozen. __aeabi_idiv was implemented more recently
than __aeabi_idivmod, but it's faster, so we should use it.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-10-18 Daniel Jacobowitz <dan@codesourcery.com>
* config/arm/arm.c (arm_init_libfuncs): Use __aeabi_idiv and
__aeabi_uidiv.
Index: config/arm/arm.c
===================================================================
RCS file: /scratch/gcc/repos/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.481
diff -u -p -r1.481 arm.c
--- config/arm/arm.c 10 Oct 2005 07:57:21 -0000 1.481
+++ config/arm/arm.c 18 Oct 2005 02:11:11 -0000
@@ -786,8 +786,11 @@ arm_init_libfuncs (void)
routines. */
set_optab_libfunc (sdiv_optab, DImode, "__aeabi_ldivmod");
set_optab_libfunc (udiv_optab, DImode, "__aeabi_uldivmod");
- set_optab_libfunc (sdiv_optab, SImode, "__aeabi_idivmod");
- set_optab_libfunc (udiv_optab, SImode, "__aeabi_uidivmod");
+
+ /* For SImode division the ABI provides div-without-mod routines,
+ which are faster. */
+ set_optab_libfunc (sdiv_optab, SImode, "__aeabi_idiv");
+ set_optab_libfunc (udiv_optab, SImode, "__aeabi_uidiv");
/* We don't have mod libcalls. Fortunately gcc knows how to use the
divmod libcalls instead. */
More information about the Gcc-patches
mailing list