On Sat, Dec 30, 2017 at 02:01:41AM +0100, BALATON Zoltan wrote:
I've tried to implement it the way I've suggested and came up with the patch below, but it does not seem to work. I think this is because the arithmetic in get-msec overflows and does not get the right values. Could it be it works in SLOF because that runs on 64bit? Or is something needed to tell Forth to use 64bit values on PPC32? Any ideas?
+static void tb_fetch(void) +{
- unsigned long tbl, tbu;
- do {
tbu = mftbu();
tbl = mftb();
- } while (tbu != mftbu());
- DPUSH(((uint64_t)tbu << 32) | tbl);
+}
Whether the code here is correct or not, it is simpler to just write it as
PUSH(tbl); PUSH(tbu);
Segher