Optimize CHAR-EQUAL on constant and base-char args.
authorStas Boukarev <stassats@gmail.com>
Thu, 5 Sep 2013 19:29:51 +0000 (23:29 +0400)
committerStas Boukarev <stassats@gmail.com>
Thu, 5 Sep 2013 19:29:51 +0000 (23:29 +0400)
commit7a2ee8c1aff0bdd286cf5d43ab40bff7fed86bea
tree7744f01da395b60e01305d5cf59c43339507cffe
parentd01d509257052e694365b76be5ab597fa06764ec
Optimize CHAR-EQUAL on constant and base-char args.

The open-code transform for base-char arguments was never invoked, it
should have been defined on TWO-ARG-CHAR-EQUAL, not CHAR-EQUAL. And
enable it only for (> speed space).

Add a check for base-char into the TWO-ARG-CHAR-EQUAL function, and
invoke the optimized code, the same the transform uses.

Optimize (char-equal #\c x) by transforming it into a call to
(char-equal-constant x #\c #\C), which does
(or (char= #\c char) (char= #\C char)), or directly to that expression
with (> speed space).

(char-equal #\- x) is transformed to (char= #\- x).
NEWS
package-data-list.lisp-expr
src/code/target-char.lisp
src/compiler/fndb.lisp
src/compiler/srctran.lisp
tests/compiler.pure.lisp