From: Andreas R. <and...@gm...> - 2004-04-06 23:06:45
|
> Just another data point: some Smalltalk implementations put the > SmallInteger tag in the topmost bit. This makes SI tag and overflow > checks after arithmetic simpler: addition and subtraction work > in-place, plus you can just look at the sign flag after the operation > instead of "mask + test-zero" or "shift + xor + sign-test". > > On architectures where you can set the sign flag during move this can > also often eliminate any need to mask and test on the tag bit; after a > move you can "trap" immediately on (non-)SI oops. Hm... if we'd accept cutting the address range in half (which isn't that big of a deal) that is actually a pretty interesting idea. It would allow us to use low bits as "other tags" similar to immediate, say 00->oop, 01->GC flag, 10->Character, 11->Undefined, without too much of a bother. The only objection I'd have is whether this would have any effects on machines that "like to give you the upper half of the address space" (e.g., all addresses must have that "tag bit" set). Cheers, - Andreas |