Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 30525 invoked from network); 8 Oct 2008 06:20:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2008 06:20:05 -0000 Received: (qmail 67101 invoked by uid 500); 8 Oct 2008 06:20:04 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 67076 invoked by uid 500); 8 Oct 2008 06:20:03 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 67067 invoked by uid 99); 8 Oct 2008 06:20:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 23:20:03 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2008 06:19:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 60B1D234C21E for ; Tue, 7 Oct 2008 23:19:44 -0700 (PDT) Message-ID: <1754446375.1223446784395.JavaMail.jira@brutus> Date: Tue, 7 Oct 2008 23:19:44 -0700 (PDT) From: "Xiaoming Gu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-5901) [drlvm][jit]integer MUL, DIV and REM strength reduction In-Reply-To: <1649521792.1215499836450.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiaoming Gu updated HARMONY-5901: --------------------------------- Attachment: H5901-V8.patch This message is for V8 patch. 1. Turn on MUL strength reduction even in a simplify pass. It was only turned on in a latesimplify pass. 2. Only do MUL strength reduction for the following two cases. a) constant multiplier d is positive and less than 32 b) d is a power of 2 3. Some reductions for the above a) case are changed to another way to get improvement. The available MUL strength reduction in multiplybyconstant.cpp is too complex without any cost model. This version is conservative but guarantees reduction always brings improvement. I find a problem on register allocation in the testings (see https://issues.apache.org/jira/browse/HARMONY-5992), which makes hard to evaluate reductions. I'll fix that problem first then relax the conservative policy later. > [drlvm][jit]integer MUL, DIV and REM strength reduction > ------------------------------------------------------- > > Key: HARMONY-5901 > URL: https://issues.apache.org/jira/browse/HARMONY-5901 > Project: Harmony > Issue Type: Improvement > Components: DRLVM > Reporter: Xiaoming Gu > Attachments: 5901.patch, H5901-V2.patch, H5901-V3.patch, H5901-V4.patch, H5901-V5.patch, H5901-V6.patch, H5901-V7.patch, H5901-V8.patch > > > 1. Mulitiplication replacement > a. It's about integer multiplication. > b. One of two multipliers is a power of 2. > c. The power of 2 could be negative. > For example, 23*4 is transformed to 23<<2 and 23*(-4) is transformed to (23<<2)*(-1). > 2. Division replacement > a. It's about integer division. > b. The divisor is a power of 2. > c. The power of 2 could be negative. > d. Because of round-up difference between division and shift right, the following equations from Aleksey are used. > Baseline: q = a / (1 << d); > Optimized: q = (a + [(1 << d) - 1] & (a >> 31)) >> d; > For example, 23/4 is transformed to (23+((1<<2)-1)&(23>>31))>>2. and (-23)/(-4) is transformed to ((-23+((1<<2)-1)&(-23>>31))>>2)*(-1). > 3. Comments for SAR and SHR swapped > The comments for the two similar operations were misplaced in working_vm/vm/port/src/encoder/ia32_em64t. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.