[Openmcl-devel] A little more LAP stuff...

Jon S. Anthony j-anthony at comcast.net
Wed Feb 17 01:07:13 UTC 2010


On Tue, 2010-02-16 at 20:03 -0500, Jon S. Anthony wrote:
> Thanks.  That clears that up.
> 
> Another quick one (I think..)
> 
> Is the basic difference between ($ n) and ($ 'n), (where n is some
> positive integer) that the latter is a kind of shorthand indicating that
> we are talking about fixnums and that this will be turned into the
> equivalent of ($ (* 4 n)), i.e., fixnum n (where ?? == 32/64)?  While

OK, that was incoherent due to multiple edits!  Let's bust that line
into:

equivalent of

x8632: ($ (* 4 n))
x8664: ($ (* 8 n))

> the former is literally native value n as represented in full 32 bits?

And I guess this one should obviously end in "full 32/64 bits?"

Dang...

/Jon


> 
> /Jon
> 
> 
> On Tue, 2010-02-16 at 17:33 -0500, R. Matthew Emerson wrote:
> > On Feb 16, 2010, at 2:18 PM, Jon S. Anthony wrote:
> > 
> > > Looking over some LAP functions and disassembling some user level lisp
> > > functions, my question(s) is what (or whether) there is any difference
> > > between the two approaches used in these for the X86 register toggle
> > > tagging between immediate/node indications.
> > > 
> > > In user level lisp, this typically seems to use btrl to reset bit
> > > indicating immediate and btsl to set bit indicating node.  For example:
> > > 
> > > 
> > >  [13]    (btrl ($ 1) (@ (% fs) 8)) ; indicate immo is immediate
> > >  [23]    (movl (@ -2 (% arg_z)) (% imm0)) ; load it up...
> > > ...
> > >  [46]    (btsl ($ 1) (@ (% fs) 8)) ; indicate immo is node
> > > 
> > > 
> > > This same thing in LAP functions where (mark-as-imm ...) and
> > > (mark-as-node ...) are used is:
> > > 
> > >          ;; (mark-as-imm immo)
> > >  [30]    (andb ($ 254) (@ (% fs) 8)) ; indicate immo is immediate
> > > ...
> > >          ;; (mark-as-node imm0)
> > >  [84]    (xorl (% imm0) (% imm0)) ; always there, but unclear about it
> > >  [86]    (orb ($ 1) (@ (% fs) 8)) ; indicate immo is node
> > > 
> > > Is there any real difference between these for the intended task?
> > 
> > They do the same thing (set/clear a bit in the node-regs-mask word stored in the TCR).
> > 
> > I'm not sure why they're different.  I like the btr/bts for clarity, though I think it may be the case that the btr/bts instructions are a byte longer than equivalent logical operations would be.  I think the lap macro uses logical operations because I had a sort of vague intention to make it support reclassifying the category of multiple registers at once, i.e., I thought that one might say
> > 
> > (mark-as-imm temp0 temp1)
> > ...
> > (mark-as-node temp0 temp1)
> > 
> > and have that expand to
> > 
> > (andb ($ 249) (@ (% fs) 8))
> > ...
> > (xorl (% temp0) (% temp0))
> > (xorl (% temp1) (% temp1))
> > (orb ($ 6) (@ (% fs) 8))
> > 
> > but I never got around to doing that.
> > 
> > 
> > 
> > 
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list