mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Programming (https://www.mersenneforum.org/forumdisplay.php?f=29)
-   -   Help needed to test Athlon64 code (https://www.mersenneforum.org/showthread.php?t=6187)

geoff 2006-07-30 00:10

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: [url=http://www.geocities.com/g_w_reynolds/srsieve/k8test.zip]k8test.zip[/url]

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.

jasonp 2006-07-30 02:57

[QUOTE=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.
[/QUOTE]
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
}
[/code]

dsouza123 2006-07-31 15:55

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.

[url]http://bochs.sourceforge.net/[/url]

geoff 2006-08-01 02:30

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.

c00ler 2006-08-17 21:11

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 [url]http://www.intel.com/support/performancetools/c/windows/sb/cs-020438.htm[/url] ?

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

dsouza123 2006-08-18 02:26

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 ?

c00ler 2006-08-18 05:40

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 =)

Prime95 2006-08-18 12:16

[QUOTE=dsouza123;85221]In local.ini add
CpuSupportsSSE=0
CpuSupportsSSE2=0
then it would simulate an earlier Athlon using only the FPU.[/QUOTE]

Nice try, but this won't work on the 64-bit prime95 version. It assumes (and requires) SSE2 support.


All times are UTC. The time now is 11:36.

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