diff mbox

[expmed,trivial] Fix comment about multiplying by T-1 and adding T

Message ID 550C3F04.4030800@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov March 20, 2015, 3:38 p.m. UTC
Hi all,

This comment in expmed.c talks about multiplying by a value that ends in 
...01 by doing the T-1 multiplication first and then
adding T to get the final result. But the typo says '1' instead of 'T'. 
Similarly with the T+1, -T case.

I'll apply this patch on Monday unless someone objects.

Thanks,
Kyrill

2015-03-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * expmed.c (synth_mult): Fix comment about multiplying by T-1 and
     adding T or multiplying by T+1 and subracting T.
diff mbox

Patch

diff --git a/gcc/expmed.c b/gcc/expmed.c
index d2b2534..ffbf462 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2613,7 +2613,7 @@  synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
 		 Thus we prefer addition in that case.  */
 	      && t != 3))
 	{
-	  /* T ends with ...111.  Multiply by (T + 1) and subtract 1.  */
+	  /* T ends with ...111.  Multiply by (T + 1) and subtract T.  */
 
 	  op_cost = add_cost (speed, mode);
 	  new_limit.cost = best_cost.cost - op_cost;
@@ -2633,7 +2633,7 @@  synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
 	}
       else
 	{
-	  /* T ends with ...01 or ...011.  Multiply by (T - 1) and add 1.  */
+	  /* T ends with ...01 or ...011.  Multiply by (T - 1) and add T.  */
 
 	  op_cost = add_cost (speed, mode);
 	  new_limit.cost = best_cost.cost - op_cost;