public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] strange performance behaviour with floats
Date: Sat, 22 Feb 2003 02:30:32 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805905@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805852@msgid-missing>

>>>>> On Thu, 20 Feb 2003 20:59:47 +0100, Volker Birk <vb@ebios.de> said:

  Volker> On Thu, Feb 20, 2003 at 09:52:43AM -0800, David Mosberger
  Volker> wrote:

  >> Hmmh, that's really strange.  I assume you realize that your
  >> test-program doesn't really do what the source code suggests (the
  >> loop-body gets optimized away), but regardless the high variation
  >> you're seeing seems wrong.

  Volker> I think, optimazation does not matter on that point.

I looked into this a bit more.  Your test program is basically a
1-cycle loop:

4000000000000770:       0a 00 00 00 01 00       [MMI]       nop.m 0x0
4000000000000776:       00 00 00 02 00 00                   nop.m 0x0
400000000000077c:       00 00 04 00                         nop.i 0x0
4000000000000780:       1c 00 00 00 01 00       [MFB]       nop.m 0x0
4000000000000786:       00 00 00 02 00 a0                   nop.f 0x0
400000000000078c:       f0 ff ff 48                         br.cloop.sptk.few 40
This is because gcc optimizes away to loop-body.  If you change the loop
to:

        for (i=0;i<1000000000;i++) {
		asm volatile ("nop 0;;");
        }

you'll get a 2-cycle loop which will execute consistently in 2 seconds
(on a 1GHz McKinley), which is what you'd expect.  1-cycle loops are
never optimal on McKinley (that's why the Linux bogomips comes out at
1438 instead of 2000, for example), though I don't know the exact
micro-architectural details that cause this.

	--david


      parent reply	other threads:[~2003-02-22  2:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-14  9:02 [Linux-ia64] strange performance behaviour with floats Volker Birk
2003-02-14 10:50 ` Hideki Yamamoto
2003-02-15 11:29 ` Volker Birk
2003-02-19 19:09 ` David Mosberger
2003-02-20 17:52 ` David Mosberger
2003-02-20 19:59 ` Volker Birk
2003-02-22  2:30 ` David Mosberger [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=marc-linux-ia64-105590709805905@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /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