-
Notifications
You must be signed in to change notification settings - Fork 2
Description
static __inlinefunc unsigned udiv(unsigned a, unsigned b)
{
This implementation of udiv (and umod, udivmod) will only work on numbers <= 16 bits. As the pi benchmark utilizes division of long (32 bit) numbers, this will not work correctly and lead to a result error.
Using divmod.cc and family directly from llvm-mos-sdk, as opposed to this patched version, allows the pi benchmark to give the correct result; as verified by compiling pi.c directly with llvm-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 with llvm-mos-sdk's standard library on the atari800 emulator, but failing when compiled through oricCompilerBenchmark's suite, but I haven't been able to track those down yet.