summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/instruction/1793119
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:15 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:28 +0200
commit5aa276efcbd67f4300ca1a7f809c6e00aadb03da (patch)
tree9b8f0e074014cda8d42f5a97a95bc25082d8b764 /results/classifier/zero-shot-user-mode/instruction/1793119
parent1a3c4faf4e0a25ed0b86e8739d5319a634cb9112 (diff)
downloademulator-bug-study-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.tar.gz
emulator-bug-study-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.zip
restructure results
Diffstat (limited to 'results/classifier/zero-shot-user-mode/instruction/1793119')
-rw-r--r--results/classifier/zero-shot-user-mode/instruction/179311935
1 files changed, 35 insertions, 0 deletions
diff --git a/results/classifier/zero-shot-user-mode/instruction/1793119 b/results/classifier/zero-shot-user-mode/instruction/1793119
new file mode 100644
index 00000000..21c94519
--- /dev/null
+++ b/results/classifier/zero-shot-user-mode/instruction/1793119
@@ -0,0 +1,35 @@
+instruction: 0.666
+runtime: 0.168
+syscall: 0.167
+
+
+
+Wrong floating-point emulation on AArch64 with FPCR set to zero
+
+On AArch64, with FPCR set to Zero (i.e., FPU set to IEEE-754 compliant mode), floating-point emulation does not produce the same results as real hardware (e.g., Raspberry Pi 3 with AArch64 Linux).
+
+I attached a sample that reproduces the issue. It divides `x` by `y` and puts the result in `r`. The expected result of the operation is `q`.
+
+Output on real hardware:
+=========================================================
+fpcr = 0x07000000.
+x = 0x03250f416dcdc6d0. y = 0x00029f4e5837c977. r = 0x7ff0000000000000. q = 0x43300fde9cbcf023.
+fpcr = 0x00000000.
+x = 0x03250f416dcdc6d0. y = 0x00029f4e5837c977. r = 0x43300fde9cbcf023. q = 0x43300fde9cbcf023.
+=========================================================
+
+Notice that after setting FPCR to zero, `r` equals `q`.
+
+Output on qemu 3.0.0 (Linux user-mode emulation):
+=========================================================
+fpcr = 0x07000000.
+x = 0x03250f416dcdc6d0. y = 0x00029f4e5837c977. r = 0x7ff0000000000000. q = 0x43300fde9cbcf023.
+fpcr = 0x00000000.
+x = 0x03250f416dcdc6d0. y = 0x00029f4e5837c977. r = 0x43300fde9cbcf024. q = 0x43300fde9cbcf023.
+=========================================================
+
+Notice that after setting FPCR to zero, `r` is not equal to `q`.
+
+Also notice that, using another proprietary operating system, the same issue arises between a real board and QEMU. This might be an issue in emulation of the AArch64 instruction "fdiv".
+
+Build command line: aarch64-linux-gnu-gcc -static -O0 -o sample1 sample1.c
\ No newline at end of file