projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0baae59
)
Fix function which calculates the carry flag.
author
Gabe Black
<gblack@eecs.umich.edu>
Fri, 20 Jul 2007 21:54:17 +0000
(14:54 -0700)
committer
Gabe Black
<gblack@eecs.umich.edu>
Fri, 20 Jul 2007 21:54:17 +0000
(14:54 -0700)
--HG--
extra : convert_revision :
aeb4f2d4c3936089421dbe80647f28ae36178283
src/base/condcodes.hh
patch
|
blob
|
history
diff --git
a/src/base/condcodes.hh
b/src/base/condcodes.hh
index 10109e4ada4487ae344386513ff48aa37115ecd3..efff12dc8cab2581bc3fa3c4497025162958f390 100644
(file)
--- a/
src/base/condcodes.hh
+++ b/
src/base/condcodes.hh
@@
-32,6
+32,7
@@
#define __BASE_CONDCODE_HH__
#include "base/bitfield.hh"
+#include "base/trace.hh"
/**
* Calculate the carry flag from an addition. This should work even when
@@
-41,7
+42,9
@@
inline
bool
findCarry(int width, uint64_t dest, uint64_t src1, uint64_t src2) {
int shift = width - 1;
- return (~(dest >> shift) + (src1 >> shift) + (src2 >> shift)) & 0x2;
+ return ((~(dest >> shift) & 1) +
+ ((src1 >> shift) & 1) +
+ ((src2 >> shift) & 1)) & 0x2;
}
/**