Why doesn't HotSpot use div machine code?
Christian.Thalinger at Sun.COM
Wed Jan 13 01:55:45 PST 2010
On Wed, 2009-12-23 at 22:01 +0100, Ulf Zibis wrote:
> Why doesn't HotSpot use div machine code?
> I guess this would be faster here.
Intel's div/idiv instructions have a very high latency and the latency
even varies with the input values, as you can see in Intels'
Optimization Reference Manual around page C-27.
Additionally a Java division (idiv) needs special treatment of corner
cases, as you can read in the JVM specification.
More information about the hotspot-compiler-dev