Changes between Version 3 and Version 4 of CarryQueue
 Timestamp:
 Aug 18, 2010, 7:59:55 AM (9 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

CarryQueue
v3 v4 47 47 48 48 For 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. 49 the while loop. Thus, if there are any such carries, the loop 50 body must be executed at least once, even if the controlling 51 bitstream is all zero for the block. 51 52 52 53 However, once the loop is executed, the input carries have all … … 63 64 way such that the first iteration only uses addwithcarry operation 64 65 and subsequent iterations use the straight add operation. 66 67 == Enqueue/Dequeue == 68 69 The enqueue/dequeue technique is difficult to implement in Cbased code, 70 because there is no way to preserve carry flag values through C code. 71 But the following approach may work with a peephole optimization strategy. 72 73 Consider two unbounded stream additions with intervering code: 74 {{{ 75 v = t + u 76 w = ... 77 z = x + y 78 }}} 79 80 A dequeue/enqueue inbetween the pair would be ideal, provided 81 that the dequeued carry is preserved across the calculation 82 of 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 90 But the intervening code is almost certain to clobber the carry 91 needed for the calculation of z. 92 93 94 95 96