Changes between Version 1 and Version 2 of CarryQueue

Mar 10, 2010, 10:48:35 AM (9 years ago)



  • CarryQueue

    v1 v2  
    3232to position the carry variables from the just completed iteration for the
    3333next iteration.
     36== A note on implementation ==
     37The implementation of carry queue has two steps. First we need to modify the current C macro for addition. We need to pick a register the contains the carry queue and use adc on that register rather than lahf, sahf operations. This will affect the template program not the compiler.
     39Second step is in the compiler, where we need to take care of two things. First, when there are more than 64 carries, we will have more than one carry queue. The compiler is responsible to make sure that the right carry queue is loaded at the right time. The second thing that the compiler should take care of is a shift in carry queue that might be needed to be done at the end of processing of each block.
     41The code for handling this issue in the compiler might have dependency on the target language. For example in C we may need to call a macro or function that has inline assembly while in assembly we may do something slightly different. Also it has minor interaction with Factor Out pass of the compiler. If a code for loading/storing carry queues is needed to be put inside an if-then-else statement, this code must be put inside both branches of the statement. So one may prefer to put this pass after the Factor Out pass so that workload of Factor Out does not become larger, but this is not necessary.