/[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.2 by misto, Tue Dec 3 15:36:16 2002 UTC revision 1.3 by misto, Sat Dec 28 12:45:29 2002 UTC
# Line 27  Line 27 
27    
28  #include "circuit.h"  #include "circuit.h"
29    
30    // in[0] = Mpx4 ~= A1 ~= reg[src1]
31    // in[1] = Mpx5 ~= A2 ~= (reg[src2] || imm13 )
32    //
33    
34  class shifter : public circuit {  class shifter : public circuit {
35          public:          public:
36                  enum dir { left, right };                  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( dir d ) {
40                          for( int i = 0 ; i < num_out() ; i++ )                          // FIXME: is this right??
41                                  if ( d == left )                          // imm13 shr R[src1] == imm13 >> R[src1] ?
42                                          set_out( i, get_in(0) << get_in(1) );                          // is specification right?
43                                  else                          if ( d == left )
44                                          set_out( i, get_in(0) >> get_in(1) );                                  set_out_all( get_in(1) << get_in(0) );
45                            else
46                                    set_out_all( get_in(1) >> get_in(0) );
47                  }                  }
48                    
49  };  };

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

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