[Mplayer-users] Question: K6-2 and fastmemcpy

Nick Kurshev nickols_k at mail.ru
Thu Apr 19 15:15:15 CEST 2001


Hello, Pontscho!

I want to suggest you a small test program which is designed by me during 20 min.
Could you tell me please what results indicates this code on your processor with and without
3Dnow optimizations?
On my Duron MMX2 optimized version has v2-v1=318426
but version with standard memcpy has v2-v1=517387
i.e. in case of K7 new version is faster approx on 1.6 times, but what on K6-2?

============== 8<============8<==============8<==========

/*
   Note: this code can not be used on PentMMX-PII because they contain
   a bug in rdtsc. For Intel processors since P6(PII) rdpmc should be used
   instead. For PIII it's disputable and seems bug was fixed but I don't
   tested it.
*/

#include <stdio.h>

#include "fastmemcpy.h"

#define ARR_SIZE 100000

static inline unsigned long long int read_tsc( void )
{
  unsigned long long int retval;
  __asm __volatile ("rdtsc":"=A"(retval)::"memory");
  return retval;
}

unsigned char arr1[ARR_SIZE],arr2[ARR_SIZE];

int main( void )
{
  unsigned long long int v1,v2;
  unsigned char * marr1,*marr2;
  marr1 = &arr1[1];
  marr2 = &arr2[3];
  v1 = read_tsc();
  memcpy(marr1,marr2,ARR_SIZE-4);
  v2 = read_tsc();
  printf("v1 = %llu v2 = %llu v2-v1=%llu\n",v1,v2,v2-v1);
  return 0;
}

=========8<=============8<================8<============

Best regards! Nick





_______________________________________________
Mplayer-users mailing list
Mplayer-users at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-users



More information about the MPlayer-users mailing list