Changes between Version 3 and Version 4 of CarryQueue


Ignore:
Timestamp:
Aug 18, 2010, 7:59:55 AM (9 years ago)
Author:
cameron
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CarryQueue

    v3 v4  
    4747
    4848For each block of data, there may be carries for variables within
    49 the while loop.  Thus, if there are any such variables, the loop
    50 body must be executed at least once.   
     49the while loop.  Thus, if there are any such carries, the loop
     50body must be executed at least once, even if the controlling
     51bitstream is all zero for the block.
    5152
    5253However, once the loop is executed, the input carries have all
     
    6364way such that the first iteration only uses add-with-carry operation
    6465and subsequent iterations use the straight add operation.
     66
     67== Enqueue/Dequeue ==
     68
     69The enqueue/dequeue technique is difficult to implement in C-based code,
     70because there is no way to preserve carry flag values through C code.
     71But the following approach may work with a peephole optimization strategy.
     72
     73Consider two unbounded stream additions with intervering code:
     74{{{
     75  v = t + u
     76  w = ...
     77  z = x + y
     78}}}
     79
     80A dequeue/enqueue inbetween the pair would be ideal, provided
     81that the dequeued carry is preserved across the calculation
     82of w.
     83{{{
     84  v = adc(t, u)
     85  carry_queue = adc(carry_queue, carry_queue) /*enqueue/dequeue*/
     86  w = ...
     87  z = adc(x,y)
     88}}}
     89
     90But the intervening code is almost certain to clobber the carry
     91needed for the calculation of z.
     92
     93
     94
     95
     96