Just in case this bites anyone else (and in the, probably forlorn, hope that someone might have a fix), I thought it worth mentioning a bug I have found in the S1 PowerPC compiler (gcc 2.8.1). It seems that the results of converting a "long long" (64-bit integer) to a float (32-bit real) gives bad results, eg.

#include <stdio.h>
int main()
  long long x;
  float y;
  x= 100;
  y= x;
  printf ("%lld (%u) -> %g (%u)\n", x, sizeof (x), y, sizeof (y));
  return 0;
TiVo ~ > gcc -o x x.c -msoft-float -Wall
TiVo ~ > ./x
100 (8) -> 2148 (4)
compared to the same code built on a i686 Linux box:-
100 (8) -> 100 (4)
In contrast, all the other conversions I have tried seem to work fine (eg. long long -> double, float -> long long, etc), though I have not done an exhaustive test.

I see this with both the native and Linux cross-compiler from tivoutils.sourceforge.net, as well as my own Cygwin cross-compiler. Those are all gcc 2.8.1, built from the official TiVo toolchain, I think. I failed in my attempts to build a cross-compiler based on a later version of gcc, so I can't see whether this is specific to gcc 2.8.1.

I found this trouble when building the latest version of pstools (top was showing crazy CPU percentages). Fortunately, it's easy to work round the problem there by using double instead of float.