wasm: fix raw conversion of float and double to int and long

This commit is contained in:
Alexey Andreev 2023-09-25 20:12:55 +02:00
parent de25cee3b8
commit e84a1a8531
2 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ public class DoubleIntrinsic implements WasmIntrinsic {
case "isNaN": case "isNaN":
case "isInfinite": case "isInfinite":
case "isFinite": case "isFinite":
case "doubleToLongBits": case "doubleToRawLongBits":
case "longBitsToDouble": case "longBitsToDouble":
return true; return true;
default: default:
@ -74,7 +74,7 @@ public class DoubleIntrinsic implements WasmIntrinsic {
new WasmInt32Constant(0)); new WasmInt32Constant(0));
return result; return result;
} }
case "doubleToLongBits": { case "doubleToRawLongBits": {
WasmConversion conversion = new WasmConversion(WasmType.FLOAT64, WasmType.INT64, false, WasmConversion conversion = new WasmConversion(WasmType.FLOAT64, WasmType.INT64, false,
manager.generate(invocation.getArguments().get(0))); manager.generate(invocation.getArguments().get(0)));
conversion.setReinterpret(true); conversion.setReinterpret(true);

View File

@ -47,7 +47,7 @@ public class FloatIntrinsic implements WasmIntrinsic {
case "isNaN": case "isNaN":
case "isInfinite": case "isInfinite":
case "isFinite": case "isFinite":
case "floatToIntBits": case "floatToRawIntBits":
case "intBitsToFloat": case "intBitsToFloat":
return true; return true;
default: default:
@ -73,7 +73,7 @@ public class FloatIntrinsic implements WasmIntrinsic {
new WasmInt32Constant(0)); new WasmInt32Constant(0));
return result; return result;
} }
case "floatToIntBits": { case "floatToRawIntBits": {
WasmConversion conversion = new WasmConversion(WasmType.FLOAT32, WasmType.INT32, false, WasmConversion conversion = new WasmConversion(WasmType.FLOAT32, WasmType.INT32, false,
manager.generate(invocation.getArguments().get(0))); manager.generate(invocation.getArguments().get(0)));
conversion.setReinterpret(true); conversion.setReinterpret(true);