Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66008 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87008 invoked from network); 19 Feb 2013 23:53:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 23:53:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:52752] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/45-61103-57014215 for ; Tue, 19 Feb 2013 18:53:26 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 67DEF70003D4; Tue, 19 Feb 2013 23:53:22 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id HD-biyPl6Wib; Tue, 19 Feb 2013 23:53:22 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 2B39370003CC; Tue, 19 Feb 2013 23:53:22 +0000 (WET) Received: from damnation.nl.lo.geleia.net (unknown [IPv6:2001:470:94a2:4:21d:baff:feee:cc0b]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 3108C200CB57; Tue, 19 Feb 2013 23:53:20 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Stas Malyshev" Cc: "PHP Internals" References: <511666DE.8080809@fedoraproject.org> <51172819.4000806@sugarcrm.com> <51174790.8040805@fedoraproject.org> <511751C5.1020906@fedoraproject.org> <51175BDD.9040705@sugarcrm.com> <5117BA92.8080307@fedoraproject.org> <511890AC.7080506@fedoraproject.org> <51189847.5030506@sugarcrm.com> <5122DE69.3080901@sugarcrm.com> Date: Wed, 20 Feb 2013 00:53:17 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: <5122DE69.3080901@sugarcrm.com> User-Agent: Opera Mail/12.12 (Linux) Subject: Re: [PHP-DEV] double val to long val conversion issue From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Tue, 19 Feb 2013 03:07:37 +0100, Stas Malyshev wrote: >> If no one objects, I'll merge this into 5.5 and master: >> >> https://github.com/cataphract/php-src/compare/dval_to_lval > > Maybe add UNEXPECTED around the if condition? Since it's marked as > zend_always_inline I imagine it's supposed to be performance-sensitive... I can add that. > Also, skip comments in tests seem to be wrong: > > +if (PHP_INT_SIZE != 4) > 6 > + die("skip for machines with 32-bit longs"); > > But actually it skips for longs NOT being 32-bit. Same with other test. run-tests.php strips off the skip and shows only "for machines with 32-bit". The "skip" is necessary for the test to be skipped. > Also, I'm not sure I understand what 64-bit test is supposed to return > and why - why negative number is converted to positive one? What exactly > this change is supposed to improve? The least significant bytes are preserved. Take int(-2056257536) and int(2943463994971652096): In[6]:= BitAnd[2^32 - 1, {-2056257536, 2943463994971652096}] Out[6]= {2238709760, 2238709760} -- Gustavo Lopes