-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm-mos divmod.cc ported from C++ to C incorrectly #7
Comments
Noted. I'll check asap. |
Poke. |
Thanks for the reminder :) |
Yes, and now all llvm-mos tests, including the ones that were working fine before, now take 3 times the previous amount of time and memory as your previous benchmark. This result is not sane. |
613f95a#diff-70f4dc41f1a432a0131e9a2230954d6fad0063199aacd7aac423ec1d987d79afR15 LTO was commented out, which LLVM-MOS relies on strongly for its optimization strategies. A lot of the best tricks in the compiler are not possible without whole-program analysis, which is not available if link-time optimization is not being used. |
Indeed. With '-flto' some tests fail. It needs more deep analyzes what exactly happens. |
Please reopen this issue, or create another corresponding issue. |
This implementation of
udiv
(andumod
,udivmod
) will only work on numbers <= 16 bits. As thepi
benchmark utilizes division oflong
(32 bit) numbers, this will not work correctly and lead to a result error.Using
divmod.cc
and family directly fromllvm-mos-sdk
, as opposed to this patched version, allows thepi
benchmark to give the correct result; as verified by compilingpi.c
directly withllvm-mos-sdk
(after patching _putc and _puts calls).The same applies to
mul.c
, and potentially other files, I have not checked them all.I'm getting similar results with
merge-sort
completing in reasonable time compiled directly withllvm-mos-sdk
's standard library on theatari800
emulator, but failing when compiled throughoricCompilerBenchmark
's suite, but I haven't been able to track those down yet.The text was updated successfully, but these errors were encountered: