Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## [Sbcl-devel] Vectorizing, part II

 [Sbcl-devel] Vectorizing, part II From: Christophe Rhodes - 2001-10-25 13:52:16 Attachments: vector.lisp ```So, as threatened, here's a similarly half-baked file that begins the implementation of vectorizing perfectly good user code (for those latecomers to this, see "SSE instructions and vectorization" on the archives). I post this, much as I did the last, mostly to generate discussion and ask for comments ("That's an absolutely hideous idea." "You haven't done this with supported IR1 functions." and so on). The idea behind this twisty bit of logic is that we define a transform for map-into that sees if all its sequence arguments are vectors; if they are, and if it can find an inline expansion for the function it vectorizes this inline function, using the (proof-of-concept and highly inefficient) sb-vector::vector-foo functions. This can be tested by * starting a recent SBCL (0.pre7.73 is what I'm using; you may be able to get it to work with others...) * compiling and loading the attached lisp file * doing: (declaim (inline foo)) (defun foo (x y) (+ x y)) (defun bar (a b) (declare (vector a b)) (declare (optimize (inhibit-warnings 0))) (map-into a #'foo a b)) (disassemble 'bar) [ the inhibit-warnings is 0 in case you want to mess around with the declaration to see failure modes of the ir1 transform ] Comments? Cheers, Christophe -- Jesus College, Cambridge, CB5 8BL +44 1223 510 299 http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar (str schar arg) (first (last +))) (make-dispatch-macro-character #\! t) (set-dispatch-macro-character #\! #\\$ #'pling-dollar) ```

 [Sbcl-devel] Vectorizing, part II From: Christophe Rhodes - 2001-10-25 13:52:16 Attachments: vector.lisp ```So, as threatened, here's a similarly half-baked file that begins the implementation of vectorizing perfectly good user code (for those latecomers to this, see "SSE instructions and vectorization" on the archives). I post this, much as I did the last, mostly to generate discussion and ask for comments ("That's an absolutely hideous idea." "You haven't done this with supported IR1 functions." and so on). The idea behind this twisty bit of logic is that we define a transform for map-into that sees if all its sequence arguments are vectors; if they are, and if it can find an inline expansion for the function it vectorizes this inline function, using the (proof-of-concept and highly inefficient) sb-vector::vector-foo functions. This can be tested by * starting a recent SBCL (0.pre7.73 is what I'm using; you may be able to get it to work with others...) * compiling and loading the attached lisp file * doing: (declaim (inline foo)) (defun foo (x y) (+ x y)) (defun bar (a b) (declare (vector a b)) (declare (optimize (inhibit-warnings 0))) (map-into a #'foo a b)) (disassemble 'bar) [ the inhibit-warnings is 0 in case you want to mess around with the declaration to see failure modes of the ir1 transform ] Comments? Cheers, Christophe -- Jesus College, Cambridge, CB5 8BL +44 1223 510 299 http://www-jcsu.jesus.cam.ac.uk/~csr21/ (defun pling-dollar (str schar arg) (first (last +))) (make-dispatch-macro-character #\! t) (set-dispatch-macro-character #\! #\\$ #'pling-dollar) ```