WASM: Don't use intrinsics to specify NaN's
This commit is contained in:
committed by
teamcityserver
parent
4ffed54f76
commit
5db8ec6551
@@ -70,8 +70,6 @@ class WasmSymbols(
|
|||||||
get() = TODO()
|
get() = TODO()
|
||||||
|
|
||||||
val wasmUnreachable = getInternalFunction("wasm_unreachable")
|
val wasmUnreachable = getInternalFunction("wasm_unreachable")
|
||||||
val wasmFloatNaN = getInternalFunction("wasm_float_nan")
|
|
||||||
val wasmDoubleNaN = getInternalFunction("wasm_double_nan")
|
|
||||||
|
|
||||||
val equalityFunctions = mapOf(
|
val equalityFunctions = mapOf(
|
||||||
context.irBuiltIns.booleanType to getInternalFunction("wasm_i32_eq"),
|
context.irBuiltIns.booleanType to getInternalFunction("wasm_i32_eq"),
|
||||||
|
|||||||
-7
@@ -284,13 +284,6 @@ class BodyGenerator(val context: WasmFunctionCodegenContext) : IrElementVisitorV
|
|||||||
body.buildRefCast()
|
body.buildRefCast()
|
||||||
}
|
}
|
||||||
|
|
||||||
wasmSymbols.wasmFloatNaN -> {
|
|
||||||
body.buildConstF32(Float.NaN)
|
|
||||||
}
|
|
||||||
wasmSymbols.wasmDoubleNaN -> {
|
|
||||||
body.buildConstF64(Double.NaN)
|
|
||||||
}
|
|
||||||
|
|
||||||
wasmSymbols.unboxIntrinsic -> {
|
wasmSymbols.unboxIntrinsic -> {
|
||||||
val fromType = call.getTypeArgument(0)!!
|
val fromType = call.getTypeArgument(0)!!
|
||||||
|
|
||||||
|
|||||||
@@ -1491,9 +1491,8 @@ public class Float private constructor(public val value: Float) : Number(), Comp
|
|||||||
/**
|
/**
|
||||||
* A constant holding the "not a number" value of Float.
|
* A constant holding the "not a number" value of Float.
|
||||||
*/
|
*/
|
||||||
public val NaN: Float
|
@Suppress("DIVISION_BY_ZERO")
|
||||||
get() =
|
public val NaN: Float = 0.0f / 0.0f
|
||||||
wasm_float_nan()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1800,10 +1799,8 @@ public class Double private constructor(public val value: Double) : Number(), Co
|
|||||||
/**
|
/**
|
||||||
* A constant holding the "not a number" value of Double.
|
* A constant holding the "not a number" value of Double.
|
||||||
*/
|
*/
|
||||||
public val NaN: Double
|
@Suppress("DIVISION_BY_ZERO")
|
||||||
get() =
|
public val NaN: Double = 0.0 / 0.0
|
||||||
wasm_double_nan()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,12 +13,6 @@ package kotlin.wasm.internal
|
|||||||
internal fun wasm_unreachable(): Nothing =
|
internal fun wasm_unreachable(): Nothing =
|
||||||
implementedAsIntrinsic
|
implementedAsIntrinsic
|
||||||
|
|
||||||
internal fun wasm_float_nan(): Float =
|
|
||||||
implementedAsIntrinsic
|
|
||||||
|
|
||||||
internal fun wasm_double_nan(): Double =
|
|
||||||
implementedAsIntrinsic
|
|
||||||
|
|
||||||
internal fun <To> wasm_ref_cast(a: Any?): To =
|
internal fun <To> wasm_ref_cast(a: Any?): To =
|
||||||
implementedAsIntrinsic
|
implementedAsIntrinsic
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user