[PATCH] Tweak Alpha int_div costs

Falk Hueffner hueffner@informatik.uni-tuebingen.de
Sun Jul 25 19:50:00 GMT 2004


Hi,

the costs for Alpha integer division/modulo seem way too low. In the
past, this didn't matter much since the costs for s4addq et al. were
also estimated too low; however now for example x % 139968 produces a
__remq call. This patches adjusts the costs to roughly correspond to
the timings of the current glibc routines
(cf. http://marc.theaimsgroup.com/?l=glibc-alpha&m=108062772319905&w=2).

-- 
	Falk

2004-07-25  Falk Hueffner  <falk@debian.org>

	* config/alpha/alpha.c (alpha_rtx_cost_data): Tweak int_div
	costs.

Index: alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.263.2.31.2.7
diff -u -p -r1.263.2.31.2.7 alpha.c
--- alpha.c	18 Jul 2004 23:14:38 -0000	1.263.2.31.2.7
+++ alpha.c	25 Jul 2004 12:55:01 -0000
@@ -151,7 +151,7 @@ static struct alpha_rtx_cost_data const 
     COSTS_N_INSNS (23),		/* int_mult_di */
     COSTS_N_INSNS (2),		/* int_shift */
     COSTS_N_INSNS (2),		/* int_cmov */
-    COSTS_N_INSNS (70),		/* int_div */
+    COSTS_N_INSNS (97),		/* int_div */
   },
   { /* EV5 */
     COSTS_N_INSNS (4),		/* fp_add */
@@ -162,7 +162,7 @@ static struct alpha_rtx_cost_data const 
     COSTS_N_INSNS (12),		/* int_mult_di */
     COSTS_N_INSNS (1) + 1,	/* int_shift */
     COSTS_N_INSNS (1),		/* int_cmov */
-    COSTS_N_INSNS (45),		/* int_div */
+    COSTS_N_INSNS (83),		/* int_div */
   },
   { /* EV6 */
     COSTS_N_INSNS (4),		/* fp_add */
@@ -173,7 +173,7 @@ static struct alpha_rtx_cost_data const 
     COSTS_N_INSNS (7),		/* int_mult_di */
     COSTS_N_INSNS (1),		/* int_shift */
     COSTS_N_INSNS (2),		/* int_cmov */
-    COSTS_N_INSNS (25),		/* int_div */
+    COSTS_N_INSNS (86),		/* int_div */
   },
 };
 



More information about the Gcc-patches mailing list