You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defpackage:example
(:use:cl))
(in-package:example)
(declaim (ftype (function (floatfloat) float) foo1))
(defunfoo1 (a b)
(+ a b))
(defunfoo2 (a b)
(declare (typefloat a b))
(thefloat (+ a b)))
It feels like CCL has the same type information for FOO1 (using the global FTYPE declaration) and for FOO2 (using both the local TYPE declarations and the THE form for the return value). Yet the generated code is quite different.
What is CCL missing in FOO1 that leads to less compact generated code compared to FOO2? It seems to add an overflow check which is not present in FOO2.
The text was updated successfully, but these errors were encountered:
Given the following code:
CCL compiles
FOO1
to:And
FOO2
to:It feels like CCL has the same type information for
FOO1
(using the globalFTYPE
declaration) and forFOO2
(using both the localTYPE
declarations and theTHE
form for the return value). Yet the generated code is quite different.What is CCL missing in
FOO1
that leads to less compact generated code compared toFOO2
? It seems to add an overflow check which is not present inFOO2
.The text was updated successfully, but these errors were encountered: