summary refs log tree commit diff stats
path: root/results/classifier/108/other/1728325
diff options
context:
space:
mode:
Diffstat (limited to 'results/classifier/108/other/1728325')
-rw-r--r--results/classifier/108/other/172832592
1 files changed, 92 insertions, 0 deletions
diff --git a/results/classifier/108/other/1728325 b/results/classifier/108/other/1728325
new file mode 100644
index 000000000..b70574289
--- /dev/null
+++ b/results/classifier/108/other/1728325
@@ -0,0 +1,92 @@
+other: 0.728
+graphic: 0.704
+device: 0.695
+performance: 0.686
+PID: 0.632
+vnc: 0.596
+debug: 0.589
+semantic: 0.587
+permissions: 0.583
+files: 0.577
+network: 0.477
+boot: 0.464
+socket: 0.462
+KVM: 0.246
+
+POWER8: Wrong behaviour with float-to-int punning
+
+Building a reduced test program with 'gcc -O2 -fno-inline -mcpu=power8' produces wrong results at runtime. I don't think gcc is at fault here.
+
+---
+#include <stdio.h>
+
+int getWord(const float x)
+{
+  return *(int*)&x;
+}
+
+void main()
+{
+    int foo = getWord(+123.456f);
+    int bar = getWord(-123.456f);
+
+    printf("%d\n", foo);
+    printf("%d\n", bar);
+    return;
+}
+---
+
+This prints:
+---
+0
+0
+---
+
+Compiling with 'gcc -O2 -fno-inline -mcpu=power7' and you instead get the expected result:
+---
+1123477881
+-1024005767
+---
+
+
+The different between the two programs is:
+
+--- power7.s
++++ power8.s
+@@ -6,9 +6,9 @@
+ 	.globl getWord
+ 	.type	getWord, @function
+ getWord:
+-	stfs 1,-16(1)
+-	ori 2,2,0
+-	lwa 3,-16(1)
++	xscvdpspn 0,1
++	mfvsrwz 3,0
++	extsw 3,3
+ 	blr
+ 	.long 0
+ 	.byte 0,0,0,0,0,0,0,0
+        .size   getWord,.-getWord
+
+
+Seems like qemu doesn't handle xscvdpspn/mfvsrwz correctly.
+
+https://github.com/qemu/qemu/commit/7ee19fb9d682689d36c849576c808cf92e3bae40
+https://github.com/qemu/qemu/commit/f5c0f7f981333da59cc35c3210d05ec1775c97c1
+
+I am running:
+
+qemu-ppc64le-static -L /usr/powerpc64le-linux-gnu ./a.out
+
+This is buggy C.
+
+https://gcc.gnu.org/bugs/#nonbugs_c
+
+The original code used a union.  It generates the same assembler all the same.
+
+The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
+If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.
+
+
+[Expired for QEMU because there has been no activity for 60 days.]
+