Floating Point-How Important to Unix?

Ed G. edgee at cyberpass.net
Wed Apr 8 13:25:33 AEST 1998


> How did you recognize the instructions words?  Just because it's in
> the text segment doesn't mean it's instructions.

Yes, this occurred to me too.  My perl script doesn't do any fancy
decoding; it just looks for words beginning with octal 17.  After 
some thought I came to the conclusion that the percentage of data 
words miscounted as floating pt. ops (FPOs) is negligible.

Here's my reasoning--tell me what you think:

It seemed to me that the two potential sources of fake FPOs are 
addresses and data words.  Have I left anything out?

I don't believe that addresses are a problem because the programs
would have to be at least 170000 octal (61441 decimal) bytes long to
generate these addresses at compile time.  In fact, the largest 
program in the bin directory is awk at 45,260 bytes.  cc is only 6510 
bytes (those guys at bell labs really knew how to pack it in!)

That leaves data.  What percent of the data words do you think begin 
with 17 octal?

Here's my "guestimate":  17 octal is a 6 bit binary number. 
Assuming the probability of any bit being one is .5, the probability
of finding a word whose first six bits are one would be 1/2^6 or 1
in 64 which is 1 in 128 bytes.  

I examined the run time image of factor.  It was 3072 bytes long, of 
which 222 bytes or less than 10% appeared to be global data.  
Counting immediate operands, I think it is reasonable to assume a 
10-1 code to data ratio.

That would mean for factor that 2 of the 132 FPOs would be bogus
(111* 1/64 = 2 approx).  

Most programs are bigger than factor, however.  cptree and ops are 
close to the average size (around 7800 bytes) for an executable in 
the bin directory.  So for the average program you might expect to 
see 7800*.1*1/128 = 6 bogus FPOs.

"there are lies, damn lies and statistics"--Mark Twain (I think)

Ed G. 

List of floating point ops by program:

awk 2540
refer 1644
xsend 1326
tbl 1315
graph 1300
xget 1288
adb 1152
eqn 918
enroll 915
neqn 874
nroff 841
make 822
spline 812
yacc 789
sa 714
tar 706
lex 628
tek 618
prof 608
t300s 604
dc 601
vplot 582
iostat 579
t300 576
t450 574
em 530
bc 509
ratfor 474
quot 452
tsort 407
sh 381
expr 380
units 379
ac 365
sort 358
ps 327
restor 323
rmail 321
ed 321
mail 321
ptx 320
egrep 313
ls 310
ps.old 306
m4 304
random 298
su 296
tp 285
ops 282
cu 282
diff 277
pr 275
poke6 275
sed 267
find 267
dump 261
deroff 255
icheck 251
ls.11 249
ld 246
login 240
cptree 230
passwd 227
login.old 218
cc 210
prep 205
at 203
dumpdir 197
join 196
wc 193
tc 192
nm 191
pstat 190
file 187
pr.old 186
crypt 182
date 181
grep 180
ranlib 174
fgrep 172
ncheck 159
checkeq 157
du 155
who 152
as 152
od 151
look 149
roff 149
ar 146
vpr 144
dd 141
tk 141
time 139
rm 138
cb 134
mv 134
comm 133
newgrp 133
dcheck 132
factor 132
rmdir 125
write 125
primes 124
cmp 121
dfOLD 120
df 120
size 117
v6sh 116
vcopy 113
nice 113
col 110
ln 106
sum 105
clri 104
cat 103
tail 103
sleep 101
stty 98
mkdir 98
mesg 96
cp 96
touch 96
strip 96
tty 91
chmod 90
split 90
uniq 89
pwd 86
rev 86
chown 84
chgrp 84
kill 83
arcv 83
yes 79
tr 58
sp 57
test 53
basename 34
tee 24
echo 4
sync 2
finddouble.pl 0
u3b2 0
1 0
f77 0
lint 0
finddouble.pl~ 0
true 0
spell 0
troff 0
notmade 0
nohup 0
diff3 0
learn 0
notavail 0
findfp.pl~ 0
lookbib 0
pcc 0
man 0
plot 0
m68k 0
false 0
findfp.pl 0
struct 0
lorder 0
calendar 0

Received: (from major at localhost)
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) id NAA06682
	for pups-liszt; Wed, 8 Apr 1998 13:32:13 +1000 (EST)
X-Authentication-Warning: minnie.cs.adfa.oz.au: major set sender to owner-pups at minnie.cs.adfa.oz.au using -f


More information about the TUHS mailing list