Closed erkyrath closed 1 year ago
Yeah, the mismatch is in DoubleTrigTest() somewhere.
i tried to compile the latest inform6 compiler as well for my M1 mac and got an ARM ARCHITECTURE error.
this may be a trivial fix but i personally do not have the skillset. if possible could someone post an updated inform6 compiler that is universal?
How are you trying to compile it?
You can just type cc -o inform *.c
without further effort. I have tested this on M1 and Intel Macs.
yes, that worked.
sorry, i'm clueless at this and was trying to include the OS-specific flags or something.
thx!
cm
On May 17, 2023, at 10:00 AM, Andrew Plotkin @.***> wrote:
How are you trying to compile it?
You can just type cc -o inform *.c without further effort. I have tested this on M1 and Intel Macs.
— Reply to this email directly, view it on GitHub https://github.com/DavidKinder/Inform6/issues/225#issuecomment-1551453588, or unsubscribe https://github.com/notifications/unsubscribe-auth/A74DAYVREY7CIXM5I6ZF6R3XGTKX5ANCNFSM6AAAAAAYDY3ZFU. You are receiving this because you commented.
No problem -- glad you got it working.
The constant $<+0.8912073600614354
compiles as 1278042936 (0x4c2d6338) on Intel, 1278042935 (0x4c2d6337) on ARM.
I feel like this wasn't true a year ago -- I tested the double opcodes on ARM and didn't see this warning. Oh well.
I'll try updating clang everywhere; maybe that'll bring it back in sync. If not, I'll tweak the test values in glulxercise rather than trying to tweak the compiler.
The difference in double constants turned out to be this line in lexer.c:
fracpow *= 0.1;
After fifteen or sixteen digits (and as many repeated multiplications), this power value diverges on Intel vs ARM.
I tried a couple of different tweaks (fracpow /= 10
, or calling pow10_cheap()). These fixed this case but caused ULP divergence on other cases in glulxercise.
I wound up going with the "tweak the test values in glulxercise" solution. We now test sin(1.2) instead of sin(1.1).
When compiling glulxercise.inf, I get different binary output when compiling on Intel MacOS vs ARM MacOS.
The difference is at address 0x2151B (the function code segment):
This doesn't cause any runtime tests to fail, but it trips a checksum error in the inform6-testing suite.
I suspect float math differences, but I haven't dug into it yet.