diff --git a/test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java b/test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java index cb0e94c9fe8..1fe05cc2b6c 100644 --- a/test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java +++ b/test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java @@ -274,6 +274,7 @@ public final class Operations { ops.add(Expression.make(BOOLEANS, "Boolean.logicalXor(", BOOLEANS, ", ", BOOLEANS, ")")); // TODO: Math and other classes. + // Note: Math.copySign is non-deterministic because of NaN having encoding with sign bit set and unset. // Make sure the list is not modifiable. return List.copyOf(ops); @@ -294,7 +295,8 @@ public final class Operations { ops.add(Expression.make(INTS, "Float16.compare(", FLOAT16, ",", FLOAT16, ")")); addComparisonOperations(ops, "Float16.compare", FLOAT16); ops.add(Expression.make(INTS, "(", FLOAT16, ").compareTo(", FLOAT16, ")")); - ops.add(Expression.make(FLOAT16, "Float16.copySign(", FLOAT16, ",", FLOAT16, ")")); + // Note: There are NaN encodings with bit set or unset. + ops.add(Expression.make(FLOAT16, "Float16.copySign(", FLOAT16, ",", FLOAT16, ")", WITH_NONDETERMINISTIC_RESULT)); ops.add(Expression.make(FLOAT16, "Float16.divide(", FLOAT16, ",", FLOAT16, ")")); ops.add(Expression.make(BOOLEANS, "", FLOAT16, ".equals(", FLOAT16, ")")); // Note: there are multiple NaN values with different bit representations.