/[smarc]/smarc/src/vmachine/shifter.h
ViewVC logotype

Diff of /smarc/src/vmachine/shifter.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by misto, Sat Dec 28 12:45:29 2002 UTC revision 1.4 by misto, Sat Dec 28 16:28:11 2002 UTC
# Line 26  Line 26 
26    
27    
28  #include "circuit.h"  #include "circuit.h"
29    #include "instr_word.h"
30    
31  // in[0] = Mpx4 ~= A1 ~= reg[src1]  // in[0] = Mpx4 ~= A1 ~= reg[src1]
32  // in[1] = Mpx5 ~= A2 ~= (reg[src2] || imm13 )  // in[1] = Mpx5 ~= A2 ~= (reg[src2] || imm13 )
# Line 33  Line 34 
34    
35  class shifter : public circuit {  class shifter : public circuit {
36          public:          public:
                 enum dir { left, right };  
37                  shifter( int nout )                  shifter( int nout )
38                          : circuit(2, nout) {};                          : circuit(2, nout) {};
39                  void process( dir d ) {                  void process( instr_word op );
                         // FIXME: is this right??  
                         // imm13 shr R[src1] == imm13 >> R[src1] ?  
                         // is specification right?  
                         if ( d == left )  
                                 set_out_all( get_in(1) << get_in(0) );  
                         else  
                                 set_out_all( get_in(1) >> get_in(0) );  
                 }  
           
40  };  };
41    
42  #endif  #endif

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26