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] Commented: (HARMONY-5826) [drlvm][jit][opt][performance] Magic for java.math.Multiplication.unsignedMultAdd2
Date Wed, 14 May 2008 12:53:55 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596749#action_12596749
] 

Aleksey Shipilev commented on HARMONY-5826:
-------------------------------------------

The thing here is: method performs fast multiplication of "unsigned int"s. 

------ "C": -------
unsigned int a, b, c, d;
long result;

result = a * b + c + d;

------ "Java": -------
int a, b, c, d;
result = (a & ffffffffL) * (b & ffffffffL)  + (c & ffffffffL) + (d & ffffffffL)


------ ASM: -------
mov eax, a
mul eax, eax, b
add eax, c
adc edx, 0
add eax, d
adc edx, 0
mov resLo, eax
mov resHi, edx

That is, we need to perform zero expansion if doing such thing in Java, while we can avoid
that in native code.
Can HLO simplifier or peephole detect that result is long and eliminate such "zero expansion"?


> [drlvm][jit][opt][performance] Magic for java.math.Multiplication.unsignedMultAdd2
> ----------------------------------------------------------------------------------
>
>                 Key: HARMONY-5826
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5826
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Shipilev
>         Attachments: vm-jit-math-unsignedMultAdd2-magic-rc1.patch
>
>
> Implementation of magic for java.math.Multiplication.unsignedMultAdd2, extracted in HARMONY-5825.

-- 
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