[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Array Register Analog in MCL?
- To: slh@digitool.com (Steve Hain)
- Subject: Re: Array Register Analog in MCL?
- From: JCMA@ai.mit.edu (John C. Mallery)
- Date: Sun, 14 May 1995 00:00:47 -0400
- Cc: info-mcl@digitool.com
- Sender: owner-info-mcl@digitool.com
At 9:38 PM 5/13/95, Steve Hain wrote:
>At 8:12 PM 5/13/95, John C. Mallery wrote:
>>Is there something in MCL that is analogous to array registers on the Lisp
>>Machine?
>>
>>What is needed is a aref that works on one dimensional arrays and does not
>>perform
>>bounds each reference. This provides an optimization when the calling
>>code has
>>already determined the array length.
>
>How about this:
>
>(defmacro fast-aref (array index)
> `(locally
> (declare (optimize (speed 3) (safety 0)))
> (svref ,array ,index)))
>
>which compiles to 12 bytes of 68000 assembly code:
>
>Fast enough for ya?
Fast enough, but I need to get reaonsable lisp types out so that they could
be reinserted, for example, with setf aref.
This returns objects like #<Unprintable CCL::IMMEDIATE : #x666F6F6F>
I can get in trouble if I try to stuff these into, for example, strings.
I'm primarily concerned with fast string hacking at this time.
Is there a way to get the returned object converted into the relevant lisp type?
If we can settle on the right fast-aref, it might be worth adding the
array-registers
declaration to MCL so that the compiler can do the work rather than a user
macro.