* [PATCH][expmed][trivial] Fix comment about multiplying by T-1 and adding T
@ 2015-03-20 15:38 Kyrill Tkachov
0 siblings, 0 replies; only message in thread
From: Kyrill Tkachov @ 2015-03-20 15:38 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: synth-mult-comment.patch --]
[-- Type: text/x-patch; name=synth-mult-comment.patch, Size: 847 bytes --]
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-20 15:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 15:38 [PATCH][expmed][trivial] Fix comment about multiplying by T-1 and adding T Kyrill Tkachov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).