On Mon, Jan 29, 2001 at 06:59:37AM +0000, Daniel Barlow wrote:
> vector-t-p seems to be new since 0.6.5, and relies on the existence
> of complex-vector-p
Yes, it is new. From my notes in NEWS:
* There is now a primitive type predicate VECTOR-T-P
to test for the (VECTOR T) type, so that e.g.
(DEFUN FOO (V) (DECLARE (TYPE (VECTOR T) V)) (AREF V 3))
can now be compiled with some semblance of efficiency. (The old code
turned the type declaration into a full call to %TYPEP at runtime!)
(A minor crusade of mine has been to make non-simple vectors work
without insane amounts of overhead. IMHO the original CMU CL code had
unusable performance on adjustable vectors; and for the applications
I've been working on, if Common Lisp's sequence functions aren't
usable on vectors with FILL-POINTERs, I might as well just give up and
switch to C++/STL right now.)
> On the x86 there's a line in type-vops.lisp:
> (def-type-vops complex-vector-p check-complex-vector nil
> object-not-complex-vector-error complex-vector-type)
> which obviously doesn't exist in the Alpha backend that I stole from
> cmucl. But I can't see any other stuff in there that's relevant - how
> does it actually _know_ how to check if something is a complex vector?
> Or if I just add the relevant line to type-vops on the Alpha, will it
> all start magically working?
If there's a DEF-TYPE-VOPS macro on the Alpha, check to make sure that
it means the same thing as on the X86. If so, then yes, I think adding
the definition will make everything magically start working. Unless
I've gotten all confused somehow -- happens sometimes! -- the type vop
there just defines something which checks for the COMPLEX-VECTOR-TYPE
If instead it turns out to be very complicated on the Alpha, it should
be OK to temporarily suppress stuff related to the new vop while you
get the rest of your port working. Without the VOP, the problem is
that you can end up with full calls to TYPEP, but although that's
breathtakingly inefficient, it does work.
(Actually, looking at this now, I think I overlooked something:
perhaps I should have defined DEFERR OBJECT-NOT-COMPLEX-VECTOR-ERROR.
I didn't. I'll have to look to see whether it's possible for this
actually to be called. Even if for some reason it doesn't need a
definition, it deserves an explanatory comment.)
> In other news, I've been fiddling with the lowlevel trap stuff
> (interrupt.c and the rest) on the alpha lately, and found out that it
> seems to be basically an accident that the CMUCL alpha/linux port
> works at all ...
[..much stuff that I can't understand in any detail at this point, but
sounds in broad outline like the kind of thing that one tends to discover
inside CMU CL/SBCL when one goes looking..]
> My alpha architecture manual is in the post, Amazon tell me ...
I'm rather impressed that you can do all this stuff without the manual!
> The informational content in this message is also making its way into
> comments in the source code.
William Harold Newman <william.newman@...>
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C