[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is there a declaration that will allow an inlined multiply?



No matter how many declarations I apply to the following function, I can't
get it to inline multiplication.  Is that just impossible?  I don't want to
have to resort to c++.

(defun sqr (x)
  (declare (optimize (speed 3) (space 0)
                     (safety 0) (debug 0)
                     (compilation-speed 0)))
  (declare (type (unsigned-byte 16) x)) (declare (inline *))
    (the (unsigned-byte 16)
      (* (the (unsigned-byte 16) x)
         (the (unsigned-byte 16) x))))

? (disassemble #'sqr)
0 (SPUSH VSP)
2 (VPUSH D0)
4 (MOVE.L @VSP D0)
6 (MOVE.L @VSP D1)
8 (SPOP VSP)
10 (JMP_SUBPRIM $SP-TIMES2)

Thanks,

--Rob.