aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-07 02:47:35 +0900
committernsfisis <nsfisis@gmail.com>2024-07-07 02:48:56 +0900
commit3d30b262fab3beeee738cc98d8862a012012c2a4 (patch)
tree6071564035e2230462139b8d3a995c0f5d972617
parente0614a8ba1206e28c78ee6ef587905390ea389de (diff)
downloadphp-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.tar.gz
php-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.tar.zst
php-waddiwasi-3d30b262fab3beeee738cc98d8862a012012c2a4.zip
test: F64Test passed
-rw-r--r--BUGS.txt2
-rw-r--r--src/Execution/Runtime.php6
2 files changed, 5 insertions, 3 deletions
diff --git a/BUGS.txt b/BUGS.txt
index f68e3fa..4b510bd 100644
--- a/BUGS.txt
+++ b/BUGS.txt
@@ -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