mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: lkml@sigkill.net (Disconnect)
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox), linux-kernel@vger.kernel.org
Subject: Re: Athlon problem report summary
Date: Sat, 21 Apr 2001 01:34:46 +0100 (BST)	[thread overview]
Message-ID: <E14qlMO-0002bj-00@the-village.bc.nu> (raw)
In-Reply-To: <20010420203029.C20176@sigkill.net> from "Disconnect" at Apr 20, 2001 08:30:29 PM

> Is there anything out there to test/benchmark MMX ops? (Preferably with
> reporting on MMX and equiv non-MMX ops, tunable memory bandwidth, etc.)

I wrote a set of programs to tune the MMX code. Arjan I suspect did similar
when he reoptimised the code for the newer Athlon. Simple stuff like



#include <stdio.h>

char space[1024*1024];
char target[1024*1024];

void mmx_copy(char *from, char *to)
{
	int i;
	char fpu_save[108];
	__asm__ __volatile__ ( " fsave %0; fwait\n"::"m"(fpu_save[0]) );
	__asm__ __volatile__ (
		"  prefetch (%0)\n"
		"  prefetch 64(%0)\n"
		"  prefetch 128(%0)\n"
		"  prefetch 192(%0)\n"
		"  prefetch 256(%0)\n"
		: : "r" (from) );

	for(i=0;i<4096/64;i++)
	{
		__asm__ __volatile__ (
		"  prefetch 320(%0)\n"
		"  movq (%0), %%mm0\n"
		"  movq 8(%0), %%mm1\n"
		"  movq 16(%0), %%mm2\n"
		"  movq 24(%0), %%mm3\n"
		"  movq %%mm0, (%1)\n"
		"  movq %%mm1, 8(%1)\n"
		"  movq %%mm2, 16(%1)\n"
		"  movq %%mm3, 24(%1)\n"
		"  movq 32(%0), %%mm0\n"
		"  movq 40(%0), %%mm1\n"
		"  movq 48(%0), %%mm2\n"
		"  movq 56(%0), %%mm3\n"
		"  movq %%mm0, 32(%1)\n"
		"  movq %%mm1, 40(%1)\n"
		"  movq %%mm2, 48(%1)\n"
		"  movq %%mm3, 56(%1)\n"
		: : "r" (from), "r" (to) : "memory");
		from+=64;
		to+=64;
	}
	__asm__ __volatile__ ( " frstor %0;\n"::"m"(fpu_save[0]) );
}

int main(int argc, char *argv)
{
	char *from=space;
	char *to=target;
	int r;
	int i;
	for(r=0;r<2048;r++)
	{
		for(i=0;i<256;i++)
		{
			mmx_copy(from, to);
			from+=4096;
			to+=4096;
			
		}
		from=space;
		to=target;
	}
}

  reply	other threads:[~2001-04-21  0:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.fkfenov.14jqeov@ifi.uio.no>
2001-04-16 12:30 ` Alan Cox
2001-04-16 12:33   ` Alan Cox
2001-04-16 13:17   ` Kurt Roeckx
2001-04-20 23:52   ` Disconnect
2001-04-21  0:14     ` Alan Cox
2001-04-21  0:22       ` Disconnect
2001-04-21  0:28         ` Alan Cox
2001-04-21  0:30           ` Disconnect
2001-04-21  0:34             ` Alan Cox [this message]
2001-04-21  9:27               ` Arjan van de Ven
2001-04-21 15:07               ` Disconnect
     [not found]   ` <fa.fn57bnv.nno4p4@ifi.uio.no>
2001-04-21  2:54     ` Jeff Lightfoot

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=E14qlMO-0002bj-00@the-village.bc.nu \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@sigkill.net \
    /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

all inboxes | Powered by JetHome®