summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/instruction/1821444
blob: 0f8cb900acd875a8aa3fa2e75679633318275e7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
instruction: 0.711
runtime: 0.199
syscall: 0.090



qemu-ppc (user) incorrectly translates float32 arithmetics

I'm using qemu-3.1.0 (Gentoo).

When I was running regression test suite via qemu-ppc for GHC I noticed a few uint32_t<->float32 failures I did not expect to encounter.

Here is an example

$ cat a.c
#include <stdio.h>
#include <stdint.h>

int main() {
    volatile uint32_t i = 1;
    printf("0x1 = %e\n", *(volatile float*)&i);
}

$ powerpc-unknown-linux-gnu-gcc -O2 a.c -Wall -o a -fno-strict-aliasing -fno-stack-protector -static && ./a
0x1 = 2.802597e-45

$ scp a timberdoodle.ppc64.dev.gentoo.org:~/
a                                                                                                       100%  826KB 102.0KB/s   00:08    

$ ssh timberdoodle.ppc64.dev.gentoo.org ./a
0x1 = 1.401298e-45
$ qemu-ppc ./a
0x1 = 2.802597e-45

Looks like off-by-one bit somewhere. I'm not sure if it's FPU instruction or some internals of printf() that are emulated incorrectly.