projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
776e8d5
)
X86: Actual change that fixes div. How did that happen?
author
Gabe Black
<gblack@eecs.umich.edu>
Wed, 12 May 2010 07:49:12 +0000
(
00:49
-0700)
committer
Gabe Black
<gblack@eecs.umich.edu>
Wed, 12 May 2010 07:49:12 +0000
(
00:49
-0700)
src/arch/x86/isa/microops/regop.isa
patch
|
blob
|
history
diff --git
a/src/arch/x86/isa/microops/regop.isa
b/src/arch/x86/isa/microops/regop.isa
index f3fc1fc59489931fba3c980637961175c95537a3..4d31a55456adee0cf8e54ca0cd9f3cd10c924cd2 100644
(file)
--- a/
src/arch/x86/isa/microops/regop.isa
+++ b/
src/arch/x86/isa/microops/regop.isa
@@
-620,14
+620,18
@@
let {{
remaining--;
}
if (dividend & (ULL(1) << 63)) {
+ bool highBit = false;
if (dividend < divisor && remaining) {
+ highBit = true;
dividend = (dividend << 1) |
bits(SrcReg1, remaining - 1);
quotient <<= 1;
remaining--;
}
- quotient++;
- dividend -= divisor;
+ if (highBit || divisor <= dividend) {
+ quotient++;
+ dividend -= divisor;
+ }
}
remainder = dividend;
} else {