<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hi Vanessa,<br><br>A method header fits in a 31 bit SmallInteger on 32-bits and is exactly the same value on 64-bits.  So the values of a method header are in the range ((2 raisedTo: 30) negated to: (2 raisedTo: 30)). Therefore, at the Smalltalk level no change is required; one uses the same integer value.<div><br></div><div>But at the machine level</div><div>- to go from 32 to 64 bits one preserves the bottom 30 bits above the tag bit, shifting left two bits to make room for the three bit immediate tag, and moves the sign bit from bit 31 (0 relative) to bit 63, and sets the bottom three bits to 1.</div><div>- to go from 64 to 32 bits one shifts the bottom 30 bits above the tag right two bits, shifts the sign bit right 32 bits and sets the bottom tag bit to 1.</div><div><br></div><div>I chose not to take advantage of the bits 31 to 60 in 64 bits.  It would make converting back and forth a night mare. So in 64 bits exactly the same limitations on numLiterals, numTemps and numArgs apply. If and when 32 bit support becomes obsolete (please no...) we can revisit but right now wasting 30 bits, when we have a max literals limit of 32k, and a way of expanding beyond the Max arg/temp count of 16/32 using tuples and the indirect temp vector bytecodes, seems like the right choice to me.  Thoughts?</div><div><br><div dir="ltr"><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div dir="ltr"><br><blockquote type="cite">On Dec 16, 2020, at 1:02 PM, Vanessa Freudenberg <vanessa@codefrau.net> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span><div dir="ltr">Hi Eliot / Clément / everyone,<div><br></div><div>how do I properly convert a 64 bit method header word to 32 bits?</div><div><br></div><div>E.g. if in 64 bits I have <span style="color:rgb(224,30,90);font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;font-variant-ligatures:none;white-space:pre-wrap;background-color:rgba(29,28,29,0.04)">0x8000000000000049</span> my guess it would be <span style="color:rgb(224,30,90);font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;font-variant-ligatures:none;white-space:pre-wrap;background-color:rgba(29,28,29,0.04)">0x80000049</span> in 32 bits, but which bits should I actually drop?</div><div><br></div><div>Thanks!</div><div>Vanessa</div></div>
</span></div></blockquote></div></body></html>