While debugging OCaml 4.13.1's testsuite on m68k, I've noticed that the following:
[...]
which seems to be incorrect.
[...]
Another simpler example, not involving unions:
-----8<-----
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char** argv) {
double d[2];
d[0] = NAN;
d[1] = -d[0];
printf("%F\n", d[1]);
}
-----8<-----
returns "-INF" instead of "-NAN".
Hi Stéphane!
On 12/22/21 14:47, Stéphane Glondu wrote:
Another simpler example, not involving unions:
-----8<-----
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char** argv) {
double d[2];
d[0] = NAN;
d[1] = -d[0];
printf("%F\n", d[1]);
}
-----8<-----
returns "-INF" instead of "-NAN".
It might be an emulation issue with QEMU which has some issues with FPU emulation.
I can test it on real hardware but not until after Christmas.
Adrian
With Qemu 6.2.50 (from git repo):
-NAN
With Quadra 800 with 68040 FPU:
NAN
Built with Qemu and debian bookworm/sid, gcc (Debian 10.2.0-15) 10.2.0.
On Quadra 800 it's executed on a debian/etch (not enough memory, 40 MB, to execute sid installer).
So it seems your test works better on Qemu than on real hardware.
First test gives me:
Qemu: fff0000000000001, -NAN
Q800: 7ff8000000000001, NAN
Qemu reuses fonctions common to all emulated archs, so we will have results closer to x86 than to real 68040.
Hi Laurent!
On 12/22/21 17:48, Laurent Vivier wrote:
With Qemu 6.2.50 (from git repo):
-NAN
With Quadra 800 with 68040 FPU:
NAN
Built with Qemu and debian bookworm/sid, gcc (Debian 10.2.0-15) 10.2.0.
On Quadra 800 it's executed on a debian/etch (not enough memory, 40 MB, to execute sid installer).
So it seems your test works better on Qemu than on real hardware.
First test gives me:
Qemu: fff0000000000001, -NAN
Q800: 7ff8000000000001, NAN
Qemu reuses fonctions common to all emulated archs, so we will have results closer to x86 than to real 68040.
I will update the QEMU version on the Debian Porterbox then. Has the latest QEMU version
integrated all the changes for the m68k-virt machine or are there any other patches
missing?
I think the kernel part is not yet fully upstreamed, is it?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:52:37 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,333,608 |
Posted today: | 1 |