From e84a1a8531baf31b21347eaedc186202bef8ff03 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 25 Sep 2023 20:12:55 +0200 Subject: [PATCH] wasm: fix raw conversion of float and double to int and long --- .../org/teavm/backend/wasm/intrinsics/DoubleIntrinsic.java | 4 ++-- .../org/teavm/backend/wasm/intrinsics/FloatIntrinsic.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/intrinsics/DoubleIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/DoubleIntrinsic.java index b4d768ef2..8d5746d05 100644 --- a/core/src/main/java/org/teavm/backend/wasm/intrinsics/DoubleIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/DoubleIntrinsic.java @@ -48,7 +48,7 @@ public class DoubleIntrinsic implements WasmIntrinsic { case "isNaN": case "isInfinite": case "isFinite": - case "doubleToLongBits": + case "doubleToRawLongBits": case "longBitsToDouble": return true; default: @@ -74,7 +74,7 @@ public class DoubleIntrinsic implements WasmIntrinsic { new WasmInt32Constant(0)); return result; } - case "doubleToLongBits": { + case "doubleToRawLongBits": { WasmConversion conversion = new WasmConversion(WasmType.FLOAT64, WasmType.INT64, false, manager.generate(invocation.getArguments().get(0))); conversion.setReinterpret(true); diff --git a/core/src/main/java/org/teavm/backend/wasm/intrinsics/FloatIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/FloatIntrinsic.java index f897ec4f2..881556737 100644 --- a/core/src/main/java/org/teavm/backend/wasm/intrinsics/FloatIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/FloatIntrinsic.java @@ -47,7 +47,7 @@ public class FloatIntrinsic implements WasmIntrinsic { case "isNaN": case "isInfinite": case "isFinite": - case "floatToIntBits": + case "floatToRawIntBits": case "intBitsToFloat": return true; default: @@ -73,7 +73,7 @@ public class FloatIntrinsic implements WasmIntrinsic { new WasmInt32Constant(0)); return result; } - case "floatToIntBits": { + case "floatToRawIntBits": { WasmConversion conversion = new WasmConversion(WasmType.FLOAT32, WasmType.INT32, false, manager.generate(invocation.getArguments().get(0))); conversion.setReinterpret(true);