mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2006-07-30, 00:10   #1
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

48516 Posts
Default Help needed to test Athlon64 code

I am trying to implement 64 bit modular multiplication for the Athlon 64 but I don't have access to one for testing. If someone with gcc, make, etc. installed and running a 64 bit OS could compile and run this test program for me it would be a great help: k8test.zip

Just unzip and type `make', it will run two test programs, one in 32 bit mode and one in 64 bit mode, and print the results to a file `k8.txt'. Post that file or any errors here, or send me a PM.

Thanks,
Geoff.
geoff is offline   Reply With Quote
Old 2006-07-30, 02:57   #2
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

1101110100002 Posts
Default

Quote:
Originally Posted by geoff
Just unzip and type `make', it will run two test programs, one in 32 bit mode and one in 64 bit mode, and print the results to a file `k8.txt'. Post that file or any errors here, or send me a PM.
You may want to use a higher-resolution timer...

jasonp
Code:
uint64
read_clock( void ) {

#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
	uint32 lo, hi;
	asm("rdtsc":"=d"(hi),"=a"(lo));
	return (uint64)hi << 32 | lo;

#elif defined(_MSC_VER)
	LARGE_INTEGER ret;
	QueryPerformanceCounter(&ret);
	return ret.QuadPart;

#else
	struct timeval thistime;   
	gettimeofday(&thistime, NULL);
	return thistime.tv_sec * 1000000 + thistime.tv_usec;
#endif
}
jasonp is offline   Reply With Quote
Old 2006-07-31, 15:55   #3
dsouza123
 
dsouza123's Avatar
 
Sep 2002

2×331 Posts
Default

Bochs might be a solution.

Bochs emulates an x86 CPU and some other PC chips
and uses hard drive images.

Among the CPUs emulated are a Pentium Pro and an Athlon 64.

I have used both emulated CPUs with good success.

Used it to run Win98 SE with an emulated Athlon 64 (for SSE2 support)
on top of Win XP Pro with a real Athlon (early 32 bit model no SSE2 ).

There are various Linux images available.

http://bochs.sourceforge.net/
dsouza123 is offline   Reply With Quote
Old 2006-08-01, 02:30   #4
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

100100001012 Posts
Default

Thanks for the help everyone.

From the looks of it in 64 bit mode the generic C mulmod using the FPU is much faster than the assembler for both 32 and 64 bit arguments, but in 32 bit mode the assembler integer version is a little faster for 32 bit arguments and the assembler FPU version for 64 bit arguments.
geoff is offline   Reply With Quote
Old 2006-08-17, 21:11   #5
c00ler
 
Jul 2003

52 Posts
Default

Something strange with latest prime95 x64 under windows 2003 x64 (athlon 64 3200+, 2gb ram).

1) Start torture test or prime testing, then (maybe even after some time) start playing video (wmplayer x32, divx player x32)
Exactly when video starts i get illegal sumout, or bad rounding (0.4993896484 or even 0.5)

2) VirtualDub x64 playing/compressing video doesn't crash prime95 x64

Maybe the reason is http://www.intel.com/support/perform.../cs-020438.htm ?

But why x32 and not x64 codecs cause errors is a mystery to me =)

Last fiddled with by c00ler on 2006-08-17 at 21:13
c00ler is offline   Reply With Quote
Old 2006-08-18, 02:26   #6
dsouza123
 
dsouza123's Avatar
 
Sep 2002

12268 Posts
Default

If the SSE2 registers aren't saved/restored correctly
so they become corrupted, does it also affect the FPU ?

In local.ini add
CpuSupportsSSE=0
CpuSupportsSSE2=0
then it would simulate an earlier Athlon using only the FPU.

Without disabling SSE/SSE2 support,
does it also affect Prime95 x86-32 run under Windows 2003 x64 ?
dsouza123 is offline   Reply With Quote
Old 2006-08-18, 05:40   #7
c00ler
 
Jul 2003

1916 Posts
Default

Tried
CpuSupportsSSE=0
CpuSupportsSSE2=0

These options don't affect corruption, also there is not even a 1% difference in benchmark in both 32 bit and x64.

32 bit prime95 is not affected by corruption, with and without SSE/SSE2.

P.S. maybe i can recompile prime95 with intel c++ 9.1, but i need instructions =)

Last fiddled with by c00ler on 2006-08-18 at 05:42
c00ler is offline   Reply With Quote
Old 2006-08-18, 12:16   #8
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2·3,701 Posts
Default

Quote:
Originally Posted by dsouza123 View Post
In local.ini add
CpuSupportsSSE=0
CpuSupportsSSE2=0
then it would simulate an earlier Athlon using only the FPU.
Nice try, but this won't work on the 64-bit prime95 version. It assumes (and requires) SSE2 support.
Prime95 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How many ways can you code an LL test science_man_88 Lounge 20 2018-08-23 23:06
Predicting the Amount of CPU Power Needed to LL Test Exponent p jinydu Math 19 2005-02-07 02:52
Help needed for stress test of Albatron motherboard phrater phil Hardware 6 2004-10-21 11:20
Athlon64 support? JuanTutors Software 1 2004-06-04 02:46
How much torque test is needed? E_tron Hardware 7 2004-01-07 04:20

All times are UTC. The time now is 02:42.

Mon Apr 12 02:42:43 UTC 2021 up 3 days, 21:23, 1 user, load averages: 2.19, 2.20, 1.91

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.