@@ -274,6 +274,7 @@ private static List<Expression> generatePrimitiveOperations() {
274274 ops .add (Expression .make (BOOLEANS , "Boolean.logicalXor(" , BOOLEANS , ", " , BOOLEANS , ")" ));
275275
276276 // TODO: Math and other classes.
277+ // Note: Math.copySign is non-deterministic because of NaN having encoding with sign bit set and unset.
277278
278279 // Make sure the list is not modifiable.
279280 return List .copyOf (ops );
@@ -294,7 +295,8 @@ private static List<Expression> generateFloat16Operations() {
294295 ops .add (Expression .make (INTS , "Float16.compare(" , FLOAT16 , "," , FLOAT16 , ")" ));
295296 addComparisonOperations (ops , "Float16.compare" , FLOAT16 );
296297 ops .add (Expression .make (INTS , "(" , FLOAT16 , ").compareTo(" , FLOAT16 , ")" ));
297- ops .add (Expression .make (FLOAT16 , "Float16.copySign(" , FLOAT16 , "," , FLOAT16 , ")" ));
298+ // Note: There are NaN encodings with bit set or unset.
299+ ops .add (Expression .make (FLOAT16 , "Float16.copySign(" , FLOAT16 , "," , FLOAT16 , ")" , WITH_NONDETERMINISTIC_RESULT ));
298300 ops .add (Expression .make (FLOAT16 , "Float16.divide(" , FLOAT16 , "," , FLOAT16 , ")" ));
299301 ops .add (Expression .make (BOOLEANS , "" , FLOAT16 , ".equals(" , FLOAT16 , ")" ));
300302 // Note: there are multiple NaN values with different bit representations.
0 commit comments