-
Bug
-
Resolution: Fixed
-
P4
-
11, 15
-
b11
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8262770 | 16.0.2 | Joe Darcy | P4 | Resolved | Fixed | b01 |
JDK-8262418 | 16.0.1 | Joe Darcy | P4 | Resolved | Fixed | b07 |
JDK-8263858 | 13.0.7 | Ekaterina Vergizova | P4 | Resolved | Fixed | b04 |
JDK-8262722 | 11.0.12-oracle | Dukebot | P4 | Resolved | Fixed | b01 |
JDK-8263419 | 11.0.12 | Joe Darcy | P4 | Resolved | Fixed | b01 |
JDK-8262510 | 11.0.11-oracle | Ravi Reddy | P4 | Resolved | Fixed | b07 |
JDK-8263079 | 11.0.11 | Joe Darcy | P4 | Resolved | Fixed | b06 |
Ubuntu 18.04 on x86_64
$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
I found Math.fma(float, float, float) method returned different values with or without -XX:-UseFMA VM option for the same inputs.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Save the code as FMAExample.java
2. Run `javac FMAExample.java`
3. Run `java -XX:-UseFMA FMAExample`
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Step 3 prints out 0x1.000002p52
ACTUAL -
Step 3 printed out 0x1.000004p52
---------- BEGIN SOURCE ----------
public class FMAExample {
public static void main(String[] args) {
float a = 0x1.fffffep23f;
float b = 0x1.000004p28f;
float c = 0x1.fep5f;
// The below line prints out different values for +/-UseFMA option.
// -XX:+UseFMA: 0x1.000002p52
// -XX:-UseFMA: 0x1.000004p52
System.out.printf("%a\n", Math.fma(a, b, c));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Do not specify `java -XX:-UseFMA FMAExample`
- backported by
-
JDK-8262418 Double-rounding possibility in float fma
- Resolved
-
JDK-8262510 Double-rounding possibility in float fma
- Resolved
-
JDK-8262722 Double-rounding possibility in float fma
- Resolved
-
JDK-8262770 Double-rounding possibility in float fma
- Resolved
-
JDK-8263079 Double-rounding possibility in float fma
- Resolved
-
JDK-8263419 Double-rounding possibility in float fma
- Resolved
-
JDK-8263858 Double-rounding possibility in float fma
- Resolved
- relates to
-
JDK-4851642 Add fused multiply add to Java math library
- Closed
- links to
-
Commit openjdk/jdk13u-dev/17c982e3
-
Commit openjdk/jdk16u/b7470f48
-
Commit openjdk/jdk/e5304b3a
-
Review openjdk/jdk13u-dev/154
-
Review openjdk/jdk16u/44
-
Review openjdk/jdk/2684