Floating Point-How Important to Unix?

Johnny Billquist bqt at Update.UU.SE
Wed Apr 8 17:53:37 AEST 1998


On Tue, 7 Apr 1998, Ed G. wrote:

> > 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.  

You are making atleast four assumptions which are wrong here.

1) Data starts from address 0. They most likely do not.
2) 17 is not 6 bits, it's four! You are talking about octal representation
   of 16 bits, which means that the highest digit can only be 0 or 1.
3) All data are not words. How about bytes? If a byte is in the range
   240-255 and on an odd address, you'll catch it as a FP opcode.
4) Not all data are addresses. Most negative numbers will have 17 as the
   high four bits.

Of these four assumptions, the fourth is the most serious, and probably
the cause of most of your "hits". You'll have to do better...

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt at update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Received: (from major at localhost)
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) id HAA10162
	for pups-liszt; Thu, 9 Apr 1998 07:36:02 +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