diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-07 02:47:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-07 02:48:56 +0900 |
| commit | 3d30b262fab3beeee738cc98d8862a012012c2a4 (patch) | |
| tree | 6071564035e2230462139b8d3a995c0f5d972617 | |
| parent | e0614a8ba1206e28c78ee6ef587905390ea389de (diff) | |
| download | php-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.tar.gz php-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.tar.zst php-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.zip | |
test: F64Test passed
| -rw-r--r-- | BUGS.txt | 2 | ||||
| -rw-r--r-- | src/Execution/Runtime.php | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -2,7 +2,6 @@ ## Numeric -* F64Test * F64BitwiseTest * F32BitwiseTest * ConversionsTest @@ -10,7 +9,6 @@ * FloatLiteralsTest * FloatMemoryTest * FloatMiscTest -* LoopTest * TrapsTest ## Spectest diff --git a/src/Execution/Runtime.php b/src/Execution/Runtime.php index a261a3f..10bed7c 100644 --- a/src/Execution/Runtime.php +++ b/src/Execution/Runtime.php @@ -928,7 +928,11 @@ final class Runtime private function execInstrNumericF64Trunc(Instrs\Numeric\F64Trunc $instr): void { $v = $this->stack->popFloat(); - $this->stack->pushValue((float) (int) $v); + if ($v < 0) { + $this->stack->pushValue(ceil($v)); + } else { + $this->stack->pushValue(floor($v)); + } } private function execInstrNumericI32Add(Instrs\Numeric\I32Add $instr): void |
