count of bits in a long

Kevin D. Quitt kdq at demott.COM
Fri Oct 19 00:24:16 AEST 1990


    Something is seriously wrong with this bit-counting benchmark.  I'm
running on a Motorola Delta 3600 (25MHz 68030), and my time are 2 orders
of magnitude slower than those reported for a Sun 3/50!!!!

function                   time          ratio
hackmemmod               0.00033760071   2.810
hackmemloop              0.00034141541   2.841
hackmemunrolled          0.00017452240   1.452
hackmemallfold           0.00026226044   2.183
rmlsbsub                 0.00062084198   5.167
rmlsbmask                0.00061321259   5.103
testlsb                  0.0015430450   12.841
testmsb                  0.0012369156   10.294
testsignandshift         0.0014562607   12.119
testeachbit              0.0016183853   13.468
testeachbit1shl          0.0018253326   15.190
tableshift               0.00029087067   2.421
tableuchar               0.00018882751   1.571
tableshiftcast           0.00039577484   3.294
itableshift              0.00022602081   1.881
itableuchar              0.00012016296   1.000
itableshiftcast          0.00032424927   2.698
16tableshift             0.00033283234   2.770
16tableushort            0.00027084351   2.254
16tableshiftcast         0.00029563904   2.460
16itableshift            0.00035190582   2.929
16itableushort           0.00033092499   2.754
16itableshiftcast        0.00042724609   3.556
sumbits                  0.00023365021   1.944


    In order to get this to compile on my SYSV machine, I had to add the
line:

#undef FD_SETSIZE

    because there's no resource.h on this machine.  Oh yes, it's gcc -O.

-- 
 _
Kevin D. Quitt         demott!kdq   kdq at demott.com
DeMott Electronics Co. 14707 Keswick St.   Van Nuys, CA 91405-1266
VOICE (818) 988-4975   FAX (818) 997-1190  MODEM (818) 997-4496 PEP last

                96.37% of all statistics are made up.



More information about the Comp.lang.c mailing list