[Openmcl-devel] Why does this "cheat"/"lie" not work?...

Jon S. Anthony j-anthony at comcast.net
Tue Feb 9 08:14:02 PST 2010


On Mon, 2010-02-08 at 20:44 -0500, R. Matthew Emerson wrote:

> We can do a little better:
> 
> ;;; using a slightly patched compiler
> 
> (defun copy-u32-vector (src dest)
>   (declare (type (simple-array (unsigned-byte 32)) src dest)
> 	   (optimize (speed 3) (safety 0)))
>   (dotimes (i (length dest))
>     (setf (aref dest i) (aref src i))))
> 
> ;;; (aref src i)
> L33
>   [33]    (movl (@ -4 (% ebp)) (% arg_y))
>   [36]    (movl (@ -16 (% ebp)) (% arg_z))
>   [39]    (movl (% arg_z) (% imm0))
>   [41]    (movl (@ -2 (% arg_y) (% imm0)) (% imm0))
> 
> ;;; (setf (aref dest i) (aref src i))
>   [45]    (movl (@ -16 (% ebp)) (% arg_y))
>   [48]    (movl (@ -8 (% ebp)) (% temp0))
>   [51]    (btrl ($ 2) (@ (% fs) 8))
>   [61]    (movl (% arg_y) (% temp1))
>   [63]    (movl (% imm0) (@ -2 (% temp0) (% temp1)))
>   [67]    (xorl (% temp1) (% temp1))
>   [69]    (btsl ($ 2) (@ (% fs) 8))
> 
> ;;; (dotimes (i (length dest)) (setf (aref dest i) (aref src i)))
>   [79]    (movl (@ -16 (% ebp)) (% arg_z))
>   [82]    (addl ($ 4) (% arg_z))
>   [85]    (movl (% arg_z) (@ -16 (% ebp)))
> L88
>   [88]    (movl (@ -16 (% ebp)) (% arg_y))
>   [91]    (movl (@ -12 (% ebp)) (% arg_z))
>   [94]    (cmpl (% arg_z) (% arg_y))
>   [96]    (jl L33)
> 
> There's a lot of stack traffic (can we have some registers here, please?), and we end up doing the mark-as-imm/mark-as-node dance on %temp1 within the loop, but it's less dreadful.
> 
> I'll clean these changes up and commit them soon.

Cool - thanks!

/Jon





More information about the Openmcl-devel mailing list