diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-09 20:05:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-09 20:05:23 +0900 |
| commit | 100012d2bebf99e79396e426132c7b7e0d432cf2 (patch) | |
| tree | 0876509f1f3f2ebf3283875caa7ebeb0cb44a7d3 /src/Execution | |
| parent | 0b4ee08d4fc54ef4533922a1cc47f53696c17981 (diff) | |
| download | php-waddiwasi-100012d2bebf99e79396e426132c7b7e0d432cf2.tar.gz php-waddiwasi-100012d2bebf99e79396e426132c7b7e0d432cf2.tar.zst php-waddiwasi-100012d2bebf99e79396e426132c7b7e0d432cf2.zip | |
fix: f32.convert_i(32|64)_(s|u)
Diffstat (limited to 'src/Execution')
| -rw-r--r-- | src/Execution/Runtime.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Execution/Runtime.php b/src/Execution/Runtime.php index e67921f..02c526c 100644 --- a/src/Execution/Runtime.php +++ b/src/Execution/Runtime.php @@ -592,25 +592,25 @@ final class Runtime private function execInstrNumericF32ConvertI32S(Instrs\Numeric\F32ConvertI32S $instr): void { $v = $this->stack->popInt(); - $this->stack->pushValue((float) $v); + $this->stack->pushValue(NumericOps::truncateF64ToF32((float) $v)); } private function execInstrNumericF32ConvertI32U(Instrs\Numeric\F32ConvertI32U $instr): void { - $v = $this->stack->popInt(); - $this->stack->pushValue((float) $v); + $v = NumericOps::convertS32ToU32($this->stack->popInt()); + $this->stack->pushValue(NumericOps::truncateF64ToF32((float) $v)); } private function execInstrNumericF32ConvertI64S(Instrs\Numeric\F32ConvertI64S $instr): void { $v = $this->stack->popInt(); - $this->stack->pushValue((float) $v); + $this->stack->pushValue(NumericOps::truncateF64ToF32((float) $v)); } private function execInstrNumericF32ConvertI64U(Instrs\Numeric\F32ConvertI64U $instr): void { $v = $this->stack->popInt(); - $this->stack->pushValue((float) $v); + $this->stack->pushValue(NumericOps::truncateF64ToF32((float) $v)); } private function execInstrNumericF32CopySign(Instrs\Numeric\F32CopySign $instr): void |
