ALU32_AND/ALU64_AND bug in common/sim-alu.h

Alexey Makhalov makhaloff@gmail.com
Tue Oct 11 08:12:00 GMT 2011


Typo in a macro. Result instead of a carry flag is cleared, causing
the AND does not work correctly

2010-10-11  Alexey Makhalov  <makhaloff@gmail.com>
        * sim-alu.h (ALU32_AND): Clear carry flag.
        (ALU32_AND): Clear carry flag.
-------------- next part --------------
2010-10-11  Alexey Makhalov  <makhaloff@gmail.com>

        * sim-alu.h (ALU32_AND): Clear carry flag.
        (ALU32_AND): Clear carry flag.



Index: sim/common/sim-alu.h
===================================================================
RCS file: /cvs/src/src/sim/common/sim-alu.h,v
retrieving revision 1.10
diff -c -p -r1.10 sim-alu.h
*** sim/common/sim-alu.h	15 Mar 2011 03:16:17 -0000	1.10
--- sim/common/sim-alu.h	11 Oct 2011 07:38:01 -0000
*************** do {									\
*** 1007,1020 ****
  #define ALU32_AND(VAL)							\
  do {									\
    alu32_r &= (VAL);							\
!   alu32_r = 0;								\
    alu32_v = 0;								\
  } while (0)
  
  #define ALU64_AND(VAL)							\
  do {									\
    alu64_r &= (VAL);							\
!   alu64_r = 0;								\
    alu64_v = 0;								\
  } while (0)
  
--- 1007,1020 ----
  #define ALU32_AND(VAL)							\
  do {									\
    alu32_r &= (VAL);							\
!   alu32_c = 0;								\
    alu32_v = 0;								\
  } while (0)
  
  #define ALU64_AND(VAL)							\
  do {									\
    alu64_r &= (VAL);							\
!   alu64_c = 0;								\
    alu64_v = 0;								\
  } while (0)
  


More information about the Gdb-patches mailing list