linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andi Kleen <ak@muc.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Alternative patching for prefetches & cleanup
Date: Sun, 27 Apr 2003 10:50:54 +0200	[thread overview]
Message-ID: <3EAB99EE.30601@keyaccess.nl> (raw)
In-Reply-To: <Pine.LNX.4.44.0304262021190.25498-100000@home.transmeta.com>

Linus Torvalds wrote:

> That's not the fibonacci sequence, that's just a regular sigma(i)  
> (i=1..n) sequence. And if you were to generate the sequence numbers at
> compile-time I might agree with you, if you also were to avoid using 
> inline asms.

If the sigma(i) method is to stay, please note that

sigma(1 <= i <= n | i) = n*(n+1) / 2

for all n > 0 (trivial proof by induction).

That is, no need to loop; in this case, with n = num - 1

k = ((num - 1) * num) / 2

Rene.



      parent reply	other threads:[~2003-04-27  8:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-27  2:19 [PATCH] Alternative patching for prefetches & cleanup Andi Kleen
2003-04-27  3:09 ` Linus Torvalds
2003-04-27  3:14   ` Andi Kleen
2003-04-27  3:22     ` Linus Torvalds
2003-04-27  3:27       ` Andi Kleen
2003-04-27  3:32       ` William Lee Irwin III
2003-04-27  8:50       ` Rene Herman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EAB99EE.30601@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).