Wow, thanks a ton! That really helped.


On Sat, Aug 16, 2014 at 11:07 PM, Paul Khuong <pvk@pvk.ca> wrote:
Gautam Goel wrote:
I'm trying to figure what's going on in this blogpost on SSE intrinsics
in SBCL:

http://www.pvk.ca/Blog/2013/06/05/fresh-in-sbcl-1-dot-1-8-sse-intrinsics/

The author, Dr. Khuong, uses VOPs a lot to tell SBCL how to use the SIMD
instructions. But I haven't been able to find much info how one goes
about using VOPs in SBCL. Is there any documentation on VOPs available
online? I'm particularly interested in understanding all the possible
keyword parameters to define-vop.

The first step should be to M-. on define-vop.  That'll lead you to a form in src/compiler/meta-vmdef.lisp preceded by a detailed comment block:

;;; Define the symbol NAME to be a Virtual OPeration in the compiler.
;;; If specified, INHERITS is the name of a VOP that we default
;;; unspecified information from. Each SPEC is a list beginning with a
;;; keyword indicating the interpretation of the other forms in the
;;; SPEC:
;;;
;;; :ARGS {(Name {Key Value}*)}*
;;; :RESULTS {(Name {Key Value}*)}*
[...]

Alastair Bridgewater documented lifetime specs, a feature with spectacularly scalable hairiness, in http://www.lisphacker.com/codex/001-sbcl-vops.txt (the server seems to be down for the moment).

For simple use cases, I think http://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ covers (barely) enough to get going and move on to using VOPs in interesting code.

Paul Khuong



--
Cheers,

Gautam C. Goel