mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 12:52:08 -08:00
C1NOT now optimizes C2 expressions directly
This commit is contained in:
parent
050ba3ba60
commit
aec68adfcc
1 changed files with 12 additions and 9 deletions
|
|
@ -26,15 +26,18 @@
|
|||
))
|
||||
|
||||
(defun c1not (args)
|
||||
(check-args-number 'NOT args 1)
|
||||
(let* ((value (first args))
|
||||
(f (c1fmla-constant value)))
|
||||
(if (or (eq f t) (eq f nil))
|
||||
(c1expr (not f))
|
||||
(let* ((value (c1expr (first args))))
|
||||
(make-c1form* 'FMLA-NOT
|
||||
:type '(member t nil)
|
||||
:args value)))))
|
||||
(check-args-number 'NOT args 1 1)
|
||||
(let* ((value (c1expr (first args))))
|
||||
;; When the argument is constant, we can just return
|
||||
;; a constant as well.
|
||||
(when (eq (c1form-name value) 'LOCATION)
|
||||
(let ((loc (c1form-arg 0 value)))
|
||||
(multiple-value-bind (constant-p value)
|
||||
(loc-immediate-value-p loc)
|
||||
(return-from c1not (c1expr (not value))))))
|
||||
(make-c1form* 'FMLA-NOT
|
||||
:type '(member t nil)
|
||||
:args value)))
|
||||
|
||||
(defun c1and (args)
|
||||
(let ((f (c1fmla-constant `(AND ,@args))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue