From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add unboxed floating point comparison instructions. Date: Sun, 08 Jan 2017 23:06:26 +0100 Message-ID: <87bmvhcil9.fsf@pobox.com> References: <87lgvjgu2s.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87mvfpumfi.fsf@pobox.com> <87vaud7zrf.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1483913237 14006 195.159.176.226 (8 Jan 2017 22:07:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Jan 2017 22:07:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Mark H Weaver , guile-devel To: "Thompson\, David" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 08 23:07:13 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQLcG-0002H8-FZ for guile-devel@m.gmane.org; Sun, 08 Jan 2017 23:07:04 +0100 Original-Received: from localhost ([::1]:35334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQLcK-0006nB-Nl for guile-devel@m.gmane.org; Sun, 08 Jan 2017 17:07:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQLbt-0006lV-7U for guile-devel@gnu.org; Sun, 08 Jan 2017 17:06:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQLbq-0006Bt-2R for guile-devel@gnu.org; Sun, 08 Jan 2017 17:06:41 -0500 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:62168 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQLbp-0006BR-Rg for guile-devel@gnu.org; Sun, 08 Jan 2017 17:06:37 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id E7F9C55215; Sun, 8 Jan 2017 17:06:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=cv+P6HnP8/kqW38Q11DtQE4YrlA=; b=ILuCXC WNokzeFNnev3ZtmczHVA0i3eLK79JT05bqiWN/nvmID+dB0aqdVQmSSfQPG8Zj3W eTyTdKqBlEi0DgO2Zwbcg1y5ca98Fj9cdSpZv8+uFQH8Mpei0SNhkq+84Wv7RmVI EmPgR65j2bPqvAlXUY/75GHhgD2oe7gdtjq3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=cUKNkFwzerQErzkNl9WiSYXBaUoKkeMc M8a303y+GLLFOjO6pKwTZXGLonwyJt89mP36BUog+0gN3xEgwFLTYINXO4ENndck uDMwKMIDj0H6eknlDUuX7l2NNYbq4rkQdXHLx7sQOmapE2d9dI8qIPABMQK+DMYZ UBXJJq2J70o= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id DFC8555214; Sun, 8 Jan 2017 17:06:35 -0500 (EST) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 7367855213; Sun, 8 Jan 2017 17:06:34 -0500 (EST) In-Reply-To: (David Thompson's message of "Wed, 4 Jan 2017 20:41:42 -0500") X-Pobox-Relay-ID: B81B154C-D5EE-11E6-94C0-CDEC6462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18830 Archived-At: On Thu 05 Jan 2017 02:41, "Thompson, David" writes: > + VM_DEFINE_OP (189, br_if_f64_le, "br-if-f64-<=", OP3 (X8_S24, X8_S24, B1_X7_L24)) Missing inline docs. > + /* br-if-f64-> a:24 _:8 b:24 invert:1 _:7 offset:24 > + * > + * If the F64 value in A is > than the SCM value in B, add OFFSET, a > + * signed 24-bit number, to the current instruction pointer. The *F64* value in B. > @@ -283,6 +297,8 @@ BITS indicating the significant bits needed for a variable. BITS may be > (lambda (type min max) > (and (eqv? type &exact-integer) > (<= 0 min max #xffffffffffffffff)))))) > + (define (f64-operand? var) > + (operand-in-range? var &flonum -inf.0 +inf.0)) Here I think this should just be (eqv? type &flonum). > + ((u64-operand? a) > + (let ((specialize (if (u64-operand? b) > + specialize-u64-comparison > + specialize-u64-scm-comparison))) > + (with-cps cps > + (let$ body (specialize k kt src op a b)) > + (setk label ($kargs names vars ,body))))) Here probably we need to add (not-nan? b) to the condition -- but that is a preexisting bug of mine; this patch is fine. > --- a/module/language/cps/type-fold.scm > +++ b/module/language/cps/type-fold.scm > @@ -110,6 +110,7 @@ > (else (values #f #f)))) > (define-branch-folder-alias u64-< <) > (define-branch-folder-alias u64-<-scm <) > +(define-branch-folder-alias f64-< <) The branch folder for f64-< should always return #f because we (currently) can't prove that there are no nans involved. Please just remove this addition and that for <=, =, etc, and add a comment containing the tokens `f64-<' etc and mentioning the reason. Once these nits are fixed LGTM. Also please add the instructions to vm.texi. Thanks! Andy