Tue Mar 29 00:03:56 EDT 2011

Clock sync

"begin cond? until" is no longer compiled to bit test + jump
backwards, but to a jump forwards.  Strange.

EDIT: I found this:
 ;; Conditional skip optimisation for 'then'.
 ;; FIXME: not used since we can't mutate then (defined in control.ss)
;;  (([btfsp  p f b a] [bra l1] ,ins [label l2] swapbra)
;;   (if (eq? l1 l2)
;;       `([btfsp ,(flip p) ,f ,b ,a] ,ins)
;;       (error 'then-opti-error)))
;;  ((swapbra) ())

I tried to add it but it doesn't seem to trigger.  Maybe something
changed in the way `label' is handled?

Hmmm... `label:' cuts off a part of the code so the optimization is
not performed.  I don't see a straightforward way to solve this.

  begin cond? until

  sym dum>m label: cond? until

  sym dum>m label: cond? not while repeat

  sym dum>m label: cond? not  sym dup >m jw/false end: m-swap again then

The trouble is the `end:' caused by `if'.

Is it really necessary?  I suppose this is to prevent optimizations to
wipe out the branch in some conditions ; a sane default.

So the wait loop really needs a different approach:

  begin cond? jw/false end:

Maybe "until" is the natural primitive, not jw/false?

Interesting!  This is what works:

  until = ( m> jw/false end: )