[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Libcurl-ssl / RPM package



Miro Kropacek wrote:
Here are numbers for 68020-60 with Howard's BN asm implementation.  This
build did pass all tests, and I think (I could be wrong) there is gain.
I've reviewed your last three results, it's really interesting. While
blowfish clearly rules with Howard's patch (and standard 000/020-60
gives slower results) with aes/rsa/dsa it's horrible, much slower with
Howard's patch!

Hi guys, sorry I don't keep up with this list so much any more.

For the record, all crypto algorithms are purely integer code. There is no possible benefit from using an FPU.

They're not just ordinary integer of course, stuff like RSA uses 1024-bit integers (or longer). These are really big numbers (thus that part of the OpenSSL library is called BigNum) and all you can do is use integer ops on them one word at a time, and ripple-carry across to the next word until the entire big integer is computed.

re: CAB and 68000 - it worked fine for me but was certainly slow. I used to use CAB with my overlay and SSL build to do all my web banking, up until about 2004. Obviously the 68020 version is faster.

The 68000 can only do a 16x16 bit multiply, yielding a 32 bit result. The 68020 can do 32x32 yielding a 64 bit result, in a single instruction. For 68000 to do the 64 bit multiply would take 4 multiplies plus 3 adds, so right off the bat the 68020 version is up to 7 times faster, not taking other processor differences into account.

For add/subtract, there's really no difference. 68000 can do 32 bit add/sub, so can 68020.

The other big difference is in division. In C you have to write division and modulo as two separate statements:
	div = x / y;
	mod = x % y;

but the actual assembly language Divide instruction always does both at once. So when you need both answers, you can get a 2x speedup using assembly language here.

Aside from that there aren't a lot of tricks you can do, besides just being smarter about register usage than the compiler is.

I haven't looked closely at Keith's results, may do that and followup again later.
--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/