[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there a declaration that will allow an inlined multiply?
- To: firstname.lastname@example.org
- Subject: Is there a declaration that will allow an inlined multiply?
- From: email@example.com (Rob Browning)
- Date: Sat, 4 Mar 1995 15:27:41 -0600
- Sender: firstname.lastname@example.org
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)
(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)