Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80982 invoked from network); 17 Jul 2008 14:20:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2008 14:20:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.151.69.1 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.151.69.1 liberty.vosn.net Linux 2.4/2.6 Received: from [209.151.69.1] ([209.151.69.1:45255] helo=liberty.vosn.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/51-08057-7255F784 for ; Thu, 17 Jul 2008 10:20:24 -0400 Received: from d3-210.rb.ot.centurytel.net ([69.29.126.210]:64170 helo=pc1) by liberty.vosn.net with smtp (Exim 4.69) (envelope-from ) id 1KJULF-0007eN-7D for internals@lists.php.net; Thu, 17 Jul 2008 08:20:21 -0600 Message-ID: <012501c8e818$3f076ed0$0201a8c0@pc1> To: References: <008601c703ba$0a9f4940$0201a8c0@pc1> Date: Thu, 17 Jul 2008 09:20:18 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - liberty.vosn.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - realplain.com Subject: Re: [PHP-DEV] Optimization for ..._MULTIPLY_LONG on more systems From: php_lists@realplain.com ("Matt Wilmas") Hi all, Replying to this OLD message about the ZEND_SIGNED_MULTIPLY_LONG() change... It's just a small thing, but it's been on the TODO for a while, so I attempted to correct the issue with my original patch that used "long long" type, which wasn't available on the older MSVC versions, etc. I created a zend_long64 type (when possible, #if logic copied from snprintf.h's WIDE_INT definition), hopefully it's mostly correct/OK, and maybe it can be used elsewhere too. Since the new memory manager, ..._MULTIPLY_LONG() isn't used for safe_emalloc() anymore, so I made another safe_address() variation (overflow safe, I hope). I noticed ~0.6% slowdown on bench.php, though it seems this zend_ulong64 version should use fewer cycles than the doubles one for sure, if someone wants to analyze it more. :-) Finally, is it even possible to also have a Windows assembly version of these 2 things, where I left the comments? There is for zend_mm_[high|low]_bit(), but they're very simple... http://realplain.com/php/multiply_long.diff http://realplain.com/php/multiply_long_5_3.diff - Matt ----- Original Message ----- From: "Matt Wilmas" Sent: Wednesday, November 08, 2006 > Hi, > > Here's an additional ZEND_SIGNED_MULTIPLY_LONG() for platforms with 32-bit > longs that don't use the assembly version (so all Windows systems at > least?). On my Windows system, mul_function() is 40% faster with this > version (no overflow), which makes PHP's * operator 20% faster; with > overflow mul_function() is 20% faster (though I don't see any difference > with the * operator). The macro is also used in safe_emalloc()... > > Patch just against 5_2 as the file versions are the only difference. > > > Matt