[K/N] Fix of NaN normalization for arm64
This commit is contained in:
committed by
Space Team
parent
05cead2ab5
commit
ce38699dfa
+5
-2
@@ -1855,9 +1855,12 @@ internal class CodeGeneratorVisitor(
|
|||||||
*
|
*
|
||||||
* So for now, we would just normalize all NaN constants. At least this leads to predictable result
|
* So for now, we would just normalize all NaN constants. At least this leads to predictable result
|
||||||
* useful in almost all cases.
|
* useful in almost all cases.
|
||||||
|
*
|
||||||
|
* Also, java.lang classes are used here to avoid unexpected NaN values if a compiler and stdlib
|
||||||
|
* are built in an arm64 architecture environment.
|
||||||
*/
|
*/
|
||||||
private fun Float.normalizeNan() = if (isNaN()) Float.NaN else this
|
private fun Float.normalizeNan() = if (isNaN()) java.lang.Float.NaN else this
|
||||||
private fun Double.normalizeNan() = if (isNaN()) Double.NaN else this
|
private fun Double.normalizeNan() = if (isNaN()) java.lang.Double.NaN else this
|
||||||
|
|
||||||
private fun evaluateConst(value: IrConst<*>): ConstValue {
|
private fun evaluateConst(value: IrConst<*>): ConstValue {
|
||||||
context.log{"evaluateConst : ${ir2string(value)}"}
|
context.log{"evaluateConst : ${ir2string(value)}"}
|
||||||
|
|||||||
Reference in New Issue
Block a user