# cray/c64 comparison

From: Christopher Phillips (cphillips_at_reflectionsinteractive.com)
Date: 2001-05-03 11:30:54

```from the link posted earlier by Dave R.

(http://www.dementia.org/~strong/public/humor/crays.as.units)

"Flops:  1 Cray (2.2Gigaflop)  = 1 Billion C64 (64 Bit floatingpoint
in software?)"

I would dispute that; this implies that it would take a c64 roughly
a second for a double precision multiply-accumulate.

Let's look at the multiply; in software that would dwarf the time

A fairly naive squaretable driven 8bit*8bit multiply accumulating
it's 16 bit result to a field in a 112 bit total takes about 77
cycles (see below for outline).

multiplying two doubles requires (56/8)*(56/8) of these, so we're
now up to 49*77=3773 cycles.  Normalising the result should take
under 500 cycles, and there's plenty of room for optimisation
(eg not computing lower order terms in cases where they won't affect
the result, grouping the additions to avoid zero page writes and
reloads of x, etc).  So we should be able to get the entire product
in under 4000 cycles.

Tack a sub 1000-cycles addition on the end, and we should be able
to get at least 200 double precision MACs per second.

Hence, 1 Cray is only 5.5 million C64s for Flops. :-)

Christopher Jam.

--
8*8

ldx n1   ; bytes to multiply
6 lda n2
sta l+1  ;modify code
sta m+1
eor #\$ff
sta l+4
sta m+4
20 sec

.l
lda t1:a,x
sbc t2:a,x
11 tay

.m
lda t3:a,x
sbc t4:a,x
11 tax

clc
tya
10 sta pp+n
txa