Closed tkchia closed 1 year ago
That sounds like an emuppc bug, unfortunately... it's probably worth upgrading to the latest CPU emulator core.
I have, BTW, found a bunch of issues with the test cases as part of other work. (But not that specific test.)
Hello @davidgiven,
Thank you. I believe I am already on the latest version of ACK and emuppc
(https://github.com/davidgiven/ack/commit/6aa3fef91f2662372247cc20abfb1410b26d436a). That is, unless there is another later version of emuppc
which I am unaware of.
Thank you!
Hello @davidgiven,
It seems the bug was because AArch64 handles casts from double
/float
to uint32_t
differently from x86-64 — and for emulating the fctiw
and fctiwz
instructions, what we probably want is the x86-64 behaviour. I have submitted a proposed fix.
On an AArch64 host, (uint32_t) -1.0
basically truncates the negative -1.0 value to 0.
Thank you!
Oops, I thought that emuppc was using a third party emulator library --- turns out I wrote the emulator myself... thank you for the fix!
When I try building ACK for Debian GNU/Linux host on AArch64, I get the following test case failures:
(https://launchpadlibrarian.net/674940994/buildlog_ubuntu-lunar-arm64.ack-compiler_1%3A6.1~pre1-20230214-build20230701-1~lunar_BUILDING.txt.gz)
For some reason, it seems that the test programs actually pass, when I run them under QEMU's
qemu-ppc
rather than ACK'semuppc
. I am not sure what exactly the cause of the failure is.Thank you!