harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5901) replace integer multiplication or division with shift if one of multipliers or divisor is a power of 2
Date Tue, 08 Jul 2008 14:34:34 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aleksey Shipilev updated HARMONY-5901:
--------------------------------------

    Attachment: H5901-V2.patch

H5901-V2.patch
 - Reformatted and reformulated patch.
 - Fixes bug with the remainder calculation (falls back to IDIV generation)
 

Still generates faulty MulOps:
 $ ../../builds/shade.1/bin/java -Xem:opt spectralnorm_long 100 100 100
Uncaught exception in main:
java.lang.ExceptionInInitializerError
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at com.ibm.icu.impl.ICUResourceBundle.getInt(ICUResourceBundle.java:1031)
        at com.ibm.icu.impl.ICUResourceBundle.getStringValue(ICUResourceBundle.java:1047)
        at com.ibm.icu.impl.ICUResourceBundleImpl$ResourceString.<init>(ICUResourceBundleImpl.java:122)
        at com.ibm.icu.impl.ICUResourceBundle.createBundleObject(ICUResourceBundle.java)
        at com.ibm.icu.impl.ICUResourceBundleImpl$ResourceArray.handleGet(ICUResourceBundleImpl.java:58)
        at com.ibm.icu.util.UResourceBundle.get(UResourceBundle.java)
        at com.ibm.icu.util.UResourceBundleIterator.next(UResourceBundleIterator.java)
        at com.ibm.icu.impl.ICUResourceBundleImpl$ResourceArray.handleGetStringArray(ICUResourceBundleImpl.java)
        at com.ibm.icu.util.UResourceBundle.resolveObject(UResourceBundle.java)
        at com.ibm.icu.util.UResourceBundle.handleGetObjectImpl(UResourceBundle.java:1007)
        at com.ibm.icu.util.UResourceBundle.handleGetObjectImpl(UResourceBundle.java:1011)
        at com.ibm.icu.util.UResourceBundle.handleGetObject(UResourceBundle.java:994)
        at java.util.ResourceBundle.getObject(ResourceBundle.java)
        at java.util.ResourceBundle.getStringArray(ResourceBundle.java:235)
        at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java)
        at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:59)
        at java.text.DecimalFormat.<init>(DecimalFormat.java)
        at spectralnorm_long.<clinit>(spectralnorm_long.java:16)
FAILED to invoke JVM.

> replace integer multiplication or division with shift if one of multipliers or divisor
is a power of 2
> ------------------------------------------------------------------------------------------------------
>
>                 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
>
>
> 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.


Mime
View raw message