On Sun, 24 Jun 2018 20:54:21 -0700, Jakub Kicinski wrote: > + * NOTE: because we are using "reciprocal_value_adv" which doesn't > + * support dividend with MSB set, so we need to JIT separate NFP > + * sequence to handle such case. It could be a simple sequence if there > + * is conditional move, however there isn't for NFP. So, we don't bother > + * generating compare-if-set-branch sequence by rejecting the program > + * straight away when the u32 dividend has MSB set. Divide by such a > + * large constant would be rare in practice. Also, the programmer could > + * simply rewrite it as "result = divisor >= the_const".
Thinking about this again, can we just use carry bit? The code may end up shorter than the explanation why we don't support that case :P immed[c, 0] alu[--, a, -, b] alu[c, c, +carry, 0] Should be equivalent to: c = a >= b (Thanks to Edwin for double-checking the carry semantics.)