Eric Botcazou <ebotca...@adacore.com> writes:
>> I Might Be Wrong, but it looks like this won't probe at FIRST + SIZE
>> in the case where SIZE == ROUNDED_SIZE, because the loop exits on that
>> value without probing it.  Should the last line be unconditional,
>> or does the loop need to be a do-while instead?  (I suppose the latter,
>> so that there isn't a hole bigger than PROBE_INTERVAL in the
>> SIZE != ROUNDED_SIZE case?)
>
> The loop probes at FIRST + N * PROBE_INTERVAL for values of N from 1 until it 
> is equal to ROUNDED_SIZE, inclusive, so FIRST + SIZE is always probed.

Doh!  But in that case, rather than:

1:
        beq     r1,r2,2f
        addiu   r1,r1,interval
        b       1b
        sw      $0,0(r1)
2:

why not just:

1:
        addiu   r1,r1,interval
        bne     r1,r2,1b
        sw      $0,0(r1)

?

Richard

Reply via email to