>>>>> "Jonathan" == Jonathan Simpson <[EMAIL PROTECTED]> writes:

    Jonathan> For instance:

    Jonathan> (defun foobar (v)
    Jonathan>   (declare (type vec4 v))
    Jonathan>   (make-vec4
    Jonathan>          :x (vec4-x v)
    Jonathan>          :y (vec4-y v)
    Jonathan>          :z (vec4-z v)
    Jonathan>          :w (vec4-w v)))

    Jonathan> gives 4 coercion notes, one for each arg to make-vec4.  However, your 

Because the function make-vec4 wants boxed floats.  Hence 4 notes.

    Jonathan> foo function compiles without any notes(except for the final return 
    Jonathan> value for foo). Why?  I can't seem to find a way to convince make-vec4 

Because the accessors were inlined and loaded the double-floats into
registers to do the computation.  Only the result needed to be boxed.

    Jonathan> that I'm passing double-floats and that it doesn't need to box the 
    Jonathan> arguments.

    Jonathan> If I pass constants, then I have no problems:

    Jonathan> (defun foobar2 (v)
    Jonathan>   (declare (type vec4 v))
    Jonathan>   (make-vec4
    Jonathan>          :x 0d0
    Jonathan>          :y 0d0
    Jonathan>          :z 0d0
    Jonathan>          :w 0d0))

Had to look at the disassembly for this.  What happens is 0d0 is boxed
up as part of the code.  Then this boxed up value is passed to
make-vec4.  Thus no additional boxing.

I bet there are no notes for this function:

(defun foobar3 (x y z w)
  (declare (double-float x y z w))
  (make-vec4 :x x :y y :z z :w w))

Why?  Because x, y, z, w are alread boxed, so the boxed value is
passed to make-vec4 directly.

Ray


-- 
Ericsson may automatically add a disclaimer.  Sorry, it's beyond my
control.


 

This communication is confidential and intended solely for the addressee(s). Any 
unauthorized review, use, disclosure or distribution is prohibited. If you believe 
this message has been sent to you in error, please notify the sender by replying to 
this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, 
unauthorized amendment, tampering and viruses, and we only send and receive e-mails on 
the basis that we are not liable for any such corruption, interception, amendment, 
tampering or viruses or any consequences thereof.

Reply via email to