[aarch64-port-dev ] simulator: multiplication/divsion for LONG/INT_MIN and -1

Andrew Haley aph at redhat.com
Sun Apr 27 08:51:49 UTC 2014


On 04/26/2014 07:03 PM, D.Sturm wrote:
> The simulator does not correctly handle multiplications/divisions in the
> case where we have the smallest negative value and -1. This is undefined in
> C/C++ anyhow, but works correctly for me in the case of multiplication
> (INT_MIN * -1 == INT_MIN), and is actually guaranteed to work for the int
> division due to the way the code is written but causes an arithmetic
> exception for LONG_MIN / -1 under Linux Mint 16 gcc 4.8.1.

I'm a bit mystified by the problem with multiplication.  Can you
tell me what error you got?

> That exception is caught by the signal handler in the JVM and then
> correctly handled there in most situations - I ran into some throwing
> assertion when it was simulating graal code but haven't looked further into
> it.
> 
> The following patch should take care of this. The smulh instruction uses
> inline assembly but I think x86 does the right thing(TM) there.

Have you got a http://sourceforge.net account?  Then you can check stuff in.

Andrew.



More information about the aarch64-port-dev mailing list