summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-08-05 02:57:47 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-08-05 02:57:47 -0700
commit860f0f835097e884d15069af22efec9c8d766b4e (patch)
tree378f1f412134857e748743b08b4a88ffdc28ee05
parenta238959c3405a18a085d15be07af20a91ff9340d (diff)
downloadgem5-860f0f835097e884d15069af22efec9c8d766b4e.tar.xz
X86: Fix sign extension when doing an arithmetic shift right by 0.
-rw-r--r--src/arch/x86/isa/microops/regop.isa2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa
index e86e9f00a..4d4079f5f 100644
--- a/src/arch/x86/isa/microops/regop.isa
+++ b/src/arch/x86/isa/microops/regop.isa
@@ -700,7 +700,7 @@ let {{
// Because what happens to the bits shift -in- on a right shift
// is not defined in the C/C++ standard, we have to sign extend
// them manually to be sure.
- uint64_t arithMask =
+ uint64_t arithMask = (shiftAmt == 0) ? 0 :
-bits(psrc1, dataSize * 8 - 1) << (dataSize * 8 - shiftAmt);
DestReg = merge(DestReg, (psrc1 >> shiftAmt) | arithMask, dataSize);
'''