overflows in SLDivNode

Chris Seaton chris.seaton at oracle.com
Mon Apr 27 17:34:47 UTC 2015


Someone writing a Truffle language may look at the ExactMath class, see no exactDivide, and conclude that integer division cannot overflow. Even if our implementation does not give performance gains, it might be good to have it there so that they don’t assume this.

Chris

> On 27 Apr 2015, at 15:17, Andreas Woess <andreas.woess at oracle.com> wrote:
> 
> However, I don't think we should add a divExact method. We cannot intrinsify it (the idiv instruction does not set the overflow flag); for the same reason Java 8 does not have a divideExact. Also, the utility method cannot specialize (whereas the SLDivNode can), so having it does not buy us anything.



More information about the graal-dev mailing list