Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.arch Subject: Re: int x int -> long for * (or is it 32x32->64) Keywords: arithmetic,arbitrary precision,benchmark,modular arithmetic Message-ID: <3759@goanna.cs.rmit.oz.au> Date: 14 Sep 90 08:06:03 GMT References: <3984@bingvaxu.cc.binghamton.edu> <41425@mips.mips.COM> <119977@linus.mitre.org> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 19 I was very surprised by the results of Horsell's benchmark. However, it is heavily biassed towards small numbers. I decided to focus on calculating factorials. My test program calculates n! for n from 0 to 1000. I modified Horsell's program to used a fixed buffer, so that malloc() costs could be eliminated. User System User ratio Horsell (16 x 16 -> 16, C code) 311.2 1.9 1.36 slower Horsell (32 x 32 -> 32, C code) 228.8 2.6 My code (32 x 32 -> 64, assembly) 52.6 0.5 4.35 faster These times were obtained on an Encode MultiMax with NS32532 cpus running Encore 4.3BSD, Encore's C compiler, time from /bin/time. I expect that multiplying bignums would also show about a 4x speedup on this machine from using the (32 x 32 -> 64) instruction. -- Heuer's Law: Any feature is a bug unless it can be turned off.