x86 Intrinsics for fma in Math Library

joe darcy joe.darcy at oracle.com
Wed Jul 20 20:29:50 UTC 2016

Hi Vladimir,

On 7/20/2016 1:08 PM, Vladimir Kozlov wrote:
> Hi Joe,
> Yes, the intrinsic (vfmadd231sd/ss asm instructions) are used in all 
> cases based on changes: Interpreter and C1,C2 compiled code.
> The only thing is worrying me is a constant folding (when all 
> arguments are constants) in C2 which uses libm fma() method (in 
> subnode.cpp):
> return TypeD::make(fma(d1, d2, d3));
> It may produce different result than vfmadd231sd instruction so I 
> would like to remove this optimization (leave only TOP checks).

Just to confirm that point, while customarily allowed in other 
languages/VMs, unless you knew it would not change the results, it would 
be against the JVM specification to replace a dmul + dadd sequence with 
an fma.



More information about the hotspot-compiler-dev mailing list