From: Pip Cet <pipcet@gmail.com>
To: emacs-devel@gnu.org, Andrea Corallo <akrl@sdf.org>
Subject: Re: feature/native-comp 5bc0855 2/2: Don't treat '=' as simple equality emitting constraints (bug#46812)
Date: Tue, 2 Mar 2021 05:20:10 +0000 [thread overview]
Message-ID: <CAOqdjBfQM4-Hd9wbws52284J3bR=QmajW5UDZjmd6HY6Vmqpjg@mail.gmail.com> (raw)
In-Reply-To: <20210228230217.1971E20E1B@vcs0.savannah.gnu.org>
On Sun, Feb 28, 2021 at 11:02 PM Andrea Corallo <akrl@savannah.gnu.org> wrote:
> branch: feature/native-comp
> commit 5bc08559e8f171eafc3c034232f8cfd9eaf89862
> Author: Andrea Corallo <akrl@sdf.org>
> Commit: Andrea Corallo <akrl@sdf.org>
>
> Don't treat '=' as simple equality emitting constraints (bug#46812)
>
> Extend assumes allowing the following form
>
> (assume dst (= src1 src2))
>
> to caputure '=' semanting during fwprop handling float integer
> conversions.
>
> * lisp/emacs-lisp/comp.el (comp-equality-fun-p): Don't treat '=' as
> simple equality.
> (comp-arithm-cmp-fun-p, comp-negate-arithm-cmp-fun)
> (comp-reverse-arithm-fun): Rename and add '=' '!='.
> (comp-emit-assume, comp-add-cond-cstrs, comp-fwprop-insn): Update
> for new function nameing and to handle '='.
> * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): New function.
> * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a bunch
> of '=' specific tests.
> ---
> lisp/emacs-lisp/comp-cstr.el | 12 +++++++++++
> lisp/emacs-lisp/comp.el | 37 ++++++++++++++++++++--------------
> test/src/comp-tests.el | 47 ++++++++++++++++++++++++++++++++++++++------
> 3 files changed, 75 insertions(+), 21 deletions(-)
>
> diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
> index 89815f0..bd1e04f 100644
> --- a/lisp/emacs-lisp/comp-cstr.el
> +++ b/lisp/emacs-lisp/comp-cstr.el
> @@ -859,6 +859,18 @@ Non memoized version of `comp-cstr-intersection-no-mem'."
> (null (neg cstr))
> (equal (typeset cstr) '(cons)))))
>
> +(defun comp-cstr-= (dst old-dst src)
> + "Constraint DST being = SRC."
> + (with-comp-cstr-accessors
> + (comp-cstr-intersection dst old-dst src)
> + (cl-loop for v in (valset dst)
> + when (and (floatp v)
> + (= v (truncate v)))
> + do (push (cons (truncate v) (truncate v)) (range dst)))
> + (cl-loop for (l . h) in (range dst)
> + when (eql l h)
> + do (push (float l) (valset dst)))))
I'm not sure what this is supposed to do: first you form the
intersection of OLD-DST and SRC [often, empty]. Then you iterate over
the values and ranges of the [empty] intersection [leaving it empty].
It's not working either, as far as I can tell: (lambda (x) (and
(floatp x) (= x 0) x)) always returns nil when compiled.
Pip
next parent reply other threads:[~2021-03-02 5:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210228230215.15472.12941@vcs0.savannah.gnu.org>
[not found] ` <20210228230217.1971E20E1B@vcs0.savannah.gnu.org>
2021-03-02 5:20 ` Pip Cet [this message]
2021-03-02 13:47 ` feature/native-comp 5bc0855 2/2: Don't treat '=' as simple equality emitting constraints (bug#46812) Andrea Corallo via Emacs development discussions.
2021-03-02 14:16 ` Pip Cet
2021-03-02 14:30 ` Andrea Corallo via Emacs development discussions.
2021-03-02 17:14 ` Pip Cet
2021-03-04 7:36 ` Pip Cet
2021-03-04 7:58 ` Andrea Corallo via Emacs development discussions.
2021-03-06 22:18 ` Andrea Corallo via Emacs development discussions.
2021-03-07 7:03 ` Pip Cet
2021-03-07 7:07 ` Andrea Corallo via Emacs development discussions.
2021-03-07 7:13 ` Pip Cet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOqdjBfQM4-Hd9wbws52284J3bR=QmajW5UDZjmd6HY6Vmqpjg@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=akrl@sdf.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).