Floating Point-How Important to Unix?

Johnny Billquist bqt at Update.UU.SE
Thu Apr 16 05:48:00 AEST 1998


On Fri, 10 Apr 1998, Ed G. wrote:

> My purpose here was to get a sense for how heavily the Unix utilities
> rely on floating point.  I was not looking for a numerically exact 
> "right" answer, but rather an estimate which was good enough.
> 
> At this point, now that I have access to the source code, it seems to 
> me that an easier and more accurate way of doing that would be to 
> count the occurences of floats and doubles using grep or a similar 
> utility.  What do you all think?

Would probably be a better idea, yes. :-)

> > You are making atleast four assumptions which are wrong here.
> > 
> > 1) Data starts from address 0. They most likely do not.
> 
> I'm not sure what you mean here; can you elaborate?  
> 
> As I see it my key assumption about data was that it is 
> relatively small in size compared to code in a given program file.  
> This was certainly the case with factor, where less than 10% of the 
> runtime image consisted of static data.

But you made an assumption that addrtesses to data don't come in theflt.
op-code range, since few programs have that much data. But, by assuming
that they don't have "that much" data, you must also assume that whatever
little dtaa there is don't start at a high address. Your program can have
as little as one word of data, located at 177776, referenced a zillion
times, and your algorithm will catch it as a zillion flt. ops.

> > 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.
> 
> My routine scanned words, not bytes, so I don't think this would 
> apply.

Oh, it most definitely does.

Tell me, what is the difference between a string of two bytes, a word, and
an instruction in memory?

Nothing. It's just a question of how you look at it.

So when you are talking about a word, how do you know that the programmer
didn't write two bytes there?

The reason I said "odd addres" was because the byte at the odd address is
the high byte of the word you are looking at.

> > 4) Not all data are addresses. Most negative numbers will have 17 as the
> >    high four bits.
> 
> This is true.  But if data is negligible compared to code, then I
> don't see how this wouldn't affect an estimate very much.

That is a good point. But it's still a problem.
The point is more or less always, but a lot of small errors...
:-)

	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 GAA05701
	for pups-liszt; Thu, 16 Apr 1998 06:07:06 +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