![]() |
|
|
#34 |
|
Jul 2004
3510 Posts |
Here is a comparison of assembly vs C. This is to give an estimation of the speed gain using assembly, so I haven't comment the assembly code yet.
My method is linking the OBJ file with C code. The benchmarking code is written in C. I use Visual C++ 6.0 and I hope you have no problem compiling it. I haven't prepare to let you look at my assembly code, I admit it is very messy. But you can try using the function extern "C" __fastcall eegcd(int input, int modulus); link together with inverse1.obj. Don't trust my code yet. Check if there is any wrong result produced. eegcd-11 means Euclidean algorithm with 11 times repeated subtraction. Code:
eegcd-11 eegcd-10 eegcd-9 eegcd-8 eegcd-7 akruppa_C 1048583 300 313 310 316 321 418 2097169 315 326 324 332 333 422 4194319 316 326 322 332 332 429 8388617 322 331 328 337 338 437 16777259 333 343 340 350 350 457 33554467 345 355 352 363 363 475 |
|
|
|
|
|
#35 |
|
23×317 Posts |
From the looks of it I see a lot of repeated code.
.NET may be the way to go. |
|
|
|
#36 |
|
2·4,409 Posts |
xenon
I've compiled it with Visual Studio 6.0.(c++6) It hangs upon launch, so I didn't get to far with it. I'm not an expert in C++, but I have dabbled with it. Although I am more famliar with .NET, which is a love hate relationship.
|
|
|
|
#37 |
|
Jul 2004
2316 Posts |
TTn
When you compile, you should see ... inverse3.cpp(19) : warning C4101: 'temp' : unreferenced local variable This is expected. I guess __fastcall didn't work. But for the same compiler, it shouldn't be a problem. Try replacing //ans = single_modinv_ak(i, PRIME); ans = eegcd(i, PRIME); with ans = single_modinv_ak(i, PRIME); //ans = eegcd(i, PRIME); Also if your computer is less than 1GHz, wait for 10 seconds before killing off the process. If that doesn't help. Create a new project and try using the akruppa C code first. Then you can sort out the problem. |
|
|
|
|
|
#38 | |
|
"Bob Silverman"
Nov 2003
North of Boston
5·17·89 Posts |
Quote:
Post the source!! If it truly is faster, the linkage problems can be fixed. I will port it to Microsoft style ASM's. 475 to 345 is a noteworthy improvement....
|
|
|
|
|
|
|
#39 | |
|
Tribal Bullet
Oct 2004
5·23·31 Posts |
Quote:
Unfortunately the code is in AT&T syntax and expects the modulus to be in a global location, so it's not plugin-compatible with the code we've been comparing. jasonp |
|
|
|
|
|
|
#40 |
|
"Nancy"
Aug 2002
Alexandria
1001101000112 Posts |
Afaik ggnfs is distributed under the GPL, so there may be a license problem with using that code bit - unless Bob wants to put his code under the GPL as well.
Alex |
|
|
|
|
|
#41 | |
|
"Bob Silverman"
Nov 2003
North of Boston
5×17×89 Posts |
Quote:
out to anyone who asks. |
|
|
|
|
|
|
#42 | |
|
Jul 2004
1000112 Posts |
Quote:
I use MASM syntax only. You should be porting from Microsoft style to gcc style. Last fiddled with by xenon on 2005-08-01 at 00:25 |
|
|
|
|
|
|
#43 | |
|
22×809 Posts |
Quote:
|
|
|
|
|
#44 | |
|
Bamboozled!
"๐บ๐๐ท๐ท๐ญ"
May 2003
Down not across
22×3×983 Posts |
Quote:
The GPL is a kiss of death to many organizations, as it forces recipients to GPL their own material if they wish to redistribute anything containing GPL-ed components. That's why NFSNET has avoided any contributions of GPL-licensed code because it conflicts with the licensing requirements on the CWI material. NFSNET-written code is distributed under a BSD-like license. Paul |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling airsquirrels | Prime95 | GPU Computing | 16 | 2015-09-29 18:06 |
| Help from coders | ET_ | GPU Computing | 5 | 2014-01-26 13:58 |
| Calling all 64-bit Linux sievers! | frmky | NFS@Home | 25 | 2013-10-16 15:58 |
| IA-32 Assembly Coders, anyone? | xenon | Programming | 6 | 2005-06-02 13:26 |
| Bob, I'm calling you out! | synergy | Miscellaneous Math | 17 | 2004-10-26 15:26 |