[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Floats in self.



I have just been re-reading the OOPSLA'89 paper on Self and in section
3.3 it says that floats are immediates with a tag of (binary) 10 in
the least significant two bits.

I was wondering what happens when a float is tagged.  Is the mantissa
truncated and then tagged:
	
	float x = ...
	tagged_x = ((unsigned) x & ~0x3) | 0x2;

or is the mantissa rounded so that it only uses the 21 bits
and then tagged:

	tagged_x = round_to_21(x) | 0x2;

or does something else happen?

How about un-tagging, what happens then?


Hugh